diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb index 5fc843b420d..9078fc2920d 100644 --- a/app/controllers/wiki_controller.rb +++ b/app/controllers/wiki_controller.rb @@ -307,11 +307,19 @@ def diff def index @title = I18n.t('wiki_controller.wiki') - - order_string = if params[:order] == 'alphabetic' - 'node_revisions.title ASC' - else - 'node_revisions.timestamp DESC' + sort_param = params[:sort] + order_string = 'node_revisions.timestamp DESC' + + if sort_param == 'title' + order_string = 'node_revisions.title ASC' + elsif sort_param == 'last_edited' + order_string = 'node_revisions.timestamp DESC' + elsif sort_param == 'edits' + order_string = 'drupal_node_revisions_count DESC' + elsif sort_param == 'page_views' + order_string = 'views DESC' + elsif sort_param == 'likes' + order_string = 'cached_likes DESC' end @wikis = Node.includes(:revision) diff --git a/app/views/tag/index.html.erb b/app/views/tag/index.html.erb index c753701506e..a21a877ca64 100644 --- a/app/views/tag/index.html.erb +++ b/app/views/tag/index.html.erb @@ -21,11 +21,11 @@ - - + + <% if current_user %> - + <% end %> <% @tags.each do |tag| %> diff --git a/app/views/wiki/_wikis.html.erb b/app/views/wiki/_wikis.html.erb index 6523a1e9112..884318d0174 100644 --- a/app/views/wiki/_wikis.html.erb +++ b/app/views/wiki/_wikis.html.erb @@ -1,7 +1,10 @@
<%= t('tag.index.tag') %> <%= t('tag.index.number_of_uses') %> <%= t('tag.index.tag') %> <%= t('tag.index.number_of_uses') %> <%= t('tag.index.number_of_subscriptions')%><%= t('tag.index.subscriptions') %> <%= t('tag.index.subscriptions') %>
- <%= raw t('wiki._wikis.table_content') %> - + + + + + <% @wikis.each do |wiki| %> diff --git a/app/views/wiki/index.html.erb b/app/views/wiki/index.html.erb index 0ce57fe6af7..2ee5e2c44f3 100644 --- a/app/views/wiki/index.html.erb +++ b/app/views/wiki/index.html.erb @@ -22,40 +22,11 @@ <%= t('wiki.index.create_wiki_page') %> - <%= t('wiki.index.sort_by') %> - - <% if params[:action] == "index" && params[:order] !="alphabetic" %> - <%= t('wiki.index.by_recency') %> | - <% else %> - <%= t('wiki.index.by_recency') %> | - <% end %> - - <% if params[:order] == "alphabetic" %> - <%= t('wiki.index.by_alphabetic') %> | - <% else %> - <%= t('wiki.index.by_alphabetic') %> | - <% end %> - - <% if params[:action] == "liked" %> - <%= t('wiki.index.by_number_of_likes') %> | - <% else %> - <%= t('wiki.index.by_number_of_likes') %> | - <% end %> - - - <% if params[:action] == "popular" %> - <%= t('wiki.index.by_popularity') %> - <% else %> - <%= t('wiki.index.by_popularity') %> - <% end %> - -

- <%= render :partial => "wiki/wikis" %>
+ - diff --git a/config/locales/views/wiki/_wikis/en.yml b/config/locales/views/wiki/_wikis/en.yml index c008f365d19..0bb04beb5ad 100644 --- a/config/locales/views/wiki/_wikis/en.yml +++ b/config/locales/views/wiki/_wikis/en.yml @@ -3,11 +3,10 @@ en: wiki: _wikis: - table_content: | - - - - + title: 'Title' + last_edited: 'Last edited' + edits: 'Edits' + page_views: 'Page Views' likes: 'Likes' by: 'by' \ No newline at end of file
<%= t('wiki._wikis.likes') %> <%= t('wiki._wikis.title') %> <%= t('wiki._wikis.last_edited') %> <%= t('wiki._wikis.edits') %> <%= t('wiki._wikis.page_views') %> <%= t('wiki._wikis.likes') %>
TitleLast editedEdits