Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorRiyad Preukschas <riyad@informatik.uni-bremen.de>2012-10-10 14:09:45 +0400
committerRiyad Preukschas <riyad@informatik.uni-bremen.de>2012-10-10 14:09:45 +0400
commitfb0279f3113f58b1cbdbe04acabe874ac4d231f9 (patch)
tree0638ecc05519895cb35eddfdeaef9a99f61378d8 /app/views
parent3f72af9994554c66a51cdfb4302e48da0edd043a (diff)
Fix vote counting to only count main target notes (not mixed in ones)
Diffstat (limited to 'app/views')
-rw-r--r--app/views/notes/_note.html.haml23
1 files changed, 14 insertions, 9 deletions
diff --git a/app/views/notes/_note.html.haml b/app/views/notes/_note.html.haml
index 5234e55dcd0..57946163b56 100644
--- a/app/views/notes/_note.html.haml
+++ b/app/views/notes/_note.html.haml
@@ -1,4 +1,4 @@
-%li{id: dom_id(note), class: "note #{note_vote_class(note)}"}
+%li{id: dom_id(note), class: "note"}
= image_tag gravatar_icon(note.author.email), class: "avatar s32"
%div.note-author
%strong= note.author_name
@@ -6,14 +6,19 @@
%cite.cgray
= time_ago_in_words(note.updated_at)
ago
- - if note.upvote?
- %span.label.label-success
- %i.icon-thumbs-up
- \+1
- - if note.downvote?
- %span.label.label-error
- %i.icon-thumbs-down
- \-1
+
+ -# only show vote if it's a note for the main target
+ - if note_for_main_target?(note)
+ - if note.upvote?
+ %span.vote.upvote.label.label-success
+ %i.icon-thumbs-up
+ \+1
+ - if note.downvote?
+ %span.vote.downvote.label.label-error
+ %i.icon-thumbs-down
+ \-1
+
+ -# remove button
- if(note.author_id == current_user.id) || can?(current_user, :admin_note, @project)
= link_to [@project, note], confirm: 'Are you sure?', method: :delete, remote: true, class: "cred delete-note btn very_small" do
%i.icon-trash