Merge pull request #6991 from jvanbaarsen/branch-counter-after-delete

Make sure the branch counter gets updated
This commit is contained in:
Dmitriy Zaporozhets
2014-05-29 15:39:46 +03:00
4 changed files with 7 additions and 3 deletions
@@ -24,10 +24,11 @@ class Projects::BranchesController < Projects::ApplicationController
def destroy
DeleteBranchService.new.execute(project, params[:id], current_user)
@branch_name = params[:id]
respond_to do |format|
format.html { redirect_to project_branches_path(@project) }
format.js { render nothing: true }
format.js
end
end
end
@@ -1,5 +1,5 @@
- commit = @repository.commit(branch.target)
%li
%li(class="js-branch-#{branch.name}")
%h4
= link_to project_tree_path(@project, branch.name) do
%strong= truncate(branch.name, length: 60)
@@ -0,0 +1,3 @@
:plain
$(".js-branch-#{@branch_name}").remove();
$('.js-totalbranch-count').html("#{@repository.branches.size}")
+1 -1
View File
@@ -9,7 +9,7 @@
= nav_link(html_options: {class: branches_tab_class}) do
= link_to project_branches_path(@project) do
Branches
%span.badge= @repository.branches.size
%span.badge.js-totalbranch-count= @repository.branches.size
= nav_link(controller: :tags) do
= link_to project_tags_path(@project) do