Update the sort component [SCI-8045]

This commit is contained in:
sboursen-scinote 2023-03-06 12:00:53 +01:00
parent 587606803b
commit 34f324f7ca
2 changed files with 7 additions and 2 deletions

View file

@ -31,10 +31,10 @@
<span><i class="fas fa-sort-amount-down"></i></span>
</button>
<ul id="sortMenuDropdown" class="dropdown-menu sort-projects-menu dropdown-menu-right" aria-labelledby="sortMenu">
<% {new: :newest, old: :oldest, atoz: :alpha_asc, ztoa: :alpha_desc}.each do |name, value| %>
<% {atoz: :alpha_asc, ztoa: :alpha_desc, new: :newest, old: :oldest}.each do |name, value| %>
<li>
<input type='radio' name='sort_by' value='<%= value %>' <%= name == :new ? 'checked' : '' %> />
<label for="<%= value %>"><%= t("general.sort.#{name.to_s}_html") %></label>
<label for="<%= value %>"><%= t("protocols.index.protocolsio.sort.#{name.to_s}_html") %></label>
</li>
<% end %>
</ul>

View file

@ -2852,6 +2852,11 @@ en:
public: "Team protocols"
private: "My protocols"
success_flash: 'Protocol <strong>%{name}</strong> successfully imported to %{type}.'
sort:
new_html: "<i class=\"fas fa-sort-numeric-up\"></i>&nbsp;&nbsp;Newest first"
old_html: "<i class=\"fas fa-sort-numeric-down\"></i>&nbsp;&nbsp;Oldest first"
atoz_html: "<i class=\"fas fa-sort-alpha-down\"></i>&nbsp;&nbsp;Name A to Z"
ztoa_html: "<i class=\"fas fa-sort-alpha-up\"></i>&nbsp;&nbsp;Name Z to A"
steps:
placeholder: 'Enter step name'