09163e423a
Count issues related merge requests based on user access level. And issue can have related MRs from projects where user does not have access so the number of related merge requests should be adjusted based on user's ability to access the related MRs. https://gitlab.com/gitlab-org/gitlab-ce/issues/59581
25 lines
1.1 KiB
Text
25 lines
1.1 KiB
Text
- note_count = @issuable_meta_data[issuable.id].user_notes_count
|
|
- issue_votes = @issuable_meta_data[issuable.id]
|
|
- upvotes, downvotes = issue_votes.upvotes, issue_votes.downvotes
|
|
- issuable_url = @collection_type == "Issue" ? issue_path(issuable, anchor: 'notes') : merge_request_path(issuable, anchor: 'notes')
|
|
- issuable_mr = @issuable_meta_data[issuable.id].merge_requests_count(current_user)
|
|
|
|
- if issuable_mr > 0
|
|
%li.issuable-mr.d-none.d-sm-block.has-tooltip{ title: _('Related merge requests') }
|
|
= image_tag('icon-merge-request-unmerged.svg', class: 'icon-merge-request-unmerged')
|
|
= issuable_mr
|
|
|
|
- if upvotes > 0
|
|
%li.issuable-upvotes.d-none.d-sm-block.has-tooltip{ title: _('Upvotes') }
|
|
= icon('thumbs-up')
|
|
= upvotes
|
|
|
|
- if downvotes > 0
|
|
%li.issuable-downvotes.d-none.d-sm-block.has-tooltip{ title: _('Downvotes') }
|
|
= icon('thumbs-down')
|
|
= downvotes
|
|
|
|
%li.issuable-comments.d-none.d-sm-block
|
|
= link_to issuable_url, class: ['has-tooltip', ('no-comments' if note_count.zero?)], title: _('Comments') do
|
|
= icon('comments')
|
|
= note_count
|