diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-02-17 20:20:35 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-02-17 20:20:35 +0300 |
commit | ff28ac9c18231c54b9a925d26915bf3e29548ddd (patch) | |
tree | 89697763f12c8ee59296f1833a95be77246ecc73 /app/views | |
parent | 879d66b6ab5cfd75e9b126f825b2e165b48a9ff1 (diff) | |
parent | 9823d00e0b13224ae9e820e7d3f9fade69201e99 (diff) |
Merge branch 'see-and-sort-on-vote-count-mr-issues' into 'master'
Add ability to see and sort on vote count from Issues and MR lists
Fixes #3763
* Sort options
![Sort Options](/uploads/df6543d574d4df8bf7e4496a876e2930/sort.png)
* Most popular
![Most popular](/uploads/bb92cc2fbef7b6b806dcdf8c52778fdd/most-popular.png)
* Least popular
![Least popular](/uploads/7988ed451922c81dc228419b5edbd7cd/least-popular.png)
See merge request !2781
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/projects/issues/_issue.html.haml | 19 | ||||
-rw-r--r-- | app/views/projects/merge_requests/_merge_request.html.haml | 19 | ||||
-rw-r--r-- | app/views/shared/_sort_dropdown.html.haml | 4 |
3 files changed, 42 insertions, 0 deletions
diff --git a/app/views/projects/issues/_issue.html.haml b/app/views/projects/issues/_issue.html.haml index f9cf4910df3..5b0edcfa978 100644 --- a/app/views/projects/issues/_issue.html.haml +++ b/app/views/projects/issues/_issue.html.haml @@ -15,6 +15,25 @@ %li = link_to_member(@project, issue.assignee, name: false, title: "Assigned to :name") + - upvotes, downvotes = issue.upvotes, issue.downvotes + - if upvotes > 0 || downvotes > 0 + %li + = icon('thumbs-up') + = upvotes + - else + %li{ class: 'issue-no-votes' } + = icon('thumbs-up') + = upvotes + + - if upvotes > 0 || downvotes > 0 + %li + = icon('thumbs-down') + = downvotes + - else + %li{ class: 'issue-no-votes' } + = icon('thumbs-down') + = downvotes + - note_count = issue.notes.user.count - if note_count > 0 %li diff --git a/app/views/projects/merge_requests/_merge_request.html.haml b/app/views/projects/merge_requests/_merge_request.html.haml index e25bf917b43..b230b3a0110 100644 --- a/app/views/projects/merge_requests/_merge_request.html.haml +++ b/app/views/projects/merge_requests/_merge_request.html.haml @@ -24,6 +24,25 @@ %li = link_to_member(merge_request.source_project, merge_request.assignee, name: false, title: "Assigned to :name") + - upvotes, downvotes = merge_request.upvotes, merge_request.downvotes + - if upvotes > 0 || downvotes > 0 + %li + = icon('thumbs-up') + = upvotes + - else + %li{ class: 'merge-request-no-votes' } + = icon('thumbs-up') + = upvotes + + - if upvotes > 0 || downvotes > 0 + %li + = icon('thumbs-down') + = downvotes + - else + %li{ class: 'merge-request-no-votes' } + = icon('thumbs-down') + = downvotes + - note_count = merge_request.mr_and_commit_notes.user.count - if note_count > 0 %li diff --git a/app/views/shared/_sort_dropdown.html.haml b/app/views/shared/_sort_dropdown.html.haml index f09ab25276d..e3a6a5a68b6 100644 --- a/app/views/shared/_sort_dropdown.html.haml +++ b/app/views/shared/_sort_dropdown.html.haml @@ -20,3 +20,7 @@ = sort_title_milestone_soon = link_to page_filter_path(sort: sort_value_milestone_later) do = sort_title_milestone_later + = link_to page_filter_path(sort: sort_value_upvotes) do + = sort_title_upvotes + = link_to page_filter_path(sort: sort_value_downvotes) do + = sort_title_downvotes |