Commit 62b22583 authored by Annabel Dunstone Gray's avatar Annabel Dunstone Gray

Merge branch '1659-long-tag-title' into 'master'

Truncate the tag description and improve mobile layout for individual tag

Closes #1659

See merge request !8220
parents 55dc0941 dca0a42a
...@@ -57,6 +57,11 @@ pre { ...@@ -57,6 +57,11 @@ pre {
border-radius: 0; border-radius: 0;
color: $well-pre-color; color: $well-pre-color;
} }
&.wrap {
word-break: break-word;
white-space: pre-wrap;
}
} }
hr { hr {
...@@ -67,6 +72,17 @@ hr { ...@@ -67,6 +72,17 @@ hr {
@include str-truncated; @include str-truncated;
} }
.block-truncated {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
> div,
.str-truncated {
display: inline;
}
}
.item-title { font-weight: 600; } .item-title { font-weight: 600; }
/** FLASH message **/ /** FLASH message **/
......
...@@ -208,6 +208,11 @@ ul.content-list { ...@@ -208,6 +208,11 @@ ul.content-list {
padding-right: 8px; padding-right: 8px;
} }
.row-fixed-content {
flex: 0 0 auto;
margin-left: auto;
}
.row-title { .row-title {
font-weight: 600; font-weight: 600;
} }
......
...@@ -165,6 +165,8 @@ ...@@ -165,6 +165,8 @@
padding: 11px 0; padding: 11px 0;
margin-bottom: 0; margin-bottom: 0;
> .btn,
> .btn-container,
> .dropdown { > .dropdown {
margin-right: $gl-padding-top; margin-right: $gl-padding-top;
display: inline-block; display: inline-block;
...@@ -172,16 +174,7 @@ ...@@ -172,16 +174,7 @@
&:last-child { &:last-child {
margin-right: 0; margin-right: 0;
} float: right;
}
> .btn {
margin-right: $gl-padding-top;
display: inline-block;
vertical-align: top;
&:last-child {
margin-right: 0;
} }
} }
...@@ -427,4 +420,36 @@ ...@@ -427,4 +420,36 @@
border-bottom: none; border-bottom: none;
} }
} }
} }
\ No newline at end of file
@media (max-width: $screen-xs-max) {
.top-area .nav-controls {
$controls-margin: $btn-xs-side-margin - 2px;
&.controls-flex {
display: flex;
flex-flow: row wrap;
align-items: center;
justify-content: center;
padding: 0 0 $gl-padding-top;
}
.controls-item,
.controls-item:last-child {
flex: 1 1 35%;
display: block;
width: 100%;
margin: $controls-margin;
.btn,
.dropdown {
margin: 0;
}
}
.controls-item-full {
@extend .controls-item;
flex: 1 1 100%;
}
}
}
- commit = @repository.commit(tag.dereferenced_target) - commit = @repository.commit(tag.dereferenced_target)
- release = @releases.find { |release| release.tag == tag.name } - release = @releases.find { |release| release.tag == tag.name }
%li %li.flex-row
%div .row-main-content.str-truncated
= link_to namespace_project_tag_path(@project.namespace, @project, tag.name) do = link_to namespace_project_tag_path(@project.namespace, @project, tag.name) do
%span.item-title %span.item-title
= icon('tag') = icon('tag')
...@@ -10,24 +10,25 @@ ...@@ -10,24 +10,25 @@
   
