diff options
author | Mike Greiling <mike@pixelcog.com> | 2016-12-07 16:48:26 -0600 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2016-12-10 00:57:23 -0600 |
commit | 68bb459b160419004ef2110b2824c8b2ab4c9739 (patch) | |
tree | edeb2aea3a07fa8a41c76c6b76507beca92152ed | |
parent | 54a1193d790ae40fea5db1d8596c12fbc7a93576 (diff) | |
download | gitlab-ce-68bb459b160419004ef2110b2824c8b2ab4c9739.tar.gz |
move project new snippet button into snippet scope navigation header
-rw-r--r-- | app/views/projects/snippets/index.html.haml | 58 |
1 files changed, 31 insertions, 27 deletions
diff --git a/app/views/projects/snippets/index.html.haml b/app/views/projects/snippets/index.html.haml index 76792fb5326..35c4e9d85ad 100644 --- a/app/views/projects/snippets/index.html.haml +++ b/app/views/projects/snippets/index.html.haml @@ -1,38 +1,42 @@ - page_title "Snippets" - if current_user - .nav-links.snippet-scope-menu - %li{ class: ("active" unless params[:scope]) } - = link_to namespace_project_snippets_path(@project.namespace, @project) do - All - %span.badge - = @project.snippets.count + .top-area + .nav-links.snippet-scope-menu + %li{ class: ("active" unless params[:scope]) } + = link_to namespace_project_snippets_path(@project.namespace, @project) do + All + %span.badge + = @project.snippets.count + + - if @project.team.member?(current_user) || current_user.admin? + %li{ class: ("active" if params[:scope] == "are_private") } + = link_to namespace_project_snippets_path(@project.namespace, @project, scope: 'are_private') do + Private + %span.badge + = @project.snippets.are_private.count - - if @project.team.member?(current_user) || current_user.admin? - %li{ class: ("active" if params[:scope] == "are_private") } - = link_to namespace_project_snippets_path(@project.namespace, @project, scope: 'are_private') do - Private + %li{ class: ("active" if params[:scope] == "are_internal") } + = link_to namespace_project_snippets_path(@project.namespace, @project, scope: 'are_internal') do + Internal %span.badge - = @project.snippets.are_private.count + = @project.snippets.are_internal.count - %li{ class: ("active" if params[:scope] == "are_internal") } - = link_to namespace_project_snippets_path(@project.namespace, @project, scope: 'are_internal') do - Internal - %span.badge - = @project.snippets.are_internal.count + %li{ class: ("active" if params[:scope] == "are_public") } + = link_to namespace_project_snippets_path(@project.namespace, @project, scope: 'are_public') do + Public + %span.badge + = @project.snippets.are_public.count - %li{ class: ("active" if params[:scope] == "are_public") } - = link_to namespace_project_snippets_path(@project.namespace, @project, scope: 'are_public') do - Public - %span.badge - = @project.snippets.are_public.count + .nav-controls.hidden-xs + - 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 -.sub-header-block - - 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 +- if can?(current_user, :create_project_snippet, @project) + .visible-xs + + = link_to new_namespace_project_snippet_path(@project.namespace, @project), class: "btn btn-new btn-block", title: "New snippet" do New snippet - .oneline - Share code pastes with others out of git repository - = render 'snippets/snippets' |