diff options
author | Sean McGivern <sean@gitlab.com> | 2017-02-01 21:15:59 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2017-02-02 13:23:51 +0300 |
commit | c63194ce6f952173649d7de4038aa96348e90565 (patch) | |
tree | a9622e1e5ffc86bf35fc9556152cc03cf2841ef5 /app/views/projects/snippets | |
parent | f799585c41d801bc657f992adf3d4b201af927d2 (diff) |
Check public snippets for spam
Apply the same spam checks to public snippets (either personal snippets
that are public, or public snippets on public projects) as to issues on
public projects.
Diffstat (limited to 'app/views/projects/snippets')
-rw-r--r-- | app/views/projects/snippets/_actions.html.haml | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/views/projects/snippets/_actions.html.haml b/app/views/projects/snippets/_actions.html.haml index 068a6610350..e2a5107a883 100644 --- a/app/views/projects/snippets/_actions.html.haml +++ b/app/views/projects/snippets/_actions.html.haml @@ -8,6 +8,8 @@ - if can?(current_user, :create_project_snippet, @project) = link_to new_namespace_project_snippet_path(@project.namespace, @project), class: 'btn btn-grouped btn-inverted btn-create', title: "New snippet" do New snippet + - if @snippet.submittable_as_spam? && current_user.admin? + = link_to 'Submit as spam', mark_as_spam_namespace_project_snippet_path(@project.namespace, @project, @snippet), method: :post, class: 'btn btn-grouped btn-spam', title: 'Submit as spam' - if can?(current_user, :create_project_snippet, @project) || can?(current_user, :update_project_snippet, @snippet) .visible-xs-block.dropdown %button.btn.btn-default.btn-block.append-bottom-0.prepend-top-5{ data: { toggle: "dropdown" } } @@ -27,3 +29,6 @@ %li = link_to edit_namespace_project_snippet_path(@project.namespace, @project, @snippet) do Edit + - if @snippet.submittable_as_spam? && current_user.admin? + %li + = link_to 'Submit as spam', mark_as_spam_namespace_project_snippet_path(@project.namespace, @project, @snippet), method: :post |