summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Bennett <lukeeeebennettplus@gmail.com>2016-09-16 10:37:19 +0100
committerLuke Bennett <lukeeeebennettplus@gmail.com>2016-09-18 16:33:33 +0100
commit9abd871a03ead34945f7dff050f92d7ab9225472 (patch)
treece28941de8cb717b0b1b25f203add91f35c6752c
parentd54f05dac63d580d4451a954dd5593a065a05a3c (diff)
downloadgitlab-ce-full-width-new-snippet-button.tar.gz
Added full-width new snippet button on mobile and corrected capitalizationfull-width-new-snippet-button
Altered specs that click capitalised New Snippet button Applied review feedback missed in Changes `.no-comment` `opactiy: 0.5` to `opacity: .5` Added `.btn-wide-on-xs` and applied to snippet buttons
-rw-r--r--app/assets/stylesheets/framework/buttons.scss6
-rw-r--r--app/assets/stylesheets/framework/lists.scss2
-rw-r--r--app/assets/stylesheets/pages/snippets.scss4
-rw-r--r--app/views/dashboard/snippets/index.html.haml12
-rw-r--r--app/views/explore/snippets/index.html.haml5
-rw-r--r--app/views/projects/snippets/_actions.html.haml8
-rw-r--r--app/views/projects/snippets/index.html.haml7
-rw-r--r--app/views/snippets/_actions.html.haml8
-rw-r--r--features/project/snippets.feature2
-rw-r--r--features/steps/project/snippets.rb4
10 files changed, 35 insertions, 23 deletions
diff --git a/app/assets/stylesheets/framework/buttons.scss b/app/assets/stylesheets/framework/buttons.scss
index 4618687a4be..ce489f7c3de 100644
--- a/app/assets/stylesheets/framework/buttons.scss
+++ b/app/assets/stylesheets/framework/buttons.scss
@@ -336,3 +336,9 @@
box-shadow: inset 0 0 0 white;
}
}
+
+@media (max-width: $screen-xs-max) {
+ .btn-wide-on-xs {
+ width: 100%;
+ }
+}
diff --git a/app/assets/stylesheets/framework/lists.scss b/app/assets/stylesheets/framework/lists.scss
index 46af18580d5..efc348214c2 100644
--- a/app/assets/stylesheets/framework/lists.scss
+++ b/app/assets/stylesheets/framework/lists.scss
@@ -164,7 +164,7 @@ ul.content-list {
}
.no-comments {
- opacity: 0.5;
+ opacity: .5;
}
}
diff --git a/app/assets/stylesheets/pages/snippets.scss b/app/assets/stylesheets/pages/snippets.scss
index 5270aea4e79..9a3de263051 100644
--- a/app/assets/stylesheets/pages/snippets.scss
+++ b/app/assets/stylesheets/pages/snippets.scss
@@ -29,3 +29,7 @@
float: right;
}
}
+
+.snippet-scope-menu .btn-new {
+ margin-top: 15px;
+}
diff --git a/app/views/dashboard/snippets/index.html.haml b/app/views/dashboard/snippets/index.html.haml
index d4e7862981c..b2af438ea57 100644
--- a/app/views/dashboard/snippets/index.html.haml
+++ b/app/views/dashboard/snippets/index.html.haml
@@ -4,10 +4,10 @@
= render 'dashboard/snippets_head'
.nav-block
- .controls
- = link_to new_snippet_path, class: "btn btn-new", title: "New Snippet" do
+ .controls.hidden-xs
+ = link_to new_snippet_path, class: "btn btn-new", title: "New snippet" do
= icon('plus')
- New Snippet
+ New snippet
.nav-links.snippet-scope-menu
%li{ class: ("active" unless params[:scope]) }
@@ -34,5 +34,9 @@
%span.badge
= current_user.snippets.are_public.count
-= render 'snippets/snippets'
+ .visible-xs
+ = link_to new_snippet_path, class: "btn btn-new btn-block", title: "New snippet" do
+ = icon('plus')
+ New snippet
+= render 'snippets/snippets'
diff --git a/app/views/explore/snippets/index.html.haml b/app/views/explore/snippets/index.html.haml
index 6306fe6d0bf..7def9eacdc9 100644
--- a/app/views/explore/snippets/index.html.haml
+++ b/app/views/explore/snippets/index.html.haml
@@ -8,9 +8,8 @@
.row-content-block
- if current_user
- .pull-right
- = link_to new_snippet_path, class: "btn btn-new", title: "New Snippet" do
- New Snippet
+ = link_to new_snippet_path, class: "btn btn-new btn-wide-on-sm pull-right", title: "New snippet" do
+ New snippet
.oneline
Public snippets created by you and other users are listed here
diff --git a/app/views/projects/snippets/_actions.html.haml b/app/views/projects/snippets/_actions.html.haml
index a5a5619fa12..7342925b123 100644
--- a/app/views/projects/snippets/_actions.html.haml
+++ b/app/views/projects/snippets/_actions.html.haml
@@ -1,7 +1,7 @@
.hidden-xs
- if can?(current_user, :create_project_snippet, @project)
- = link_to new_namespace_project_snippet_path(@project.namespace, @project), class: 'btn btn-grouped btn-create new-snippet-link', title: "New Snippet" do
- New Snippet
+ = link_to new_namespace_project_snippet_path(@project.namespace, @project), class: 'btn btn-grouped btn-create new-snippet-link', title: "New snippet" do
+ New snippet
- if can?(current_user, :update_project_snippet, @snippet)
= link_to namespace_project_snippet_path(@project.namespace, @project, @snippet), method: :delete, data: { confirm: "Are you sure?" }, class: "btn btn-grouped btn-warning", title: 'Delete Snippet' do
Delete
@@ -17,8 +17,8 @@
%ul
- if can?(current_user, :create_project_snippet, @project)
%li
- = link_to new_namespace_project_snippet_path(@project.namespace, @project), title: "New Snippet" do
- New Snippet
+ = link_to new_namespace_project_snippet_path(@project.namespace, @project), title: "New snippet" do
+ New snippet
- if can?(current_user, :update_project_snippet, @snippet)
%li
= link_to namespace_project_snippet_path(@project.namespace, @project, @snippet), method: :delete, data: { confirm: "Are you sure?" }, title: 'Delete Snippet' do
diff --git a/app/views/projects/snippets/index.html.haml b/app/views/projects/snippets/index.html.haml
index 1646bcf4b8a..e77e1b026f6 100644
--- a/app/views/projects/snippets/index.html.haml
+++ b/app/views/projects/snippets/index.html.haml
@@ -1,10 +1,9 @@
- page_title "Snippets"
.sub-header-block
- .pull-right
- - if can?(current_user, :create_project_snippet, @project)
- = link_to new_namespace_project_snippet_path(@project.namespace, @project), class: "btn btn-new", title: "New Snippet" do
- New Snippet
+ - if can?(current_user, :create_project_snippet, @project)
+ = link_to new_namespace_project_snippet_path(@project.namespace, @project), class: "btn btn-new btn-wide-on-sm pull-right", title: "New snippet" do
+ New snippet
.oneline
Share code pastes with others out of git repository
diff --git a/app/views/snippets/_actions.html.haml b/app/views/snippets/_actions.html.haml
index fdaca199218..c446dc3bdc1 100644
--- a/app/views/snippets/_actions.html.haml
+++ b/app/views/snippets/_actions.html.haml
@@ -1,7 +1,7 @@
.hidden-xs
- if current_user
- = link_to new_snippet_path, class: "btn btn-grouped btn-create new-snippet-link", title: "New Snippet" do
- New Snippet
+ = link_to new_snippet_path, class: "btn btn-grouped btn-create new-snippet-link", title: "New snippet" do
+ New snippet
- if can?(current_user, :admin_personal_snippet, @snippet)
= link_to snippet_path(@snippet), method: :delete, data: { confirm: "Are you sure?" }, class: "btn btn-grouped btn-danger", title: 'Delete Snippet' do
Delete
@@ -16,8 +16,8 @@
.dropdown-menu.dropdown-menu-full-width
%ul
%li
- = link_to new_snippet_path, title: "New Snippet" do
- New Snippet
+ = link_to new_snippet_path, title: "New snippet" do
+ New snippet
- if can?(current_user, :admin_personal_snippet, @snippet)
%li
= link_to snippet_path(@snippet), method: :delete, data: { confirm: "Are you sure?" }, title: 'Delete Snippet' do
diff --git a/features/project/snippets.feature b/features/project/snippets.feature
index 270557cbde7..3c51ea56585 100644
--- a/features/project/snippets.feature
+++ b/features/project/snippets.feature
@@ -12,7 +12,7 @@ Feature: Project Snippets
And I should not see "Snippet two" in snippets
Scenario: I create new project snippet
- Given I click link "New Snippet"
+ Given I click link "New snippet"
And I submit new snippet "Snippet three"
Then I should see snippet "Snippet three"
diff --git a/features/steps/project/snippets.rb b/features/steps/project/snippets.rb
index beb8ecfc799..5e7d539add6 100644
--- a/features/steps/project/snippets.rb
+++ b/features/steps/project/snippets.rb
@@ -21,8 +21,8 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps
author: project.users.first)
end
- step 'I click link "New Snippet"' do
- click_link "New Snippet"
+ step 'I click link "New snippet"' do
+ click_link "New snippet"
end
step 'I click link "Snippet one"' do