diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-05 03:07:49 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-05 03:07:49 +0300 |
commit | 77237c5a6b9044f58beabc54d3589e5fa09cbfba (patch) | |
tree | f43188047fe8955f6cf78e05ae9c2e8f6a019e0b /app/helpers | |
parent | 2fd92f2dc784ade9cb4e1c33dd60cbfad7b86818 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/broadcast_messages_helper.rb | 6 | ||||
-rw-r--r-- | app/helpers/milestones_helper.rb | 14 |
2 files changed, 12 insertions, 8 deletions
diff --git a/app/helpers/broadcast_messages_helper.rb b/app/helpers/broadcast_messages_helper.rb index 34e65c322c6..7638710a7c2 100644 --- a/app/helpers/broadcast_messages_helper.rb +++ b/app/helpers/broadcast_messages_helper.rb @@ -2,12 +2,14 @@ module BroadcastMessagesHelper def current_broadcast_banner_messages - BroadcastMessage.current_banner_messages(request.path) + BroadcastMessage.current_banner_messages(request.path).select do |message| + cookies["hide_broadcast_message_#{message.id}"].blank? + end end def current_broadcast_notification_message not_hidden_messages = BroadcastMessage.current_notification_messages(request.path).select do |message| - cookies["hide_broadcast_notification_message_#{message.id}"].blank? + cookies["hide_broadcast_message_#{message.id}"].blank? end not_hidden_messages.last end diff --git a/app/helpers/milestones_helper.rb b/app/helpers/milestones_helper.rb index b12b39073ef..a723269ea0e 100644 --- a/app/helpers/milestones_helper.rb +++ b/app/helpers/milestones_helper.rb @@ -151,18 +151,20 @@ module MilestonesHelper end def milestone_issues_tooltip_text(milestone) - issues = milestone.count_issues_by_state(current_user) + total = milestone.total_issues_count(current_user) + opened = milestone.opened_issues_count(current_user) + closed = milestone.closed_issues_count(current_user) - return _("Issues") if issues.empty? + return _("Issues") if total.zero? content = [] - if issues["opened"] - content << n_("1 open issue", "%{issues} open issues", issues["opened"]) % { issues: issues["opened"] } + if opened > 0 + content << n_("1 open issue", "%{issues} open issues", opened) % { issues: opened } end - if issues["closed"] - content << n_("1 closed issue", "%{issues} closed issues", issues["closed"]) % { issues: issues["closed"] } + if closed > 0 + content << n_("1 closed issue", "%{issues} closed issues", closed) % { issues: closed } end content.join('<br />').html_safe |