mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-20 10:06:04 +10:00
Merge pull request #6991 from jvanbaarsen/branch-counter-after-delete
Make sure the branch counter gets updated
This commit is contained in:
@@ -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}")
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user