Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .dassie/app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,10 @@ def self.modified_field
# except in the relevancy case).
# label is key, solr field is value
config.add_sort_field "score desc, #{uploaded_field} desc", label: "relevance"
config.add_sort_field "#{uploaded_field} desc", label: "date uploaded \u25BC"
config.add_sort_field "#{uploaded_field} asc", label: "date uploaded \u25B2"
config.add_sort_field "#{modified_field} desc", label: "date modified \u25BC"
config.add_sort_field "#{modified_field} asc", label: "date modified \u25B2"
config.add_sort_field "#{uploaded_field} desc", label: I18n.t('hyrax.sort.uploaded.desc')
config.add_sort_field "#{uploaded_field} asc", label: I18n.t('hyrax.sort.uploaded.asc')
config.add_sort_field "#{modified_field} desc", label: I18n.t('hyrax.sort.modified.desc')
config.add_sort_field "#{modified_field} asc", label: I18n.t('hyrax.sort.modified.asc')

# If there are more than this many search results, no spelling ("did you
# mean") suggestion is offered.
Expand Down
8 changes: 4 additions & 4 deletions .koppie/app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,10 @@ def self.modified_field
# except in the relevancy case).
# label is key, solr field is value
config.add_sort_field "score desc, #{uploaded_field} desc", label: "relevance"
config.add_sort_field "#{uploaded_field} desc", label: "date uploaded \u25BC"
config.add_sort_field "#{uploaded_field} asc", label: "date uploaded \u25B2"
config.add_sort_field "#{modified_field} desc", label: "date modified \u25BC"
config.add_sort_field "#{modified_field} asc", label: "date modified \u25B2"
config.add_sort_field "#{uploaded_field} desc", label: I18n.t('hyrax.sort.uploaded.desc')
config.add_sort_field "#{uploaded_field} asc", label: I18n.t('hyrax.sort.uploaded.asc')
config.add_sort_field "#{modified_field} desc", label: I18n.t('hyrax.sort.modified.desc')
config.add_sort_field "#{modified_field} asc", label: I18n.t('hyrax.sort.modified.asc')

