summaryrefslogtreecommitdiff
path: root/app/helpers/system_note_helper.rb
diff options
context:
space:
mode:
authorAnnabel Dunstone Gray <annabel.dunstone@gmail.com>2017-03-31 10:51:49 -0500
committerJacob Schatz <jschatz1@gmail.com>2017-04-06 19:22:33 -0400
commit32e4a0f3513c846da376f70706d8d0ea60ba8b6e (patch)
treed047969b952f456e7f49b7776075d71137ae5e80 /app/helpers/system_note_helper.rb
parentd2aea4cde0574b1dfbfc3d8d85ab80195fc29e3f (diff)
downloadgitlab-ce-32e4a0f3513c846da376f70706d8d0ea60ba8b6e.tar.gz
Add system notes icon helper; add icons
Diffstat (limited to 'app/helpers/system_note_helper.rb')
-rw-r--r--app/helpers/system_note_helper.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/app/helpers/system_note_helper.rb b/app/helpers/system_note_helper.rb
new file mode 100644
index 00000000000..e4dcf5343bc
--- /dev/null
+++ b/app/helpers/system_note_helper.rb
@@ -0,0 +1,28 @@
+module SystemNoteHelper
+ def icon_for_system_note(note)
+
+ icon_name =
+ case note.system_note_metadata.action
+ when 'commit'
+ 'icon_commit'
+ when 'merge'
+ 'icon_merge'
+ when 'merged'
+ 'icon_merged'
+ when 'opened'
+ 'icon_opened'
+ when 'closed'
+ 'icon_closed'
+ when 'time_tracking'
+ 'icon_timer'
+ when 'assignee'
+ 'icon_user'
+ when 'title'
+ 'icon_pencil'
+ else
+ 'icon_status_canceled'
+ end
+
+ custom_icon(icon_name)
+ end
+end