Commit 9c7a9d92ff2d3fc8e1caf7c74fc72d10dbf6da37
Exists in
spb-stable
and in
3 other branches
Merge pull request #6773 from tsigo/rs-tag-page-sorting
Use VersionSorter on the Project > Tags page
Showing
2 changed files
with
4 additions
and
3 deletions
Show diff stats
app/controllers/projects/tags_controller.rb
@@ -8,7 +8,8 @@ class Projects::TagsController < Projects::ApplicationController | @@ -8,7 +8,8 @@ class Projects::TagsController < Projects::ApplicationController | ||
8 | before_filter :authorize_admin_project!, only: [:destroy] | 8 | before_filter :authorize_admin_project!, only: [:destroy] |
9 | 9 | ||
10 | def index | 10 | def index |
11 | - @tags = Kaminari.paginate_array(@repository.tags.reverse).page(params[:page]).per(30) | 11 | + sorted = VersionSorter.rsort(@repository.tag_names) |
12 | + @tags = Kaminari.paginate_array(sorted).page(params[:page]).per(30) | ||
12 | end | 13 | end |
13 | 14 | ||
14 | def create | 15 | def create |
app/views/projects/tags/index.html.haml
@@ -7,13 +7,13 @@ | @@ -7,13 +7,13 @@ | ||
7 | New tag | 7 | New tag |
8 | 8 | ||
9 | %p | 9 | %p |
10 | - Tags give ability to mark specific points in history as being important | 10 | + Tags give the ability to mark specific points in history as being important |
11 | %hr | 11 | %hr |
12 | 12 | ||
13 | - unless @tags.empty? | 13 | - unless @tags.empty? |
14 | %ul.bordered-list | 14 | %ul.bordered-list |
15 | - @tags.each do |tag| | 15 | - @tags.each do |tag| |
16 | - = render 'tag', tag: tag | 16 | + = render 'tag', tag: @repository.find_tag(tag) |
17 | 17 | ||
18 | = paginate @tags, theme: 'gitlab' | 18 | = paginate @tags, theme: 'gitlab' |
19 | 19 |