gitlab-org--gitlab-foss/app/helpers/system_note_helper.rb

47 lines
975 B
Ruby
Raw Normal View History

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'
2017-04-06 17:25:22 +00:00
'icon_status_open'
when 'closed'
2017-04-06 17:25:22 +00:00
'icon_status_closed'
when 'time_tracking'
'icon_timer'
when 'assignee'
'icon_user'
when 'title'
'icon_pencil'
2017-04-06 17:25:22 +00:00
when 'task'
'icon_check_square_o'
when 'label'
'icon_tags'
when 'cross_reference'
'icon_random'
when 'branch'
'icon_code_fork'
when 'confidential'
'icon_eye_slash'
when 'visible'
'icon_eye'
when 'milestone'
'icon_clock_o'
2017-04-06 17:31:34 +00:00
when 'discussion'
'icon_comment_o'
2017-04-06 17:25:22 +00:00
when 'moved'
'icon_arrow-circle-o-right'
else
2017-04-06 17:25:22 +00:00
'icon_diamond'
end
custom_icon(icon_name)
end
end