summaryrefslogtreecommitdiff
path: root/app/views/layouts
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2017-04-06 21:17:07 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2017-04-07 12:02:59 +0300
commit6ed59e1263c9d69a48238fa15e4bcce00a83932a (patch)
treee359c82192b7fe58ac5db3a63ea161e10a31fa88 /app/views/layouts
parent30c8849962f04a69f01a10849105ae549c4e4d26 (diff)
downloadgitlab-ce-6ed59e1263c9d69a48238fa15e4bcce00a83932a.tar.gz
Hide header counters for issue/mr/todos if zerodz-hide-zero-counter
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/views/layouts')
-rw-r--r--app/views/layouts/header/_default.html.haml12
1 files changed, 7 insertions, 5 deletions
diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml
index 7408fe3f6d0..17e553aeef0 100644
--- a/app/views/layouts/header/_default.html.haml
+++ b/app/views/layouts/header/_default.html.haml
@@ -47,17 +47,19 @@
%li
= link_to assigned_issues_dashboard_path, title: 'Issues', aria: { label: "Issues" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
= icon('hashtag fw')
- %span.badge.issues-count
- = number_with_delimiter(cached_assigned_issuables_count(current_user, :issues, :opened))
+ - issues_count = cached_assigned_issuables_count(current_user, :issues, :opened)
+ %span.badge.issues-count{ class: ('hidden' if issues_count.zero?) }
+ = number_with_delimiter(issues_count)
%li
= link_to assigned_mrs_dashboard_path, title: 'Merge requests', aria: { label: "Merge requests" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
= custom_icon('mr_bold')
- %span.badge.merge-requests-count
- = number_with_delimiter(cached_assigned_issuables_count(current_user, :merge_requests, :opened))
+ - merge_requests_count = cached_assigned_issuables_count(current_user, :merge_requests, :opened)
+ %span.badge.merge-requests-count{ class: ('hidden' if merge_requests_count.zero?) }
+ = number_with_delimiter(merge_requests_count)
%li
= link_to dashboard_todos_path, title: 'Todos', aria: { label: "Todos" }, class: 'shortcuts-todos', data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
= icon('check-circle fw')
- %span.badge.todos-count
+ %span.badge.todos-count{ class: ('hidden' if todos_pending_count.zero?) }
= todos_count_format(todos_pending_count)
%li.header-user.dropdown
= link_to current_user, class: "header-user-dropdown-toggle", data: { toggle: "dropdown" } do