Skip to content

Commit

Permalink
Merge pull request #4604 from galaxyproject/diplodocus-tortoise
Browse files Browse the repository at this point in the history
de-dupe icons
  • Loading branch information
hexylena authored Dec 20, 2023
2 parents f92093e + 53bd397 commit 61611ee
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ icon-tag:
point-right: far fa-hand-point-right
pref-info: fas fa-user
pref-password: fas fa-unlock-alt
pref-identities: far fa-id-card-o
pref-identities: far fa-id-card
pref-permissions: fas fa-users
pref-dataprivate: fas fa-lock
pref-apikey: fas fa-key
Expand Down
2 changes: 1 addition & 1 deletion _plugins/author-page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def generate(site)
pusher(t, news_by_author, true) if t['layout'] == 'news'
end

Gtn::Contributors.list(site).reject { |c| c['halloffame'] == 'no' }.each_key do |contributor|
Gtn::Contributors.list(site).each_key do |contributor|
# Using PageWithoutAFile instead of a custom class which reads files
# from disk each time, saves some time, but it is unclear how much
# due to how the previous was accounted. But assuming 0.040s per page * 193 should be about 8 seconds.
Expand Down
4 changes: 4 additions & 0 deletions _plugins/gtn.rb
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,10 @@ def get_default_link(material)

url
end

def group_icons(icons)
icons.group_by{|k, v| v}.map{|k, v| [k, v.map{|z|z[0]} ]}.to_h.invert
end
end
end

Expand Down
5 changes: 4 additions & 1 deletion _plugins/gtn/contributors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ def self.fetch_name(site, c)
# Returns:
# +Hash+ of contributors, funders, organisations merged together
def self.list(site)
site.data['contributors'].merge(site.data['funders']).merge(site.data['organisations'])
site.data['contributors']
.merge(site.data['funders'])
.merge(site.data['organisations'])
.reject { |c| c['halloffame'] == 'no' }
end

##
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ To use icons in your tutorial, take the name of the icon, 'details' in this exam
{% raw %}{% icon details %}{% endraw %}
```

Some icons have multiple aliases, any may be used, but we'd suggest trying to choose the most semantically appropriate one in case Galaxy later decides to change the icon.

The following icons are currently available:

<div class="row">
{% for icon in site["icon-tag"] %}
{% assign icon_groups = site['icon-tag'] | group_icons %}
{% for icon in icon_groups %}
<div class="col-md-2 col-sm-3" style="text-align: center">
<div style="font-size: 400%">{% icon_var icon[0] %}</div>
<div>{{ icon[0] }}</div>
<div style="font-size: 400%">{% icon_var icon[0][0] %}</div>
<div>{% for z in icon[0] %}{{ z }}{%unless forloop.last%},{%endunless%} {% endfor %}</div>
</div>
{% endfor %}
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -1090,11 +1090,14 @@ To use these icons, take the name of the icon, 'details' in this example, and wr
{% raw %}{% icon details %}{% endraw %}
```

Some icons have multiple aliases, any may be used, but we'd suggest trying to choose the most semantically appropriate one in case Galaxy later decides to change the icon.

<div class="row">
{% for icon in site["icon-tag"] %}
{% assign icon_groups = site['icon-tag'] | group_icons %}
{% for icon in icon_groups %}
<div class="col-md-2 col-sm-3" style="text-align: center">
<div style="font-size: 400%">{% icon_var icon[0] %}</div>
<div>{{ icon[0] }}</div>
<div style="font-size: 400%">{% icon_var icon[0][0] %}</div>
<div>{% for z in icon[0] %}{{ z }}{%unless forloop.last%},{%endunless%} {% endfor %}</div>
</div>
{% endfor %}
</div>
Expand Down

0 comments on commit 61611ee

Please sign in to comment.