# If there are more than this many search results, no spelling ("did you
# mean") suggestion is offered.
Expand Down
5 changes: 4 additions & 1 deletion app/views/hyrax/collections/_default_group.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
<% if Hyrax.config.collection_flexible? %>
<th><%= t("hyrax.dashboard.my.heading.profile_version") %></th>
<% end %>
<th class="sorts-dash"><i id="<%= CatalogController.uploaded_field %>" class="<%= params[:sort] == "#{CatalogController.uploaded_field} desc" ? 'caret' : params[:sort] == "#{CatalogController.uploaded_field} asc" ? 'caret up' : '' %>"></i><%= t("hyrax.dashboard.my.heading.date_uploaded") %></th>
<th class="sorts-dash">
<%= t("hyrax.dashboard.my.heading.date_uploaded") %>
<%= params[:sort] == "#{CatalogController.uploaded_field} desc" ? '(newest first)' : params[:sort] == "#{CatalogController.uploaded_field} asc" ? '(oldest first)' : '' %>
</th>
<th><%= t("hyrax.dashboard.my.heading.visibility") %></th>
<th><%= t("hyrax.dashboard.my.heading.action") %></th>
</tr>
Expand Down
15 changes: 12 additions & 3 deletions app/views/hyrax/users/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,18 @@
<thead>
<tr>
<th><%= t('.avatar') %></th>
<th class="sorts"><i id="name" class="<%= params[:sort].blank? ? 'caret up' : params[:sort] == "name desc" ? 'caret' : params[:sort] == "name" ? 'caret up' : '' %>"></i> <%= t('.user_name') %></th>
<th class="sorts"><i id="login" class="<%= params[:sort] == "login desc" ? 'caret' : params[:sort] == "login" ? 'caret up' : '' %>"></i> <%= t('.user_id') %></th>
<th class="sorts"><i id="department" class="<%= params[:sort] == "department desc" ? 'caret' : params[:sort] == "department" ? 'caret up' : '' %>"></i> <%= t('.department') %></th>
<th class="sorts">
<%= t('.user_name') %>
<%= params[:sort] == "name desc" ? '(Z-A)' : '(A-Z)' %>
</th>
<th class="sorts">
<%= t('.user_id') %>
<%= params[:sort] == "login desc" ? '(Z-A)' : params[:sort] == "login" ? '(A-Z)' : '' %>
</th>
<th class="sorts">
<%= t('.department') %>
<%= params[:sort] == "department desc" ? '(Z-A)' : params[:sort] == "department" ? '(A-Z)' : '' %>
</th>
<th><%= t('.works_created') %></th>
</tr>
</thead>
Expand Down
7 changes: 7 additions & 0 deletions config/locales/hyrax.de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1615,6 +1615,13 @@ de:
link_expired_not_found: Single Use Link abgelaufen oder nicht gefunden
link_not_found: Single Use Link nicht gefunden
sort_label: Sortieren Sie die Auflistung der Artikel
sort:
uploaded:
desc: "Datum hochgeladen (neueste zuerst)"
asc: "Datum hochgeladen (älteste zuerst)"
modified:
desc: "Datum geändert (neueste zuerst)"
asc: "Datum geändert (älteste zuerst)"
static:
mendeley:
contact_form: Kontakt Formular
Expand Down
7 changes: 7 additions & 0 deletions config/locales/hyrax.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1603,6 +1603,13 @@ en:
link_expired_not_found: Single Use Link Expired or Not Found
link_not_found: Single use link Not Found
sort_label: Sort the listing of items
sort:
uploaded:
desc: "date uploaded (newest first)"
asc: "date uploaded (oldest first)"
modified:
desc: "date modified (newest first)"
asc: "date modified (oldest first)"
stats:
work:
header: Work Analytics
Expand Down
7 changes: 7 additions & 0 deletions config/locales/hyrax.es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1624,6 +1624,13 @@ es:
link_expired_not_found: Enlace de uso único caducado o no encontrado
link_not_found: Enlace de uso único no encontrado
sort_label: Ordenar el listado de elementos
sort:
uploaded:
desc: "fecha de carga (más reciente primero)"
asc: "fecha de carga (más antiguo primero)"
modified:
desc: "fecha de modificación (más reciente primero)"
asc: "fecha de modificación (más antiguo primero)"
static:
mendeley:
contact_form: Formulario de contacto
Expand Down
7 changes: 7 additions & 0 deletions config/locales/hyrax.fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1622,6 +1622,13 @@ fr:
link_expired_not_found: Lien à usage unique expiré ou introuvable
link_not_found: Lien à usage unique introuvable
sort_label: Trier la liste des articles
sort:
uploaded:
desc: "date de téléchargement (le plus récent d'abord)"
asc: "date de téléchargement (le plus ancien d'abord)"
modified:
desc: "date de modification (le plus récent d'abord)"
asc: "date de modification (le plus ancien d'abord)"
static:
mendeley:
contact_form: Formulaire de contact
Expand Down
7 changes: 7 additions & 0 deletions config/locales/hyrax.it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1621,6 +1621,13 @@ it:
link_expired_not_found: Link monouso scaduto o non trovato
link_not_found: Link monouso non trovato
sort_label: Ordina l'elenco degli articoli
sort:
uploaded:
desc: "data di caricamento (più recente prima)"
asc: "data di caricamento (più vecchio prima)"
modified:
desc: "data di modifica (più recente prima)"
asc: "data di modifica (più vecchio prima)"
static:
mendeley:
contact_form: Modulo di Contatto
Expand Down
7 changes: 7 additions & 0 deletions config/locales/hyrax.pt-BR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1614,6 +1614,13 @@ pt-BR:
link_expired_not_found: Link de uso único expirado ou não encontrado
link_not_found: Link de uso único não encontrado
sort_label: Ordene a lista de itens
sort:
uploaded:
desc: "data de upload (mais recente primeiro)"
asc: "data de upload (mais antigo primeiro)"
modified:
desc: "data de modificação (mais recente primeiro)"
asc: "data de modificação (mais antigo primeiro)"
static:
mendeley:
contact_form: Formulário de Contato
Expand Down
7 changes: 7 additions & 0 deletions config/locales/hyrax.zh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1619,6 +1619,13 @@ zh:
link_expired_not_found: 单次使用链接已过期或未找到
link_not_found: 单用链接未找到
sort_label: 对清单中单件排序
sort:
uploaded:
desc: "上传日期(最新优先)"
asc: "上传日期(最旧优先)"
modified:
desc: "修改日期(最新优先)"
asc: "修改日期(最旧优先)"
static:
mendeley:
contact_form: 联系表
Expand Down
8 changes: 4 additions & 4 deletions lib/generators/hyrax/templates/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,10 @@ def self.modified_field
# except in the relevancy case).
# label is key, solr field is value
config.add_sort_field "score desc, #{uploaded_field} desc", label: "relevance"
config.add_sort_field "#{uploaded_field} desc", label: "date uploaded \u25BC"
config.add_sort_field "#{uploaded_field} asc", label: "date uploaded \u25B2"
config.add_sort_field "#{modified_field} desc", label: "date modified \u25BC"
config.add_sort_field "#{modified_field} asc", label: "date modified \u25B2"
config.add_sort_field "#{uploaded_field} desc", label: I18n.t('hyrax.sort.uploaded.desc')
config.add_sort_field "#{uploaded_field} asc", label: I18n.t('hyrax.sort.uploaded.asc')
config.add_sort_field "#{modified_field} desc", label: I18n.t('hyrax.sort.modified.desc')
config.add_sort_field "#{modified_field} asc", label: I18n.t('hyrax.sort.modified.asc')

# If there are more than this many search results, no spelling ("did you
# mean") suggestion is offered.
Expand Down
2 changes: 1 addition & 1 deletion spec/features/collection_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@

expect(page).to have_css(".pagination")

select('date modified ▲', from: 'Sort')
select(I18n.t('hyrax.sort.modified.desc'), from: 'Sort')
click_button 'Refresh'

expect(page).to have_text(/Test Resource 0.+1.+2.+3.+4.+5.+6.+7.+8.+9/m)
Expand Down
Loading