diff options
Diffstat (limited to 'app/helpers/wiki_helper.rb')
-rw-r--r-- | app/helpers/wiki_helper.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/helpers/wiki_helper.rb b/app/helpers/wiki_helper.rb index d6ffd3deafe..017a1861905 100644 --- a/app/helpers/wiki_helper.rb +++ b/app/helpers/wiki_helper.rb @@ -59,14 +59,16 @@ module WikiHelper end end - def wiki_sort_controls(wiki, sort, direction) - sort ||= Wiki::TITLE_ORDER + def wiki_sort_controls(wiki, direction) link_class = 'gl-button btn btn-default btn-icon has-tooltip reverse-sort-btn qa-reverse-sort rspec-reverse-sort' reversed_direction = direction == 'desc' ? 'asc' : 'desc' icon_class = direction == 'desc' ? 'highest' : 'lowest' + title = direction == 'desc' ? _('Sort direction: Descending') : _('Sort direction: Ascending') - link_to(wiki_path(wiki, action: :pages, sort: sort, direction: reversed_direction), - type: 'button', class: link_class, title: _('Sort direction')) do + link_options = { action: :pages, direction: reversed_direction } + + link_to(wiki_path(wiki, **link_options), + type: 'button', class: link_class, title: title) do sprite_icon("sort-#{icon_class}") end end |