From 633457563a9e9ef9473a00019dd243430aa08e80 Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Gray Date: Fri, 31 Mar 2017 15:39:31 -0500 Subject: Differentiate between event types --- app/views/events/_event.html.haml | 3 --- app/views/events/event/_common.html.haml | 14 ++++++++------ app/views/events/event/_created_project.html.haml | 4 +++- app/views/events/event/_note.html.haml | 4 +++- app/views/events/event/_push.html.haml | 5 +++-- 5 files changed, 17 insertions(+), 13 deletions(-) (limited to 'app/views/events') diff --git a/app/views/events/_event.html.haml b/app/views/events/_event.html.haml index bf7a9af99cd..53a33adc14d 100644 --- a/app/views/events/_event.html.haml +++ b/app/views/events/_event.html.haml @@ -4,13 +4,10 @@ #{time_ago_with_tooltip(event.created_at)} - if event.created_project? - = custom_icon("icon_status_open") = render "events/event/created_project", event: event - elsif event.push? - = custom_icon("icon_commit") = render "events/event/push", event: event - elsif event.commented? - = custom_icon("comment_o") = render "events/event/note", event: event - else = render "events/event/common", event: event diff --git a/app/views/events/event/_common.html.haml b/app/views/events/event/_common.html.haml index 0d230e3f3f2..98a4dda5b4d 100644 --- a/app/views/events/event/_common.html.haml +++ b/app/views/events/event/_common.html.haml @@ -1,11 +1,13 @@ - if event.target - - if event.target_type == "MergeRequest" - - if event.action_name == "opened" + - if event.action_name == "opened" + .event-icon.open-icon = custom_icon("icon_status_open") - - elsif event.action_name == "closed" - = custom_icon("icon_status_closed") - - else - = custom_icon("code_fork") + - elsif event.action_name == "closed" + .event-icon.closed-icon + = custom_icon("icon_status_closed") + - else + .event-icon.fork-icon + = custom_icon("code_fork") .event-title %span{ class: event.action_name } diff --git a/app/views/events/event/_created_project.html.haml b/app/views/events/event/_created_project.html.haml index 80cf2344fe1..6fb084df374 100644 --- a/app/views/events/event/_created_project.html.haml +++ b/app/views/events/event/_created_project.html.haml @@ -1,5 +1,7 @@ +.event-icon.open-icon += custom_icon("icon_status_open") + .event-title - %span.author_name= link_to_author event %span{ class: event.action_name } = event_action_name(event) diff --git a/app/views/events/event/_note.html.haml b/app/views/events/event/_note.html.haml index 64b5a733b77..755750b88d1 100644 --- a/app/views/events/event/_note.html.haml +++ b/app/views/events/event/_note.html.haml @@ -1,5 +1,7 @@ +.event-icon + = custom_icon("comment_o") + .event-title - %span.author_name= link_to_author event = event.action_name = event_note_title_html(event) diff --git a/app/views/events/event/_push.html.haml b/app/views/events/event/_push.html.haml index efd13aabf20..be1730541ef 100644 --- a/app/views/events/event/_push.html.haml +++ b/app/views/events/event/_push.html.haml @@ -1,7 +1,9 @@ - project = event.project +.event-icon + = custom_icon("icon_commit") + .event-title - %span.author_name= link_to_author event %span.pushed #{event.action_name} #{event.ref_type} %strong - commits_link = namespace_project_commits_path(project.namespace, project, event.ref_name) @@ -48,4 +50,3 @@ .event-body %ul.well-list.event_commits = render "events/commit", commit: last_commit, project: project, event: event - -- cgit v1.2.3