diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2016-06-03 09:36:09 +0300 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2016-06-06 19:59:49 +0300 |
commit | b4e4e61184b017ecbe3c3664ba916388947b49d2 (patch) | |
tree | a44d857b7527ee7ca44c2f58b4dc4e44faaba3e6 /app/views/projects/labels | |
parent | e487b0995cef810fead3f03cce45bc220a6111c2 (diff) |
Show functionality only for users with the ability to edit labels
Diffstat (limited to 'app/views/projects/labels')
-rw-r--r-- | app/views/projects/labels/index.html.haml | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/app/views/projects/labels/index.html.haml b/app/views/projects/labels/index.html.haml index 82fb6029838..0450f512041 100644 --- a/app/views/projects/labels/index.html.haml +++ b/app/views/projects/labels/index.html.haml @@ -1,4 +1,5 @@ - page_title "Labels" +- hide_class = '' .top-area .nav-text @@ -10,19 +11,20 @@ New label .labels - - hide_class = '' - -# Only show it in the first page - - if (params[:page].present? and params[:page] != '1') or @project.labels.blank? or (params[:page] == nil and @project.labels.blank?) - - hide_class = 'hide' - .prioritized-labels{ class: hide_class } - %h5 Prioritized Labels - %ul.content-list.manage-labels-list.js-prioritized-labels{ "data-url" => set_priorities_namespace_project_labels_path(@project.namespace, @project) } - - if @prioritized_labels.present? - = render @prioritized_labels - - else - %p.empty-message No prioritized labels yet + - if can?(current_user, :admin_label, @project) + -# Only show it in the first page + - if (params[:page].present? and params[:page] != '1') or @project.labels.blank? or (params[:page] == nil and @project.labels.blank?) + - hide_class = 'hide' + .prioritized-labels{ class: hide_class } + %h5 Prioritized Labels + %ul.content-list.manage-labels-list.js-prioritized-labels{ "data-url" => set_priorities_namespace_project_labels_path(@project.namespace, @project) } + - if @prioritized_labels.present? + = render @prioritized_labels + - else + %p.empty-message No prioritized labels yet .other-labels - %h5{ class: hide_class } Other Labels + - if can?(current_user, :admin_label, @project) + %h5{ class: hide_class } Other Labels - if @labels.present? %ul.content-list.manage-labels-list.js-other-labels = render @labels |