Commit 7d750cbf79c446f097eab5e7a35a9d0040c9d4b6

Authored by Dmitriy Zaporozhets
2 parents e0f07cca eb2a25f7

Merge pull request #283 from veprbl/master

Display both author and committer in commits list
app/assets/stylesheets/commits.css.scss
... ... @@ -121,8 +121,8 @@ pre.commit_message {
121 121 /** COMMIT BLOCK **/
122 122 .commit-title{display: block;}
123 123 .commit-title{margin-bottom: 10px}
124   -.commit-author{color: #999; font-weight: normal; font-style: italic;}
125   -.commit-author strong{font-weight: bold; font-style: normal;}
  124 +.commit-author, .commit-committer{display: block;color: #999; font-weight: normal; font-style: italic;}
  125 +.commit-author strong, .commit-committer strong{font-weight: bold; font-style: normal;}
126 126  
127 127 /** bordered list **/
128 128 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
... ...