Showing 4 changed files with 44 additions and 3 deletions
+10
lib/Gitprep/API.pm
... ...
@@ -5,6 +5,16 @@ use Digest::MD5 'md5_hex';
5 5
 
6 6
 has 'cntl';
7 7
 
8
+sub age_string {
9
+  my ($self, $epoch_time) = @_;
10
+  
11
+  my $age = time - $epoch_time;
12
+  
13
+  my $age_string = $self->cntl->app->git->_age_string($age);
14
+  
15
+  return $age_string;
16
+}
17
+
8 18
 sub get_user_row_id {
9 19
   my ($self, $user_id) = @_;
10 20
   
+14
public/css/common.css
... ...
@@ -35,6 +35,20 @@
35 35
   box-sizing: border-box;
36 36
 }
37 37
 
38
+.pull-comment {
39
+  border:1px solid #eee;
40
+  margin-top:15px;
41
+  border-radius:3px;
42
+}
43
+.pull-comment-header {
44
+  background:#f2f8fa;
45
+  padding:7px 12px;
46
+  border-bottom:1px solid #eee;
47
+}
48
+.pull-comment-body {
49
+  padding:13px 12px;
50
+  
51
+}
38 52
 .pull-request-form {
39 53
   border:1px solid #95c97e;
40 54
   border-radius:3px;
+1 -1
templates/compare.html.ep
... ...
@@ -34,7 +34,7 @@
34 34
       )->one;
35 35
       
36 36
       if ($pull_request) {
37
-        $self->redirect_to("/$user_id/$project_id/pulls/$pull_request->{row_id}");
37
+        $self->redirect_to("/$user_id/$project_id/pull/$pull_request->{row_id}");
38 38
         return;
39 39
       }
40 40
       else {
+19 -2
templates/pull.html.ep
... ...
@@ -49,8 +49,13 @@
49 49
   stash rev => $end_commit->{id};
50 50
   stash from_rev => $start_commit->{id};
51 51
   
52
-  # Allow pull request
53
-  
52
+  my $pull_request_message_first = app->dbi->model('pull_request_message')->select(
53
+    [
54
+      {__MY__ => '*'},
55
+      {user => ['id']}
56
+    ],
57
+    where => {pull_request => $row_id, number => 1}
58
+  )->one;
54 59
 %>
55 60
 
56 61
 % layout 'common', title => "Pull Requests Tags \x{30fb} $user/$project";
... ...
@@ -108,6 +113,18 @@
108 113
           
109 114
         </li>
110 115
       </ul>
116
+      <div class="pull-comment">
117
+        <div class="pull-comment-header">
118
+          <b><%= $pull_request_message_first->{'user.id'} %></b>
119
+          <span style="color:#767676">
120
+            commented
121
+            <%= $api->age_string($pull_request_message_first->{update_time}) %></b>
122
+          </span>
123
+        </div>
124
+        <div class="pull-comment-body">
125
+          <%= $pull_request_message_first->{message} %>
126
+        </div>
127
+      </div>
111 128
       
112 129
       <div class="commits">
113 130
         % for my $date (reverse sort keys %$commits_date) {