Commit eb2a25f733e0ed39788022fbe901cb69967d9878

Authored by Dmitry Kalinkin
1 parent 3c9d7b70

Added both committer and author display for commits list

app/assets/stylesheets/commits.css.scss
@@ -79,8 +79,8 @@ pre.commit_message { @@ -79,8 +79,8 @@ pre.commit_message {
79 /** COMMIT BLOCK **/ 79 /** COMMIT BLOCK **/
80 .commit-title{display: block;} 80 .commit-title{display: block;}
81 .commit-title{margin-bottom: 10px} 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 /** bordered list **/ 85 /** bordered list **/
86 ul.bordered-list { 86 ul.bordered-list {
app/models/commit.rb
@@ -5,10 +5,12 @@ class Commit @@ -5,10 +5,12 @@ class Commit
5 attr_accessor :refs 5 attr_accessor :refs
6 6
7 delegate :message, 7 delegate :message,
  8 + :authored_date,
8 :committed_date, 9 :committed_date,
9 :parents, 10 :parents,
10 :sha, 11 :sha,
11 :date, 12 :date,
  13 + :committer,
12 :author, 14 :author,
13 :message, 15 :message,
14 :diffs, 16 :diffs,
@@ -37,6 +39,14 @@ class Commit @@ -37,6 +39,14 @@ class Commit
37 author.name 39 author.name
38 end 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 def prev_commit 50 def prev_commit
41 parents.first 51 parents.first
42 end 52 end
app/views/commits/_commits.html.haml
@@ -19,6 +19,15 @@ @@ -19,6 +19,15 @@
19 %strong 19 %strong
20 = truncate(commit.safe_message, :length => 70) 20 = truncate(commit.safe_message, :length => 70)
21 %span.commit-author 21 %span.commit-author
  22 + Authored by
  23 +  
22 %strong= commit.author_name 24 %strong= commit.author_name
23 - = time_ago_in_words(commit.committed_date) 25 + = time_ago_in_words(commit.authored_date)
24 ago 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