Showing 7 changed files with 79 additions and 7 deletions
+5 -1
public/css/common.css
... ...
@@ -2171,7 +2171,11 @@ button.close {
2171 2171
   color: #767676;
2172 2172
   margin-top:1px;
2173 2173
 }
2174
-
2174
+.commit-left-author a {
2175
+  color:#767676;
2176
+  font-weight:bold;
2177
+  font-size:98%;
2178
+}
2175 2179
 .commit-right {
2176 2180
   float:left;
2177 2181
   width:30%;
+12 -1
templates/blob.html.ep
... ...
@@ -15,6 +15,11 @@
15 15
 
16 16
   # Commit
17 17
   my $commit = $git->last_change_commit($user, $project, $rev, $file);
18
+  my $commit_author_mail = $commit->{author_email};
19
+  my $commit_author_id = app->dbi->model('user')->select(
20
+    'id',
21
+    where => {mail => $commit_author_mail}
22
+  )->value;
18 23
 
19 24
   # Authors
20 25
   my $authors = $git->authors($user, $project, $rev, $file);
... ...
@@ -50,7 +55,13 @@
50 55
 
51 56
     <div class="commit-summary">
52 57
       <div class="commit-summary-left-container">
53
-        <span class="commit-summary-author" title="<%= $commit->{author_email} %>"><%= $commit->{author_name} %></span>
58
+        <span class="commit-summary-author" title="<%= $commit->{author_email} %>">
59
+          % if (defined $commit_author_id) {
60
+            <a href="<%= url_for("/$commit_author_id") %>"><%= $commit_author_id %></a>
61
+          % } else {
62
+            <%= $commit->{author_name} %>
63
+          % }
64
+        </span>
54 65
         <a href="<%= url_for("/$user/$project/commit/$rev") %>">
55 66
           <%= $commit->{title} %>
56 67
         </a>
+12 -1
templates/branches.html.ep
... ...
@@ -204,6 +204,13 @@
204 204
               <%
205 205
                 my $branch = $branches->[$i];
206 206
                 my $bname = $branch->{name};
207
+
208
+                my $commit_author_mail = $branch->{commit}{author_email};
209
+                my $commit_author_id = app->dbi->model('user')->select(
210
+                  'id',
211
+                  where => {mail => $commit_author_mail}
212
+                )->value;
213
+                
207 214
               %>
208 215
               % if ($display eq 'overview' && $i > 4) {
209 216
                 <li class="branches-overview-more">
... ...
@@ -226,7 +233,11 @@
226 233
                         Updated <%= $branch->{commit}{age_string} %> by
227 234
                       </div>
228 235
                       <div class="branches-author"  title="<%= $branch->{commit}{author_email} %>">
229
-                        <%= $branch->{commit}{author_name} %>
236
+                        % if (defined $commit_author_id) {
237
+                          <a href="<%= url_for("/$commit_author_id") %>"><%= $commit_author_id %></a>
238
+                        % } else {
239
+                          <%= $branch->{commit}{author_name} %>
240
+                        % }
230 241
                       </div>
231 242
                     </li>
232 243
                     <li class="second-child">
+12 -1
templates/commit.html.ep
... ...
@@ -26,6 +26,11 @@
26 26
   $commit->{committer_date} = $git->timestamp($committer_date);
27 27
   $from_rev = $commit->{parent} unless defined $from_rev;
28 28
   my $commit_short_id = substr($commit->{id}, 0, 7, );
29
+  my $commit_author_mail = $commit->{author_email};
30
+  my $commit_author_id = app->dbi->model('user')->select(
31
+    'id',
32
+    where => {mail => $commit_author_mail}
33
+  )->value;
29 34
   
30 35
   # Branches
31 36
   my $branch_refs = $git->references($user, $project, 'heads');
... ...
@@ -102,7 +107,13 @@
102 107
     <li class="last-child">
103 108
       <ul class="commits-summary-body">
104 109
         <li>
105
-          <span class="commits-summary-author"><%= $commit->{author_name} %></span>
110
+          <span class="commits-summary-author">
111
+            % if (defined $commit_author_id) {
112
+              <a href="<%= url_for("/$commit_author_id") %>"><%= $commit_author_id %></a>
113
+            % } else {
114
+              <%= $commit->{author_name} %>
115
+            % }
116
+          </span>
106 117
           <span>commited on <span title="<%= $commit->{age_string_datetime_local} %>"><%= $commit->{age_string_date_local} %></span>
107 118
         </li>
108 119
         <li class="last-child">
+12 -1
templates/commits.html.ep
... ...
@@ -23,6 +23,11 @@
23 23
     $self->reply->not_found;
24 24
     return;
25 25
   }
26
+  my $commit_author_mail = $commit->{author_email};
27
+  my $commit_author_id = app->dbi->model('user')->select(
28
+    'id',
29
+    where => {mail => $commit_author_mail}
30
+  )->value;
26 31
     
27 32
   # Commits
28 33
   my $page_count = 30;
... ...
@@ -140,7 +145,13 @@
140 145
                     </a>
141 146
                   </div>
142 147
                   <div class="commit-left-author">
143
-                    <span title="<%= $commit->{author_email} %>"><%= $commit->{author_name} %></span>
148
+                    <span title="<%= $commit->{author_email} %>">
149
+                      % if (defined $commit_author_id) {
150
+                        <a href="<%= url_for("/$commit_author_id") %>"><%= $commit_author_id %></a>
151
+                      % } else {
152
+                        <%= $commit->{author_name} %>
153
+                      % }
154
+                    </span>
144 155
                     <span class="muted" title="<%= $commit->{age_string_datetime_local} %>"><%= $commit->{age_string} %></span>
145 156
                   </div>
146 157
                 </div>
+14 -1
templates/compare.html.ep
... ...
@@ -191,9 +191,22 @@
191 191
         
192 192
         <ul class="compare-commits-date-container">
193 193
           % for my $commit (sort {$b->{author_epoch} <=> $a->{author_epoch}} @$commits) {
194
+            <%
195
+              my $commit_author_mail = $commit->{author_email};
196
+              my $commit_author_id = app->dbi->model('user')->select(
197
+                'id',
198
+                where => {mail => $commit_author_mail}
199
+              )->value;
200
+            %>
194 201
             <li>
195 202
               <div class="compare-commits-author">
196
-                <span title="<%= $commit->{author_email} %>"><%= $commit->{author_name} %></span>
203
+                <span title="<%= $commit->{author_email} %>">
204
+                  % if (defined $commit_author_id) {
205
+                    <a href="<%= url_for("/$commit_author_id") %>"><%= $commit_author_id %></a>
206
+                  % } else {
207
+                    <%= $commit->{author_name} %>
208
+                  % }
209
+                </span>
197 210
               </div>
198 211
               <div class="compare-commits-commit-title">
199 212
                 <a style="color:#333" href="<%= url_for("/$user/$project/commit/$commit->{id}") %>">
+12 -1
templates/include/tree.html.ep
... ...
@@ -1,11 +1,22 @@
1 1
 <%
2 2
   my $dir = stash('dir');
3
+  my $commit_author_mail = $commit->{author_email};
4
+  my $commit_author_id = app->dbi->model('user')->select(
5
+    'id',
6
+    where => {mail => $commit_author_mail}
7
+  )->value;
3 8
 %>
4 9
 
5 10
 <div>
6 11
   <div class="commit-summary">
7 12
     <div class="commit-summary-left-container">
8
-      <span class="commit-summary-author" title="<%= $commit->{author_email} %>"><%= $commit->{author_name} %></span>
13
+      <span class="commit-summary-author" title="<%= $commit->{author_email} %>">
14
+        % if (defined $commit_author_id) {
15
+          <a href="<%= url_for("/$commit_author_id") %>"><%= $commit_author_id %></a>
16
+        % } else {
17
+          <%= $commit->{author_name} %>
18
+        % }
19
+      </span>
9 20
       <a href="<%= url_for("/$user/$project/commit/$rev") %>">
10 21
         <%= $commit->{title} %>
11 22
       </a>