Make the tags delete button remote in the tags list
This commit is contained in:
parent
550d314839
commit
722d74c7e9
|
@ -34,6 +34,11 @@ class Projects::TagsController < Projects::ApplicationController
|
|||
def destroy
|
||||
DeleteTagService.new(project, current_user).execute(params[:id])
|
||||
|
||||
redirect_to namespace_project_tags_path(@project.namespace, @project)
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
redirect_to namespace_project_tags_path(@project.namespace, @project)
|
||||
end
|
||||
format.js
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
= icon("pencil")
|
||||
|
||||
- if can?(current_user, :admin_project, @project)
|
||||
= link_to namespace_project_tag_path(@project.namespace, @project, tag.name), class: 'btn btn-grouped btn-xs btn-remove remove-row has_tooltip', title: "Delete tag", method: :delete, data: { confirm: "Deleting the '#{tag.name}' tag cannot be undone. Are you sure?", container: 'body' } do
|
||||
= link_to namespace_project_tag_path(@project.namespace, @project, tag.name), class: 'btn btn-grouped btn-xs btn-remove remove-row has_tooltip', title: "Delete tag", method: :delete, data: { confirm: "Deleting the '#{tag.name}' tag cannot be undone. Are you sure?", container: 'body' }, remote: true do
|
||||
= icon("trash-o")
|
||||
|
||||
- if commit
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
$('.js-totaltags-count').html("#{@repository.tags.size}");
|
||||
- if @repository.tags.empty?
|
||||
$('.tags').load(document.URL + ' .nothing-here-block').hide().fadeIn(1000)
|
Loading…
Reference in New Issue