OSDN Git Service

Added both committer and author display for commits list
authorDmitry Kalinkin <dmitry.kalinkin@gmail.com>
Wed, 11 Jan 2012 23:12:49 +0000 (03:12 +0400)
committerDmitry Kalinkin <dmitry.kalinkin@gmail.com>
Wed, 11 Jan 2012 23:14:53 +0000 (03:14 +0400)
app/assets/stylesheets/commits.css.scss
app/models/commit.rb
app/views/commits/_commits.html.haml

index 2b94fb9..6d0b071 100644 (file)
@@ -79,8 +79,8 @@ pre.commit_message {
 /** COMMIT BLOCK **/
 .commit-title{display: block;}
 .commit-title{margin-bottom: 10px}
-.commit-author{color: #999; font-weight: normal; font-style: italic;}
-.commit-author strong{font-weight: bold; font-style: normal;}
+.commit-author, .commit-committer{display: block;color: #999; font-weight: normal; font-style: italic;}
+.commit-author strong, .commit-committer strong{font-weight: bold; font-style: normal;}
 
 /** bordered list **/
 ul.bordered-list { 
index 695dfa5..7f06f4e 100644 (file)
@@ -5,10 +5,12 @@ class Commit
   attr_accessor :refs
 
   delegate :message,
+    :authored_date,
     :committed_date,
     :parents,
     :sha,
     :date,
+    :committer,
     :author,
     :message,
     :diffs,
@@ -37,6 +39,14 @@ class Commit
     author.name
   end
 
+  def committer_name
+    committer.name
+  end
+
+  def committer_email
+    committer.email
+  end
+
   def prev_commit
     parents.first
   end
index 108d1b4..f1537d1 100644 (file)
               %strong
                 = truncate(commit.safe_message, :length => 70)
             %span.commit-author
+              Authored by
+              &nbsp;
               %strong= commit.author_name
-              = time_ago_in_words(commit.committed_date)
+              = time_ago_in_words(commit.authored_date)
               ago
+            - if commit.author_name != commit.committer_name or commit.author_email != commit.committer_email or commit.authored_date != commit.committed_date
+              %span.commit-committer
+                Committed by
+                &nbsp;
+                %strong= commit.committer_name
+                = time_ago_in_words(commit.committed_date)
+                ago