diff options
author | Sean McGivern <sean@gitlab.com> | 2016-06-06 17:40:35 +0300 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2016-06-06 19:59:49 +0300 |
commit | 77f30af0179164fe3e893df616eb60beb8a1d9fe (patch) | |
tree | ce8d4b24c5a9290b79e35667d9316d5214759988 /app/views/projects/labels | |
parent | b0ec4b9cc37f30c90d4bceff5e8b8efbac25dedc (diff) |
Tidy up Ruby style in templates
Diffstat (limited to 'app/views/projects/labels')
-rw-r--r-- | app/views/projects/labels/index.html.haml | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/app/views/projects/labels/index.html.haml b/app/views/projects/labels/index.html.haml index 0450f512041..5deb84ad41e 100644 --- a/app/views/projects/labels/index.html.haml +++ b/app/views/projects/labels/index.html.haml @@ -13,9 +13,8 @@ .labels - 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 } + - hide = @project.labels.empty? || (params[:page].present? && params[:page] != '1') + .prioritized-labels{ class: ('hide' if hide) } %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? @@ -24,14 +23,14 @@ %p.empty-message No prioritized labels yet .other-labels - if can?(current_user, :admin_label, @project) - %h5{ class: hide_class } Other Labels + %h5{ class: ('hide' if hide } Other Labels - if @labels.present? %ul.content-list.manage-labels-list.js-other-labels = render @labels = paginate @labels, theme: 'gitlab' - else .nothing-here-block - - if can? current_user, :admin_label, @project + - if can?(current_user, :admin_label, @project) Create a label or #{link_to 'generate a default set of labels', generate_namespace_project_labels_path(@project.namespace, @project), method: :post}. - else No labels created |