summaryrefslogtreecommitdiff
path: root/app/views/votes
diff options
context:
space:
mode:
authorValery Sizov <vsv2711@gmail.com>2015-11-19 13:20:09 +0200
committerValery Sizov <vsv2711@gmail.com>2015-11-19 13:20:09 +0200
commit23c5473cc0bd9b9034c5671fbea1356b0fb531e5 (patch)
tree1e3360ab65b6a9d771de97d7d1fccfeba2e16d10 /app/views/votes
parent2c7d8678623a9e207d54e2e39d7eef9e2f77cb47 (diff)
downloadgitlab-ce-23c5473cc0bd9b9034c5671fbea1356b0fb531e5.tar.gz
added spinach tests
Diffstat (limited to 'app/views/votes')
-rw-r--r--app/views/votes/_votes_block.html.haml38
1 files changed, 20 insertions, 18 deletions
diff --git a/app/views/votes/_votes_block.html.haml b/app/views/votes/_votes_block.html.haml
index f32e5193d1a..04e3b5a3814 100644
--- a/app/views/votes/_votes_block.html.haml
+++ b/app/views/votes/_votes_block.html.haml
@@ -6,25 +6,27 @@
.counter
= note.last.count
- .dropdown.awards-controls
- %a.add-award{"data-toggle" => "dropdown", "data-target" => "#", "href" => "#"}
- = icon('plus-square-o')
- %ul.dropdown-menu.awards-menu
- - emoji_list.each do |emoji|
- %li{"data-emoji" => "#{emoji}"}= image_tag url_to_emoji(emoji), height: "20px", width: "20px"
+ - if current_user
+ .dropdown.awards-controls
+ %a.add-award{"data-toggle" => "dropdown", "data-target" => "#", "href" => "#"}
+ = icon('plus-square-o')
+ %ul.dropdown-menu.awards-menu
+ - emoji_list.each do |emoji|
+ %li{"data-emoji" => "#{emoji}"}= image_tag url_to_emoji(emoji), height: "20px", width: "20px"
-:coffeescript
- post_emoji_url = "#{award_toggle_namespace_project_notes_path(@project.namespace, @project)}"
- noteable_type = "#{votable.class}"
- noteable_id = "#{votable.id}"
- window.awards_handler = new AwardsHandler(post_emoji_url, noteable_type, noteable_id)
+- if current_user
+ :coffeescript
+ post_emoji_url = "#{award_toggle_namespace_project_notes_path(@project.namespace, @project)}"
+ noteable_type = "#{votable.class}"
+ noteable_id = "#{votable.id}"
+ window.awards_handler = new AwardsHandler(post_emoji_url, noteable_type, noteable_id)
- $(".awards-menu li").click (e)->
- emoji = $(this).data("emoji")
- awards_handler.addAward(emoji)
+ $(".awards-menu li").click (e)->
+ emoji = $(this).data("emoji")
+ awards_handler.addAward(emoji)
- $(".awards").on "click", ".award", (e)->
- emoji = $(this).find(".icon").data("emoji")
- awards_handler.addAward(emoji)
+ $(".awards").on "click", ".award", (e)->
+ emoji = $(this).find(".icon").data("emoji")
+ awards_handler.addAward(emoji)
- $(".award").tooltip()
+ $(".award").tooltip()