Commit a7d3e2b9 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix recent branches order. Added counters

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 83b6e5d6
......@@ -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
......
%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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment