From: Tom Hughes Date: Sat, 16 Jun 2018 11:40:15 +0000 (+0100) Subject: Show count of open issues in the header X-Git-Tag: live~2935 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/1392e63272e24a139cde80211bd0083221f3b455 Show count of open issues in the header --- diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index cfde880cd..4dc1637de 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -24,4 +24,13 @@ module IssuesHelper I18n.t("issues.helper.reportable_title.note", :note_id => reportable.id) end end + + def open_issues_count + count = Issue.open.limit(100).size + if count > 99 + content_tag(:span, "99+", :class => "count-number") + elsif count > 0 + content_tag(:span, count, :class => "count-number") + end + end end diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index 050d8a081..862e5bb27 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -39,7 +39,12 @@