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
diff options
context:
space:
mode:
authorAnnabel Dunstone Gray <annabel.dunstone@gmail.com>2017-03-31 18:51:49 +0300
committerJacob Schatz <jschatz1@gmail.com>2017-04-07 02:22:33 +0300
commit32e4a0f3513c846da376f70706d8d0ea60ba8b6e (patch)
treed047969b952f456e7f49b7776075d71137ae5e80 /app/helpers/system_note_helper.rb
parentd2aea4cde0574b1dfbfc3d8d85ab80195fc29e3f (diff)
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