Commit eb2a25f733e0ed39788022fbe901cb69967d9878
1 parent
3c9d7b70
Exists in
master
and in
4 other branches
Added both committer and author display for commits list
Showing
3 changed files
with
22 additions
and
3 deletions
Show diff stats
app/assets/stylesheets/commits.css.scss
| ... | ... | @@ -79,8 +79,8 @@ pre.commit_message { |
| 79 | 79 | /** COMMIT BLOCK **/ |
| 80 | 80 | .commit-title{display: block;} |
| 81 | 81 | .commit-title{margin-bottom: 10px} |
| 82 | -.commit-author{color: #999; font-weight: normal; font-style: italic;} | |
| 83 | -.commit-author strong{font-weight: bold; font-style: normal;} | |
| 82 | +.commit-author, .commit-committer{display: block;color: #999; font-weight: normal; font-style: italic;} | |
| 83 | +.commit-author strong, .commit-committer strong{font-weight: bold; font-style: normal;} | |
| 84 | 84 | |
| 85 | 85 | /** bordered list **/ |
| 86 | 86 | ul.bordered-list { | ... | ... |
app/models/commit.rb
| ... | ... | @@ -5,10 +5,12 @@ class Commit |
| 5 | 5 | attr_accessor :refs |
| 6 | 6 | |
| 7 | 7 | delegate :message, |
| 8 | + :authored_date, | |
| 8 | 9 | :committed_date, |
| 9 | 10 | :parents, |
| 10 | 11 | :sha, |
| 11 | 12 | :date, |
| 13 | + :committer, | |
| 12 | 14 | :author, |
| 13 | 15 | :message, |
| 14 | 16 | :diffs, |
| ... | ... | @@ -37,6 +39,14 @@ class Commit |
| 37 | 39 | author.name |
| 38 | 40 | end |
| 39 | 41 | |
| 42 | + def committer_name | |
| 43 | + committer.name | |
| 44 | + end | |
| 45 | + | |
| 46 | + def committer_email | |
| 47 | + committer.email | |
| 48 | + end | |
| 49 | + | |
| 40 | 50 | def prev_commit |
| 41 | 51 | parents.first |
| 42 | 52 | end | ... | ... |
app/views/commits/_commits.html.haml
| ... | ... | @@ -19,6 +19,15 @@ |
| 19 | 19 | %strong |
| 20 | 20 | = truncate(commit.safe_message, :length => 70) |
| 21 | 21 | %span.commit-author |
| 22 | + Authored by | |
| 23 | + | |
| 22 | 24 | %strong= commit.author_name |
| 23 | - = time_ago_in_words(commit.committed_date) | |
| 25 | + = time_ago_in_words(commit.authored_date) | |
| 24 | 26 | ago |
| 27 | + - if commit.author_name != commit.committer_name or commit.author_email != commit.committer_email or commit.authored_date != commit.committed_date | |
| 28 | + %span.commit-committer | |
| 29 | + Committed by | |
| 30 | + | |
| 31 | + %strong= commit.committer_name | |
| 32 | + = time_ago_in_words(commit.committed_date) | |
| 33 | + ago | ... | ... |