diff options
author | Dmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com> | 2012-10-01 17:39:19 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com> | 2012-10-01 17:39:19 +0400 |
commit | 663dd6fad6e0a992f7ba1ccff4e58de84463abe6 (patch) | |
tree | 8ed66957cbb6dd064e5f00f500c61a43c617034a /app/views/events | |
parent | 433387be358c4307e25f59c8afeb17b4514b35cc (diff) |
Refactored events output. Added links to authors of events
Diffstat (limited to 'app/views/events')
-rw-r--r-- | app/views/events/_event.html.haml | 13 | ||||
-rw-r--r-- | app/views/events/_event_common.html.haml | 8 | ||||
-rw-r--r-- | app/views/events/_event_issue.html.haml | 8 | ||||
-rw-r--r-- | app/views/events/_event_membership_changed.html.haml | 9 | ||||
-rw-r--r-- | app/views/events/_event_merge_request.html.haml | 16 | ||||
-rw-r--r-- | app/views/events/_event_push.html.haml | 2 |
6 files changed, 12 insertions, 44 deletions
diff --git a/app/views/events/_event.html.haml b/app/views/events/_event.html.haml index 716a214b9bf..cdc24204d5f 100644 --- a/app/views/events/_event.html.haml +++ b/app/views/events/_event.html.haml @@ -1,16 +1,9 @@ - if event.allowed? %div.event-item - - if event.issue? - = render "events/event_issue", event: event - - - elsif event.merge_request? - = render "events/event_merge_request", event: event - - - elsif event.push? + - if event.push? = render "events/event_push", event: event - - - elsif event.membership_changed? - = render "events/event_membership_changed", event: event + - else + = render "events/event_common", event: event %span.cgray.right = time_ago_in_words(event.created_at) diff --git a/app/views/events/_event_common.html.haml b/app/views/events/_event_common.html.haml new file mode 100644 index 00000000000..0f9a86e96b7 --- /dev/null +++ b/app/views/events/_event_common.html.haml @@ -0,0 +1,8 @@ += image_tag gravatar_icon(event.author_email), class: "avatar" +.event-title + %span.author_name= link_to_author event + %span.event_label{class: event.action_name}= event_action_name(event) + = link_to [event.project, event.target] do + %strong= truncate event.target_title + at + = link_to_project event.project diff --git a/app/views/events/_event_issue.html.haml b/app/views/events/_event_issue.html.haml deleted file mode 100644 index 60e82c4d4dc..00000000000 --- a/app/views/events/_event_issue.html.haml +++ /dev/null @@ -1,8 +0,0 @@ -= image_tag gravatar_icon(event.author_email), class: "avatar" -.event-title - %strong.author_name #{event.author_name} - %span.event_label{class: event.action_name} #{event.action_name} issue - = link_to project_issue_path(event.project, event.issue) do - %strong= truncate event.issue_title - at - %strong= link_to event.project.name, event.project diff --git a/app/views/events/_event_membership_changed.html.haml b/app/views/events/_event_membership_changed.html.haml deleted file mode 100644 index e89065b91ef..00000000000 --- a/app/views/events/_event_membership_changed.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -= image_tag gravatar_icon(event.author_email), class: "avatar" -.event-title - %strong.author_name #{event.author_name} - %span.event_label{class: event.action_name} #{event.action_name} project - %strong= link_to event.project_name, event.project - %span.cgray - = time_ago_in_words(event.created_at) - ago. - diff --git a/app/views/events/_event_merge_request.html.haml b/app/views/events/_event_merge_request.html.haml deleted file mode 100644 index 655337f3480..00000000000 --- a/app/views/events/_event_merge_request.html.haml +++ /dev/null @@ -1,16 +0,0 @@ -- if event.action_name == "merged" - .event_icon= image_tag "event_mr_merged.png" -= image_tag gravatar_icon(event.author_email), class: "avatar" -.event-title - %strong.author_name #{event.author_name} - %span.event_label{class: event.action_name} #{event.action_name} merge request - = link_to project_merge_request_path(event.project, event.merge_request) do - %strong= truncate event.merge_request_title - at - %strong= link_to event.project.name, event.project -.event-body - .event-info - %span= event.merge_request.source_branch - → - %span= event.merge_request.target_branch - diff --git a/app/views/events/_event_push.html.haml b/app/views/events/_event_push.html.haml index b5273b5423a..caf1b2c5d46 100644 --- a/app/views/events/_event_push.html.haml +++ b/app/views/events/_event_push.html.haml @@ -3,7 +3,7 @@ = image_tag gravatar_icon(event.author_email), class: "avatar" .event-title - %strong.author_name #{event.author_name} + %span.author_name= link_to_author event %span.event_label.pushed #{event.push_action_name} #{event.ref_type} = link_to project_commits_path(event.project, event.ref_name) do %strong= event.ref_name |