Commit 900419c4 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Improve UI for tags page

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 26677fbe
......@@ -39,13 +39,9 @@ class Projects::TagsController < Projects::ApplicationController
def destroy
DeleteTagService.new(project, current_user).execute(params[:id])
release = project.releases.find_by(tag: params[:id])
release.destroy if release
respond_to do |format|
format.html do
redirect_to namespace_project_tags_path(@project.namespace,
@project)
end
format.js
end
redirect_to namespace_project_tags_path(@project.namespace, @project)
end
end
%span.btn-group.btn-grouped
= link_to archive_namespace_project_repository_path(project.namespace, project, ref: ref, format: 'zip'), class: 'btn btn-default', rel: 'nofollow' do
%i.fa.fa-download
%span source code
%a.btn.btn-default.dropdown-toggle{ 'data-toggle' => 'dropdown' }
%span.caret
%span.sr-only
Select Archive Format
%ul.col-xs-10.dropdown-menu{ role: 'menu' }
%li
= link_to archive_namespace_project_repository_path(project.namespace, project, ref: ref, format: 'zip'), rel: 'nofollow' do
%i.fa.fa-download
%span Download zip
%li
= link_to archive_namespace_project_repository_path(project.namespace, project, ref: ref, format: 'tar.gz'), rel: 'nofollow' do
%i.fa.fa-download
%span Download tar.gz
......@@ -4,22 +4,20 @@
%div
= link_to namespace_project_tag_path(@project.namespace, @project, tag.name) do
%strong
%i.fa.fa-tag
= icon('tag')
= tag.name
- if tag.message.present?
&nbsp;
= strip_gpg_signature(tag.message)
- if release
&nbsp;
%span.label.label-success release
.controls
= link_to edit_namespace_project_tag_release_path(@project.namespace, @project, tag.name), class: 'btn-grouped btn' do
= icon("pencil")
- if can? current_user, :download_code, @project
= render 'projects/repositories/download_archive', ref: tag.name, btn_class: 'btn-grouped btn-group-xs'
- if can?(current_user, :admin_project, @project)
= link_to namespace_project_tag_path(@project.namespace, @project, tag.name), class: 'btn btn-xs btn-remove remove-row grouped', method: :delete, data: { confirm: 'Removed tag cannot be restored. Are you sure?'}, remote: true do
%i.fa.fa-trash-o
= render 'projects/tags/download', ref: tag.name, project: @project
- if commit
= render 'projects/branches/commit', commit: commit, project: @project
......
$('.js-totaltags-count').html("#{@repository.tags.size}")
- if @repository.tags.size == 0
$('.tags').load(document.URL + ' .nothing-here-block').hide().fadeIn(1000)
......@@ -6,6 +6,16 @@
.pull-right
= link_to edit_namespace_project_tag_release_path(@project.namespace, @project, @tag.name), class: 'btn-grouped btn' do
= icon("pencil")
= link_to namespace_project_tree_path(@project.namespace, @project, @tag.name), class: 'btn btn-grouped' do
= icon('files-o')
= link_to namespace_project_commits_path(@project.namespace, @project, @tag.name), class: 'btn btn-grouped' do
= icon('history')
- if can? current_user, :download_code, @project
= render 'projects/tags/download', ref: @tag.name, project: @project
- if can?(current_user, :admin_project, @project)
.pull-right
= link_to namespace_project_tag_path(@project.namespace, @project, @tag.name), class: 'btn btn-remove remove-row grouped', method: :delete, data: { confirm: 'Removed tag cannot be restored. Are you sure?'} do
%i.fa.fa-trash-o
- if @tag.message.present?
.title
%strong= @tag.name
......@@ -24,18 +34,6 @@
- else
This tag has no release notes yet. Press edit button to add one
.gray-content-block.middle-block.clearfix
= link_to namespace_project_tree_path(@project.namespace, @project, @tag.name), class: 'btn btn-grouped' do
Browse code
= link_to namespace_project_commits_path(@project.namespace, @project, @tag.name), class: 'btn btn-grouped' do
Commits
- if can? current_user, :download_code, @project
= render 'projects/repositories/download_archive', ref: @tag.name, btn_class: 'btn-grouped'
- if can?(current_user, :admin_project, @project)
.pull-right
= link_to namespace_project_tag_path(@project.namespace, @project, @tag.name), class: 'btn btn-remove remove-row grouped', method: :delete, data: { confirm: 'Removed tag cannot be restored. Are you sure?'}, remote: true do
%i.fa.fa-trash-o
.gray-content-block.second-block
- if @commit
= render 'projects/commits/commit', commit: @commit, project: @project
......
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