Commit a7d3e2b9b6a015e0e4a4e3b84439308bb6fe367a
1 parent
83b6e5d6
Exists in
master
and in
4 other branches
Fix recent branches order. Added counters
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
2 changed files
with
13 additions
and
3 deletions
Show diff stats
app/models/repository.rb
@@ -57,7 +57,7 @@ class Repository | @@ -57,7 +57,7 @@ class Repository | ||
57 | 57 | ||
58 | def recent_branches(limit = 20) | 58 | def recent_branches(limit = 20) |
59 | branches.sort do |a, b| | 59 | branches.sort do |a, b| |
60 | - a.commit.committed_date <=> b.commit.committed_date | 60 | + b.commit.committed_date <=> a.commit.committed_date |
61 | end[0..limit] | 61 | end[0..limit] |
62 | end | 62 | end |
63 | 63 |
app/views/projects/branches/_filter.html.haml
1 | %ul.nav.nav-pills.nav-stacked | 1 | %ul.nav.nav-pills.nav-stacked |
2 | = nav_link(path: 'branches#recent') do | 2 | = nav_link(path: 'branches#recent') do |
3 | - = link_to 'Recent', recent_project_branches_path(@project) | 3 | + = link_to recent_project_branches_path(@project) do |
4 | + Recent | ||
5 | + .pull-right | ||
6 | + = @repository.recent_branches.count | ||
7 | + | ||
4 | = nav_link(path: 'protected_branches#index') do | 8 | = nav_link(path: 'protected_branches#index') do |
5 | = link_to project_protected_branches_path(@project) do | 9 | = link_to project_protected_branches_path(@project) do |
6 | Protected | 10 | Protected |
7 | %i.icon-lock | 11 | %i.icon-lock |
12 | + .pull-right | ||
13 | + = @project.protected_branches.count | ||
14 | + | ||
8 | = nav_link(path: 'branches#index') do | 15 | = nav_link(path: 'branches#index') do |
9 | - = link_to 'All branches', project_branches_path(@project) | 16 | + = link_to project_branches_path(@project) do |
17 | + All branches | ||
18 | + .pull-right | ||
19 | + = @repository.branch_names.count | ||
10 | 20 | ||
11 | 21 | ||
12 | %hr | 22 | %hr |