diff options
author | Alejandro RodrÃguez <alejorro70@gmail.com> | 2016-06-16 20:33:29 +0300 |
---|---|---|
committer | Alejandro RodrÃguez <alejorro70@gmail.com> | 2016-06-16 20:33:29 +0300 |
commit | 7022357c8cd7888e04252b8964882d0e081032df (patch) | |
tree | eccbd555c8494f733c598d18be93d046f84af975 /app/controllers/projects/tags_controller.rb | |
parent | d9812bae49db3b3af7afe702d7b60d75f05d0fad (diff) |
Add sorting dropdown to tag page
Diffstat (limited to 'app/controllers/projects/tags_controller.rb')
-rw-r--r-- | app/controllers/projects/tags_controller.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/controllers/projects/tags_controller.rb b/app/controllers/projects/tags_controller.rb index 46b242aa5ff..6dc495247c8 100644 --- a/app/controllers/projects/tags_controller.rb +++ b/app/controllers/projects/tags_controller.rb @@ -6,8 +6,10 @@ class Projects::TagsController < Projects::ApplicationController before_action :authorize_admin_project!, only: [:destroy] def index - sorted = VersionSorter.rsort(@repository.tag_names) - @tags = Kaminari.paginate_array(sorted).page(params[:page]) + @sort = params[:sort] || 'name' + @tags = @repository.tags_sorted_by(@sort) + @tags = Kaminari.paginate_array(@tags).page(params[:page]) + @releases = project.releases.where(tag: @tags) end |