= strip_gpg_signature(tag.message) = strip_gpg_signature(tag.message)
.controls - if commit
= render 'projects/buttons/download', project: @project, ref: tag.name .block-truncated
= render 'projects/branches/commit', commit: commit, project: @project
- else
%p
Cant find HEAD commit for this tag
- if release && release.description.present?
.description.prepend-top-default
.wiki
= preserve do
= markdown_field(release, :description)
- if can?(current_user, :push_code, @project) .row-fixed-content.controls
= link_to edit_namespace_project_tag_release_path(@project.namespace, @project, tag.name), class: 'btn has-tooltip', title: "Edit release notes", data: { container: "body" } do = render 'projects/buttons/download', project: @project, ref: tag.name
= icon("pencil")
- if can?(current_user, :admin_project, @project) - if can?(current_user, :push_code, @project)
= link_to namespace_project_tag_path(@project.namespace, @project, tag.name), class: 'btn 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 = link_to edit_namespace_project_tag_release_path(@project.namespace, @project, tag.name), class: 'btn has-tooltip', title: "Edit release notes", data: { container: "body" } do
= icon("trash-o") = icon("pencil")
- if commit - if can?(current_user, :admin_project, @project)
= render 'projects/branches/commit', commit: commit, project: @project = link_to namespace_project_tag_path(@project.namespace, @project, tag.name), class: 'btn 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
- else = icon("trash-o")
%p
Cant find HEAD commit for this tag
- if release && release.description.present?
.description.prepend-top-default
.wiki
= preserve do
= markdown_field(release, :description)
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
= form_tag(filter_tags_path, method: :get) do = form_tag(filter_tags_path, method: :get) do
= search_field_tag :search, params[:search], { placeholder: 'Filter by tag name', id: 'tag-search', class: 'form-control search-text-input input-short', spellcheck: false } = search_field_tag :search, params[:search], { placeholder: 'Filter by tag name', id: 'tag-search', class: 'form-control search-text-input input-short', spellcheck: false }
.dropdown.inline .dropdown
%button.dropdown-toggle{ type: 'button', data: { toggle: 'dropdown'} } %button.dropdown-toggle.btn{ type: 'button', data: { toggle: 'dropdown'} }
%span.light %span.light
= projects_sort_options_hash[@sort] = projects_sort_options_hash[@sort]
= icon('chevron-down') = icon('chevron-down')
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
.tags .tags
- if @tags.any? - if @tags.any?
%ul.content-list %ul.flex-list.content-list
= render partial: 'tag', collection: @tags = render partial: 'tag', collection: @tags
= paginate @tags, theme: 'gitlab' = paginate @tags, theme: 'gitlab'
......
...@@ -12,21 +12,23 @@ ...@@ -12,21 +12,23 @@
- else - else
Cant find HEAD commit for this tag Cant find HEAD commit for this tag
.nav-controls .nav-controls.controls-flex
- if can?(current_user, :push_code, @project) - if can?(current_user, :push_code, @project)
= link_to edit_namespace_project_tag_release_path(@project.namespace, @project, @tag.name), class: 'btn has-tooltip', title: 'Edit release notes' do = link_to edit_namespace_project_tag_release_path(@project.namespace, @project, @tag.name), class: 'btn controls-item has-tooltip', title: 'Edit release notes' do
= icon("pencil") = icon("pencil")
= link_to namespace_project_tree_path(@project.namespace, @project, @tag.name), class: 'btn has-tooltip', title: 'Browse files' do = link_to namespace_project_tree_path(@project.namespace, @project, @tag.name), class: 'btn controls-item has-tooltip', title: 'Browse files' do
= icon('files-o') = icon('files-o')
= link_to namespace_project_commits_path(@project.namespace, @project, @tag.name), class: 'btn has-tooltip', title: 'Browse commits' do = link_to namespace_project_commits_path(@project.namespace, @project, @tag.name), class: 'btn controls-item has-tooltip', title: 'Browse commits' do
= icon('history') = icon('history')
= render 'projects/buttons/download', project: @project, ref: @tag.name .btn-container.controls-item
= render 'projects/buttons/download', project: @project, ref: @tag.name
- if can?(current_user, :admin_project, @project) - if can?(current_user, :admin_project, @project)
.pull-right .btn-container.controls-item-full
= link_to namespace_project_tag_path(@project.namespace, @project, @tag.name), class: 'btn btn-remove remove-row has-tooltip', title: "Delete tag", method: :delete, data: { confirm: "Deleting the '#{@tag.name}' tag cannot be undone. Are you sure?" } do = link_to namespace_project_tag_path(@project.namespace, @project, @tag.name), class: 'btn btn-remove remove-row has-tooltip', title: "Delete tag", method: :delete, data: { confirm: "Deleting the '#{@tag.name}' tag cannot be undone. Are you sure?" } do
%i.fa.fa-trash-o %i.fa.fa-trash-o
- if @tag.message.present? - if @tag.message.present?
%pre.body %pre.wrap
= strip_gpg_signature(@tag.message) = strip_gpg_signature(@tag.message)
.append-bottom-default.prepend-top-default .append-bottom-default.prepend-top-default
......
...@@ -34,7 +34,7 @@ feature 'Master creates tag', feature: true do ...@@ -34,7 +34,7 @@ feature 'Master creates tag', feature: true do
expect(current_path).to eq( expect(current_path).to eq(
namespace_project_tag_path(project.namespace, project, 'v3.0')) namespace_project_tag_path(project.namespace, project, 'v3.0'))
expect(page).to have_content 'v3.0' expect(page).to have_content 'v3.0'
page.within 'pre.body' do page.within 'pre.wrap' do
expect(page).to have_content "Awesome tag message\n\n- hello\n- world" expect(page).to have_content "Awesome tag message\n\n- hello\n- world"
end end
end end
......
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