diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-06-04 15:56:13 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-06-04 15:56:13 +0000 |
commit | ef3e0931b904ea79630d4d47f4e40dd3ede92f79 (patch) | |
tree | 45a46a386051144cb651ca49fd263076a0f1ceae /app/views | |
parent | 7f042e8bcb6536c77ea0b3cf3cd2e122281181e2 (diff) | |
parent | cf7707b4fe474e5399481a04911cb08043c14874 (diff) | |
download | gitlab-ce-ef3e0931b904ea79630d4d47f4e40dd3ede92f79.tar.gz |
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
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/projects/labels/index.html.haml | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/views/projects/labels/index.html.haml b/app/views/projects/labels/index.html.haml index 7d19415a7f4..d44fe486212 100644 --- a/app/views/projects/labels/index.html.haml +++ b/app/views/projects/labels/index.html.haml @@ -13,4 +13,7 @@ = paginate @labels, theme: 'gitlab' - else .light-well - .nothing-here-block Create first label or #{link_to 'generate', generate_namespace_project_labels_path(@project.namespace, @project), method: :post} default set of labels + - 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 + - else + .nothing-here-block No labels created |