summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-12-18 13:32:17 +0000
committerRémy Coutable <remy@rymai.me>2017-12-18 13:32:17 +0000
commit34efcde7d2320d1f66bad0add3303a497a6e43df (patch)
tree0c55dfbaff08277b68db172b33f3bc5cac4d6027
parent924e00496c7d16887447b9384b66b555e5a9f911 (diff)
parentcc759465927e962b8aee3cf614aaead780fc1164 (diff)
downloadgitlab-ce-34efcde7d2320d1f66bad0add3303a497a6e43df.tar.gz
Merge branch '39298-list-of-avatars-2' into 'master'
List of avatars should never show +1 Closes #39298 See merge request gitlab-org/gitlab-ce!15972
-rw-r--r--app/views/shared/issuable/_assignees.html.haml18
-rw-r--r--changelogs/unreleased/39298-list-of-avatars-2.yml5
2 files changed, 12 insertions, 11 deletions
diff --git a/app/views/shared/issuable/_assignees.html.haml b/app/views/shared/issuable/_assignees.html.haml
index 217af7c9fac..fc86f855865 100644
--- a/app/views/shared/issuable/_assignees.html.haml
+++ b/app/views/shared/issuable/_assignees.html.haml
@@ -1,14 +1,10 @@
-- max_render = 3
-- max = [max_render, issue.assignees.length].min
+- max_render = 4
+- assignees_rendering_overflow = issue.assignees.size > max_render
+- render_count = assignees_rendering_overflow ? max_render - 1 : max_render
+- more_assignees_count = issue.assignees.size - render_count
-- issue.assignees.take(max).each do |assignee|
+- issue.assignees.take(render_count).each do |assignee|
= link_to_member(@project, assignee, name: false, title: "Assigned to :name")
-- if issue.assignees.length > max_render
- - counter = issue.assignees.length - max_render
-
- %span{ class: 'avatar-counter has-tooltip', data: { container: 'body', placement: 'bottom', 'line-type' => 'old', 'original-title' => "+#{counter} more assignees" } }
- - if counter < 99
- = "+#{counter}"
- - else
- 99+
+- if more_assignees_count.positive?
+ %span{ class: 'avatar-counter has-tooltip', data: { container: 'body', placement: 'bottom', 'line-type' => 'old', 'original-title' => "+#{more_assignees_count} more assignees" } } +#{more_assignees_count}
diff --git a/changelogs/unreleased/39298-list-of-avatars-2.yml b/changelogs/unreleased/39298-list-of-avatars-2.yml
new file mode 100644
index 00000000000..e2095561c0e
--- /dev/null
+++ b/changelogs/unreleased/39298-list-of-avatars-2.yml
@@ -0,0 +1,5 @@
+---
+title: List of avatars should never show +1
+merge_request: 15972
+author: Jacopo Beschi @jacopo-beschi
+type: added