summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiyad Preukschas <riyad@informatik.uni-bremen.de>2012-09-15 11:54:46 +0200
committerRiyad Preukschas <riyad@informatik.uni-bremen.de>2012-09-15 11:54:46 +0200
commitb8113334a86639b87d5f89cc78e2279a8ae4e38a (patch)
tree7e30e04fe8c6d8ea86394478d2628962a76eac1a
parent0546b9c65f33757dee6e7d0a6f85eb2bdb33453d (diff)
downloadgitlab-ce-b8113334a86639b87d5f89cc78e2279a8ae4e38a.tar.gz
Highlight voting notes for issues and merge requests
-rw-r--r--app/assets/stylesheets/sections/notes.scss13
-rw-r--r--app/helpers/notes_helper.rb8
-rw-r--r--app/views/issues/show.html.haml2
-rw-r--r--app/views/merge_requests/_show.html.haml2
-rw-r--r--app/views/notes/_note.html.haml2
5 files changed, 24 insertions, 3 deletions
diff --git a/app/assets/stylesheets/sections/notes.scss b/app/assets/stylesheets/sections/notes.scss
index 148807d6521..06b929c6843 100644
--- a/app/assets/stylesheets/sections/notes.scss
+++ b/app/assets/stylesheets/sections/notes.scss
@@ -81,6 +81,19 @@
border-top: 1px solid #eee;
}
+/* mark vote notes */
+.voting_notes .note {
+ padding: 8px 0 8px 12px;
+ &.upvote {
+ padding-left: 8px;
+ border-left: 4px solid #468847;
+ }
+ &.downvote {
+ padding-left: 8px;
+ border-left: 4px solid #B94A48;
+ }
+}
+
.notes-status {
margin: 18px;
}
diff --git a/app/helpers/notes_helper.rb b/app/helpers/notes_helper.rb
index 28701661dc4..65389e383d9 100644
--- a/app/helpers/notes_helper.rb
+++ b/app/helpers/notes_helper.rb
@@ -6,4 +6,12 @@ module NotesHelper
def loading_new_notes?
params[:loading_new].present?
end
+
+ def note_vote_class(note)
+ if note.upvote?
+ "vote upvote"
+ elsif note.downvote?
+ "vote downvote"
+ end
+ end
end
diff --git a/app/views/issues/show.html.haml b/app/views/issues/show.html.haml
index 0b72a820bb4..e7365e10eeb 100644
--- a/app/views/issues/show.html.haml
+++ b/app/views/issues/show.html.haml
@@ -61,4 +61,4 @@
= markdown @issue.description
-.issue_notes#notes= render "notes/notes_with_form", tid: @issue.id, tt: "issue"
+.issue_notes.voting_notes#notes= render "notes/notes_with_form", tid: @issue.id, tt: "issue"
diff --git a/app/views/merge_requests/_show.html.haml b/app/views/merge_requests/_show.html.haml
index 40b72190199..f1d0c8aaafb 100644
--- a/app/views/merge_requests/_show.html.haml
+++ b/app/views/merge_requests/_show.html.haml
@@ -15,7 +15,7 @@
%i.icon-list-alt
Diff
-.merge_request_notes#notes{ class: (controller.action_name == 'show') ? "" : "hide" }
+.merge_request_notes.voting_notes#notes{ class: (controller.action_name == 'show') ? "" : "hide" }
= render("notes/notes_with_form", tid: @merge_request.id, tt: "merge_request")
.merge-request-diffs
= render "merge_requests/show/diffs" if @diffs
diff --git a/app/views/notes/_note.html.haml b/app/views/notes/_note.html.haml
index 3412e4ebae5..23145f128a8 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"}
+%li{id: dom_id(note), class: "note #{note_vote_class(note)}"}
= image_tag gravatar_icon(note.author.email), class: "avatar s32"
%div.note-author
%strong= note.author_name