Commit 9abd871a authored by Luke Bennett's avatar Luke Bennett

Added full-width new snippet button on mobile and corrected capitalization

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
parent d54f05da
...@@ -336,3 +336,9 @@ ...@@ -336,3 +336,9 @@
box-shadow: inset 0 0 0 white; box-shadow: inset 0 0 0 white;
} }
} }
@media (max-width: $screen-xs-max) {
.btn-wide-on-xs {
width: 100%;
}
}
...@@ -164,7 +164,7 @@ ul.content-list { ...@@ -164,7 +164,7 @@ ul.content-list {
} }
.no-comments { .no-comments {
opacity: 0.5; opacity: .5;
} }
} }
......
...@@ -29,3 +29,7 @@ ...@@ -29,3 +29,7 @@
float: right; float: right;
} }
} }
.snippet-scope-menu .btn-new {
margin-top: 15px;
}
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
= render 'dashboard/snippets_head' = render 'dashboard/snippets_head'
.nav-block .nav-block
.controls .controls.hidden-xs
= link_to new_snippet_path, class: "btn btn-new", title: "New Snippet" do = link_to new_snippet_path, class: "btn btn-new", title: "New snippet" do
= icon('plus') = icon('plus')
New Snippet New snippet
.nav-links.snippet-scope-menu .nav-links.snippet-scope-menu
%li{ class: ("active" unless params[:scope]) } %li{ class: ("active" unless params[:scope]) }
...@@ -34,5 +34,9 @@ ...@@ -34,5 +34,9 @@
%span.badge %span.badge
= current_user.snippets.are_public.count = 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'
...@@ -8,9 +8,8 @@ ...@@ -8,9 +8,8 @@
.row-content-block .row-content-block
- if current_user - if current_user
.pull-right = link_to new_snippet_path, class: "btn btn-new btn-wide-on-sm pull-right", title: "New snippet" do
= link_to new_snippet_path, class: "btn btn-new", title: "New Snippet" do New snippet
New Snippet
.oneline .oneline
Public snippets created by you and other users are listed here Public snippets created by you and other users are listed here
......
.hidden-xs .hidden-xs
- if can?(current_user, :create_project_snippet, @project) - 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 = 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 New snippet
- if can?(current_user, :update_project_snippet, @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 = 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 Delete
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
%ul %ul
- if can?(current_user, :create_project_snippet, @project) - if can?(current_user, :create_project_snippet, @project)
%li %li
= link_to new_namespace_project_snippet_path(@project.namespace, @project), title: "New Snippet" do = link_to new_namespace_project_snippet_path(@project.namespace, @project), title: "New snippet" do
New Snippet New snippet
- if can?(current_user, :update_project_snippet, @snippet) - if can?(current_user, :update_project_snippet, @snippet)
%li %li
= link_to namespace_project_snippet_path(@project.namespace, @project, @snippet), method: :delete, data: { confirm: "Are you sure?" }, title: 'Delete Snippet' do = link_to namespace_project_snippet_path(@project.namespace, @project, @snippet), method: :delete, data: { confirm: "Are you sure?" }, title: 'Delete Snippet' do
......
- page_title "Snippets" - page_title "Snippets"
.sub-header-block .sub-header-block
.pull-right - if can?(current_user, :create_project_snippet, @project)
- 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
= link_to new_namespace_project_snippet_path(@project.namespace, @project), class: "btn btn-new", title: "New Snippet" do New snippet
New Snippet
.oneline .oneline
Share code pastes with others out of git repository Share code pastes with others out of git repository
......
.hidden-xs .hidden-xs
- if current_user - if current_user
= link_to new_snippet_path, class: "btn btn-grouped btn-create new-snippet-link", title: "New Snippet" do = link_to new_snippet_path, class: "btn btn-grouped btn-create new-snippet-link", title: "New snippet" do
New Snippet New snippet
- if can?(current_user, :admin_personal_snippet, @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 = link_to snippet_path(@snippet), method: :delete, data: { confirm: "Are you sure?" }, class: "btn btn-grouped btn-danger", title: 'Delete Snippet' do
Delete Delete
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
.dropdown-menu.dropdown-menu-full-width .dropdown-menu.dropdown-menu-full-width
%ul %ul
%li %li
= link_to new_snippet_path, title: "New Snippet" do = link_to new_snippet_path, title: "New snippet" do
New Snippet New snippet
- if can?(current_user, :admin_personal_snippet, @snippet) - if can?(current_user, :admin_personal_snippet, @snippet)
%li %li
= link_to snippet_path(@snippet), method: :delete, data: { confirm: "Are you sure?" }, title: 'Delete Snippet' do = link_to snippet_path(@snippet), method: :delete, data: { confirm: "Are you sure?" }, title: 'Delete Snippet' do
......
...@@ -12,7 +12,7 @@ Feature: Project Snippets ...@@ -12,7 +12,7 @@ Feature: Project Snippets
And I should not see "Snippet two" in snippets And I should not see "Snippet two" in snippets
Scenario: I create new project snippet 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" And I submit new snippet "Snippet three"
Then I should see snippet "Snippet three" Then I should see snippet "Snippet three"
......
...@@ -21,8 +21,8 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps ...@@ -21,8 +21,8 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps
author: project.users.first) author: project.users.first)
end end
step 'I click link "New Snippet"' do step 'I click link "New snippet"' do
click_link "New Snippet" click_link "New snippet"
end end
step 'I click link "Snippet one"' do step 'I click link "Snippet one"' do
......
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