From e72386771751fb22245bc6604fef236a2ee130cb Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 17 Dec 2019 18:07:48 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- app/views/dashboard/_snippets_head.html.haml | 3 ++- app/views/dashboard/snippets/index.html.haml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'app/views/dashboard') diff --git a/app/views/dashboard/_snippets_head.html.haml b/app/views/dashboard/_snippets_head.html.haml index 34aca40d0d1..4958cdc3745 100644 --- a/app/views/dashboard/_snippets_head.html.haml +++ b/app/views/dashboard/_snippets_head.html.haml @@ -3,7 +3,8 @@ - if current_user && current_user.snippets.any? || @snippets.any? .page-title-controls - = link_to _("New snippet"), new_snippet_path, class: "btn btn-success", title: _("New snippet") + - if can?(current_user, :create_personal_snippet) + = link_to _("New snippet"), new_snippet_path, class: "btn btn-success", title: _("New snippet") .top-area %ul.nav-links.nav.nav-tabs diff --git a/app/views/dashboard/snippets/index.html.haml b/app/views/dashboard/snippets/index.html.haml index 2caa8e0cac4..44a9270971a 100644 --- a/app/views/dashboard/snippets/index.html.haml +++ b/app/views/dashboard/snippets/index.html.haml @@ -1,6 +1,7 @@ - @hide_top_links = true - page_title "Snippets" - header_title "Snippets", dashboard_snippets_path +- button_path = new_snippet_path if can?(current_user, :create_personal_snippet) = render 'dashboard/snippets_head' - if current_user.snippets.exists? @@ -9,4 +10,4 @@ - if current_user.snippets.exists? = render partial: 'shared/snippets/list', locals: { link_project: true } - else - = render 'shared/empty_states/snippets', button_path: new_snippet_path + = render 'shared/empty_states/snippets', button_path: button_path -- cgit v1.2.3