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

45 lines
956 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'
2017-04-06 18:41:30 +00:00
'icon_stopwatch'
when 'assignee'
'icon_user'
when 'title'
2017-04-06 18:54:41 +00:00
'icon_edit'
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'
end
custom_icon(icon_name) if icon_name
end
end