diff options
author | Jacopo <beschi.jacopo@gmail.com> | 2017-12-16 18:01:02 +0300 |
---|---|---|
committer | Jacopo <beschi.jacopo@gmail.com> | 2017-12-18 13:48:38 +0300 |
commit | cc759465927e962b8aee3cf614aaead780fc1164 (patch) | |
tree | 1c4d826640b6a124f2bf80ba6aee99b10d3a30a7 /app/views/shared | |
parent | 306967478734418ec0fc5f011204464b961cc409 (diff) |
List of avatars should never show +1
The list of avatars should never show +1. If you have +1, that means you can use that space to show that person's avatar,
for that reason should always start with +2.
Diffstat (limited to 'app/views/shared')
-rw-r--r-- | app/views/shared/issuable/_assignees.html.haml | 18 |
1 files changed, 7 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} |