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 ...@@ -39,13 +39,9 @@ class Projects::TagsController < Projects::ApplicationController
def destroy def destroy
DeleteTagService.new(project, current_user).execute(params[:id]) DeleteTagService.new(project, current_user).execute(params[:id])
release = project.releases.find_by(tag: params[:id])
release.destroy if release
respond_to do |format| redirect_to namespace_project_tags_path(@project.namespace, @project)
format.html do
redirect_to namespace_project_tags_path(@project.namespace,
@project)
end
format.js
end
end end
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 @@ ...@@ -4,22 +4,20 @@
%div %div
= link_to namespace_project_tag_path(@project.namespace, @project, tag.name) do = link_to namespace_project_tag_path(@project.namespace, @project, tag.name) do
%strong %strong
%i.fa.fa-tag = icon('tag')
= tag.name = tag.name
- if tag.message.present? - if tag.message.present?
&nbsp; &nbsp;
= strip_gpg_signature(tag.message) = strip_gpg_signature(tag.message)
- if release - if release
&nbsp;
%span.label.label-success release %span.label.label-success release
.controls .controls
= link_to edit_namespace_project_tag_release_path(@project.namespace, @project, tag.name), class: 'btn-grouped btn' do = link_to edit_namespace_project_tag_release_path(@project.namespace, @project, tag.name), class: 'btn-grouped btn' do
= icon("pencil") = icon("pencil")
- if can? current_user, :download_code, @project - if can? current_user, :download_code, @project
= render 'projects/repositories/download_archive', ref: tag.name, btn_class: 'btn-grouped btn-group-xs' = render 'projects/tags/download', ref: tag.name, project: @project
- 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
- if commit - if commit
= render 'projects/branches/commit', commit: commit, project: @project = 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 @@ ...@@ -6,6 +6,16 @@
.pull-right .pull-right
= link_to edit_namespace_project_tag_release_path(@project.namespace, @project, @tag.name), class: 'btn-grouped btn' do = link_to edit_namespace_project_tag_release_path(@project.namespace, @project, @tag.name), class: 'btn-grouped btn' do
= icon("pencil") = 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? - if @tag.message.present?
.title .title
%strong= @tag.name %strong= @tag.name
...@@ -24,18 +34,6 @@ ...@@ -24,18 +34,6 @@
- else - else
This tag has no release notes yet. Press edit button to add one 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 .gray-content-block.second-block
- if @commit - if @commit
= render 'projects/commits/commit', commit: @commit, project: @project = 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