Emoji: refactoring

This commit is contained in:
Valery Sizov 2015-11-18 17:38:15 +02:00 committed by Valery Sizov
parent 2f6f99d300
commit 2d1fcd802a
3 changed files with 11 additions and 1 deletions

View File

@ -100,6 +100,10 @@ module IssuesHelper
list.join(", ")
end
def emoji_list
::AwardEmoji::EMOJI_LIST
end
# Required for Gitlab::Markdown::IssueReferenceFilter
module_function :url_for_issue
end

View File

@ -9,7 +9,7 @@
.dropdown.awards-controls
%a#add-award{"data-toggle" => "dropdown", "data-target" => "#", "href" => "#"} +
%ul.dropdown-menu.awards-menu
- ["100", "blush", "heart", "smile", "rage", "beers", "thumbsup", "disappointed", "ok_hand", "helicopter"].each do |emoji|
- emoji_list.each do |emoji|
%li{"data-emoji" => "#{emoji}"}= image_tag url_to_emoji(emoji), height: "20px", width: "20px"

6
lib/award_emoji.rb Normal file
View File

@ -0,0 +1,6 @@
class AwardEmoji
EMOJI_LIST = ["+1", "-1", "100", "blush", "heart", "smile", "rage",
"beers", "disappointed", "ok_hand",
"helicopter", "shit", "airplane", "alarm_clock",
"ambulance", "anguished", "two_hearts", "wink"]
end