summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMayra Cabrera <mcabrera@gitlab.com>2017-11-06 19:37:07 +0100
committerMayra Cabrera <mcabrera@gitlab.com>2017-11-06 20:04:24 +0100
commit7ebf03319881a853405662a390fff13ffb6aefb0 (patch)
tree05d4526b5bc196dc171811a5bc71adb5a30f2afa
parent70b8f421ae6587d2a57db40e7487bf2dd788cbde (diff)
downloadgitlab-ce-7ebf03319881a853405662a390fff13ffb6aefb0.tar.gz
Addresses front & backend comments
- Improves CSS files by reusing existing code - Changes logic in views to avoid future problems in translations
-rw-r--r--app/assets/stylesheets/framework/wells.scss5
-rw-r--r--app/views/projects/commit/_limit_exceeded_message.html.haml4
-rw-r--r--app/views/projects/commit/branches.html.haml4
-rw-r--r--spec/views/projects/commit/branches.html.haml_spec.rb2
4 files changed, 7 insertions, 8 deletions
diff --git a/app/assets/stylesheets/framework/wells.scss b/app/assets/stylesheets/framework/wells.scss
index 556485c2f3b..1a5da56cba0 100644
--- a/app/assets/stylesheets/framework/wells.scss
+++ b/app/assets/stylesheets/framework/wells.scss
@@ -67,10 +67,9 @@
.limit-box {
background: $blue-100;
- border-radius: 3px;
+ border-radius: $border-radius-default;
display: inline-block;
- margin-left: 5px;
- padding: 1px 1px 0.5px 0;
+ padding: 1px 1px 0.5px;
text-align: center;
vertical-align: bottom;
diff --git a/app/views/projects/commit/_limit_exceeded_message.html.haml b/app/views/projects/commit/_limit_exceeded_message.html.haml
index 430ac6df2e4..cdf1a52f5b0 100644
--- a/app/views/projects/commit/_limit_exceeded_message.html.haml
+++ b/app/views/projects/commit/_limit_exceeded_message.html.haml
@@ -1,6 +1,6 @@
-.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.to_s.singularize} prepend-left-5", data: { title: "Project has too many #{label_for_message} to search"} }
.limit-icon
- - if objects == "branches"
+ - if objects == :branches
= icon('code-fork')
- else
= icon('tag')
diff --git a/app/views/projects/commit/branches.html.haml b/app/views/projects/commit/branches.html.haml
index 1c4f16b5afa..ed6edf6d112 100644
--- a/app/views/projects/commit/branches.html.haml
+++ b/app/views/projects/commit/branches.html.haml
@@ -1,5 +1,5 @@
- if @branches_limit_exceeded
- = render 'limit_exceeded_message', objects: 'branches'
+ = render 'limit_exceeded_message', objects: :branches, label_for_message: _('branches')
- else
- branch = commit_default_branch(@project, @branches)
= commit_branch_link(project_ref_path(@project, branch), branch)
@@ -10,6 +10,6 @@
%span.js-details-content.hide
= commit_branches_links(@project, @branches)
- if @tags_limit_exceeded
- = render 'limit_exceeded_message', objects: 'tags'
+ = render 'limit_exceeded_message', objects: :tags, label_for_message: _('tags')
- else
= commit_tags_links(@project, @tags)
diff --git a/spec/views/projects/commit/branches.html.haml_spec.rb b/spec/views/projects/commit/branches.html.haml_spec.rb
index 044b73ce419..b9d4dc80fe0 100644
--- a/spec/views/projects/commit/branches.html.haml_spec.rb
+++ b/spec/views/projects/commit/branches.html.haml_spec.rb
@@ -59,7 +59,7 @@ describe 'projects/commit/branches.html.haml' do
before do
assign(:branches, ['master'])
assign(:branches_limit_exceeded, true)
- assign(:tags, ['tag1', 'tag2'])
+ assign(:tags, %w(tag1 tag2))
assign(:tags_limit_exceeded, false)
render