Commit ef3e0931 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'fix-no-labels-page' into 'master'

Omit link to generate labels if user does not have access to create them

On a project that has no labels, a user was provided a link to create labels on the "Labels" tab, resulting in a 404. This MR changes the next to "No labels created" if the user lands on this page but does not have permission to add a label.

Screenshot:

![image](https://gitlab.com/stanhu/gitlab-ce/uploads/cb04659cf3a0abe1e072cb78d0964b94/image.png)

Closes https://github.com/gitlabhq/gitlabhq/issues/8353

See merge request !752
parents 7f042e8b cf7707b4
...@@ -2,6 +2,7 @@ Please view this file on the master branch, on stable branches it's out of date. ...@@ -2,6 +2,7 @@ Please view this file on the master branch, on stable branches it's out of date.
v 7.12.0 (unreleased) v 7.12.0 (unreleased)
- Don't notify users mentioned in code blocks or blockquotes. - Don't notify users mentioned in code blocks or blockquotes.
- Omit link to generate labels if user does not have access to create them (Stan Hu)
- Disable changing of the source branch in merge request update API (Stan Hu) - Disable changing of the source branch in merge request update API (Stan Hu)
- Shorten merge request WIP text. - Shorten merge request WIP text.
- Add option to disallow users from registering any application to use GitLab as an OAuth provider - Add option to disallow users from registering any application to use GitLab as an OAuth provider
......
...@@ -13,4 +13,7 @@ ...@@ -13,4 +13,7 @@
= paginate @labels, theme: 'gitlab' = paginate @labels, theme: 'gitlab'
- else - else
.light-well .light-well
- if can? current_user, :admin_label, @project
.nothing-here-block Create first label or #{link_to 'generate', generate_namespace_project_labels_path(@project.namespace, @project), method: :post} default set of labels .nothing-here-block Create first label or #{link_to 'generate', generate_namespace_project_labels_path(@project.namespace, @project), method: :post} default set of labels
- else
.nothing-here-block No labels created
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