Commit 709c7009 authored by Fatih Acet's avatar Fatih Acet

Merge branch 'full-width-new-snippet-button' into 'master'

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

## What does this MR do?

Adds full-width `New snippet` button to snippet mobile views and corrects `New Snippet` to `New snippet` throughout.

## Are there points in the code the reviewer needs to double check?

## Why was this MR needed?

@connorshea Spotted that I missed this in !6210 :)

## Screenshots (if relevant)

![Screen_Shot_2016-09-16_at_10.40.21](/uploads/ddca2da3a5ef787298bfc87e129db820/Screen_Shot_2016-09-16_at_10.40.21.png)

## Does this MR meet the acceptance criteria?

- [ ] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [ ] API support added
- Tests
  - [ ] Added for this feature/bug
  - [ ] All builds are passing
- [ ] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [ ] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

## What are the relevant issue numbers?

See merge request !6380
parents dd1341eb 9abd871a
...@@ -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;
} }
} }
......
...@@ -36,3 +36,7 @@ ...@@ -36,3 +36,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-danger", 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-danger", 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", title: "New Snippet" do = 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 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