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 @@
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 {
}
.no-comments {
opacity: 0.5;
opacity: .5;
}
}
......
......@@ -29,3 +29,7 @@
float: right;
}
}
.snippet-scope-menu .btn-new {
margin-top: 15px;
}
......@@ -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'
......@@ -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
......
.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
......
- 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
= 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
......
.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
......
......@@ -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"
......
......@@ -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
......
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