Refactoring event views
This commit is contained in:
parent
663dd6fad6
commit
69751aac32
5 changed files with 44 additions and 32 deletions
7
app/views/events/event/_common.html.haml
Normal file
7
app/views/events/event/_common.html.haml
Normal file
|
@ -0,0 +1,7 @@
|
|||
.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
|
22
app/views/events/event/_push.html.haml
Normal file
22
app/views/events/event/_push.html.haml
Normal file
|
@ -0,0 +1,22 @@
|
|||
.event-title
|
||||
%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
|
||||
at
|
||||
%strong= link_to event.project.name, event.project
|
||||
|
||||
- if event.push_with_commits?
|
||||
- project = event.project
|
||||
.event-body
|
||||
%ul.unstyled.event_commits
|
||||
- few_commits = event.commits[0...2]
|
||||
- few_commits.each do |commit|
|
||||
= render "events/commit", commit: commit, project: project
|
||||
|
||||
- if event.commits_count > 1
|
||||
%li.commits-stat
|
||||
- if event.commits_count > 2
|
||||
%span ... and #{event.commits_count - 2} more commits.
|
||||
= link_to project_compare_path(event.project, from: event.parent_commit.id, to: event.last_commit.id) do
|
||||
%strong Compare → #{event.parent_commit.id[0..7]}...#{event.last_commit.id[0..7]}
|
Loading…
Add table
Add a link
Reference in a new issue