summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorMayra Cabrera <mcabrera@gitlab.com>2017-11-04 14:51:26 -0400
committerMayra Cabrera <mcabrera@gitlab.com>2017-11-06 06:12:35 +0100
commit70b8f421ae6587d2a57db40e7487bf2dd788cbde (patch)
tree5fbee71dc43e9f637c717a2852bd6310ce286acf /app
parent4585f358b923bb9b4ab36a0c3e4682b060e088a7 (diff)
downloadgitlab-ce-70b8f421ae6587d2a57db40e7487bf2dd788cbde.tar.gz
Modifies commit branches section
- Display the default branch (if the limit is not exceeded) - Requires '...' to be clicked before showing the rest of the branches and/or tags - Fixes haml lints
Diffstat (limited to 'app')
-rw-r--r--app/views/projects/commit/_commit_box.html.haml2
-rw-r--r--app/views/projects/commit/_limit_exceeded_message.html.haml4
-rw-r--r--app/views/projects/commit/branches.html.haml18
3 files changed, 15 insertions, 9 deletions
diff --git a/app/views/projects/commit/_commit_box.html.haml b/app/views/projects/commit/_commit_box.html.haml
index cd93886bb24..b1beb2ff368 100644
--- a/app/views/projects/commit/_commit_box.html.haml
+++ b/app/views/projects/commit/_commit_box.html.haml
@@ -61,7 +61,7 @@
%span.cgray= n_('parent', 'parents', @commit.parents.count)
- @commit.parents.each do |parent|
= link_to parent.short_id, project_commit_path(@project, parent), class: "commit-sha"
- %div.commit-info.branches
+ .commit-info.branches
%i.fa.fa-spinner.fa-spin
- if @commit.last_pipeline
diff --git a/app/views/projects/commit/_limit_exceeded_message.html.haml b/app/views/projects/commit/_limit_exceeded_message.html.haml
index b3372108321..430ac6df2e4 100644
--- a/app/views/projects/commit/_limit_exceeded_message.html.haml
+++ b/app/views/projects/commit/_limit_exceeded_message.html.haml
@@ -1,8 +1,8 @@
-.has-tooltip{class: "limit-box limit-box-#{objects.singularize}", data: { title: "Project has too many #{objects} to search"} }
+.has-tooltip{ class: "limit-box limit-box-#{objects.singularize}", data: { title: "Project has too many #{objects} to search"} }
.limit-icon
- if objects == "branches"
= icon('code-fork')
- else
= icon('tag')
.limit-message
- %span= "#{objects.capitalize} unavailable"
+ %span #{objects.capitalize} unavailable
diff --git a/app/views/projects/commit/branches.html.haml b/app/views/projects/commit/branches.html.haml
index d282eb47914..1c4f16b5afa 100644
--- a/app/views/projects/commit/branches.html.haml
+++ b/app/views/projects/commit/branches.html.haml
@@ -1,9 +1,15 @@
- if @branches_limit_exceeded
= render 'limit_exceeded_message', objects: 'branches'
-- elsif @branches.any?
- = commit_branches_links(@project, @branches)
+- else
+ - branch = commit_default_branch(@project, @branches)
+ = commit_branch_link(project_ref_path(@project, branch), branch)
-- if @tags_limit_exceeded
- = render 'limit_exceeded_message', objects: 'tags'
-- elsif @tags.any?
- = commit_tags_links(@project, @tags)
+- if @branches.any? || @tags.any? || @tags_limit_exceeded
+ %span
+ = link_to "…", "#", class: "js-details-expand label label-gray"
+ %span.js-details-content.hide
+ = commit_branches_links(@project, @branches)
+ - if @tags_limit_exceeded
+ = render 'limit_exceeded_message', objects: 'tags'
+ - else
+ = commit_tags_links(@project, @tags)