forked from gitlabhq/gitlabhq
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move repo tags to own controller. add ability to remove tags
- Loading branch information
1 parent
a165a0b
commit 132caae
Showing
10 changed files
with
77 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
class Projects::TagsController < Projects::ApplicationController | ||
# Authorize | ||
before_filter :authorize_read_project! | ||
before_filter :authorize_code_access! | ||
before_filter :require_non_empty_project | ||
|
||
before_filter :authorize_admin_project!, only: [:destroy, :create] | ||
|
||
def index | ||
@tags = Kaminari.paginate_array(@project.repository.tags).page(params[:page]).per(30) | ||
end | ||
|
||
def create | ||
# TODO: implement | ||
end | ||
|
||
def destroy | ||
tag = @project.repository.tags.find { |tag| tag.name == params[:id] } | ||
|
||
if tag && @project.repository.rm_tag(tag.name) | ||
Event.create_rm_ref(@project, current_user, tag, 'refs/tags') | ||
end | ||
|
||
respond_to do |format| | ||
format.html { redirect_to project_tags_path } | ||
format.js { render nothing: true } | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters