summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-11-15 09:18:06 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-11-15 09:18:06 +0200
commita7d3e2b9b6a015e0e4a4e3b84439308bb6fe367a (patch)
treea4aca689037f33d46ad9ac96b9dc1f722a692ec6
parent83b6e5d65a5f25038fd44539436e060319775a8d (diff)
downloadgitlab-ce-a7d3e2b9b6a015e0e4a4e3b84439308bb6fe367a.tar.gz
Fix recent branches order. Added counters
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r--app/models/repository.rb2
-rw-r--r--app/views/projects/branches/_filter.html.haml14
2 files changed, 13 insertions, 3 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index 80918d6de4b..58130700571 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -57,7 +57,7 @@ class Repository
def recent_branches(limit = 20)
branches.sort do |a, b|
- a.commit.committed_date <=> b.commit.committed_date
+ b.commit.committed_date <=> a.commit.committed_date
end[0..limit]
end
diff --git a/app/views/projects/branches/_filter.html.haml b/app/views/projects/branches/_filter.html.haml
index 7ea11a74a2b..7e1478292e0 100644
--- a/app/views/projects/branches/_filter.html.haml
+++ b/app/views/projects/branches/_filter.html.haml
@@ -1,12 +1,22 @@
%ul.nav.nav-pills.nav-stacked
= nav_link(path: 'branches#recent') do
- = link_to 'Recent', recent_project_branches_path(@project)
+ = link_to recent_project_branches_path(@project) do
+ Recent
+ .pull-right
+ = @repository.recent_branches.count
+
= nav_link(path: 'protected_branches#index') do
= link_to project_protected_branches_path(@project) do
Protected
%i.icon-lock
+ .pull-right
+ = @project.protected_branches.count
+
= nav_link(path: 'branches#index') do
- = link_to 'All branches', project_branches_path(@project)
+ = link_to project_branches_path(@project) do
+ All branches
+ .pull-right
+ = @repository.branch_names.count
%hr