... | ... |
@@ -0,0 +1,18 @@ |
1 |
+package D; |
|
2 |
+ |
|
3 |
+use strict; |
|
4 |
+use warnings; |
|
5 |
+ |
|
6 |
+use base 'Exporter'; |
|
7 |
+ |
|
8 |
+use Data::Dumper 'Dumper'; |
|
9 |
+ |
|
10 |
+our @EXPORT = ('d'); |
|
11 |
+ |
|
12 |
+sub d { |
|
13 |
+ my $data = shift; |
|
14 |
+ my $dump = Dumper $data; |
|
15 |
+ print STDERR $dump; |
|
16 |
+} |
|
17 |
+ |
|
18 |
+1; |
... | ... |
@@ -568,6 +568,7 @@ sub latest_commit_log { |
568 | 568 |
my ($self, $rep, $ref, $file) = @_; |
569 | 569 |
|
570 | 570 |
my $commit_log = {}; |
571 |
+ $file = '' unless defined $file; |
|
571 | 572 |
|
572 | 573 |
my @cmd = ($self->cmd($rep), '--no-pager', 'log', |
573 | 574 |
'-n', '1', |
... | ... |
@@ -14,35 +14,23 @@ |
14 | 14 |
} |
15 | 15 |
.header_panel { |
16 | 16 |
width:900px; |
17 |
- height:40px; |
|
18 | 17 |
margin:auto; |
18 |
+ overflow:hidden; |
|
19 | 19 |
} |
20 | 20 |
.header_left { |
21 |
- float:left; |
|
22 | 21 |
width:400px; |
23 | 22 |
} |
24 |
- .header_right { |
|
25 |
- |
|
26 |
- } |
|
27 |
- .header_home { |
|
23 |
+ .header_left li { |
|
24 |
+ float:left; |
|
28 | 25 |
padding:10px; |
29 | 26 |
} |
30 |
- .header_user { |
|
31 |
- float:right; |
|
27 |
+ .header_right li{ |
|
32 | 28 |
padding:10px; |
33 |
- } |
|
34 |
- .header_new_rep { |
|
35 | 29 |
float:right; |
36 |
- padding:10px; |
|
37 | 30 |
} |
38 |
- .header_account_set { |
|
39 |
- float:right; |
|
40 |
- padding:10px; |
|
31 |
+ .header_right li a{ |
|
32 |
+ display:block; |
|
41 | 33 |
} |
42 |
- .header_signout { |
|
43 |
- float:right; |
|
44 |
- padding:10px; |
|
45 |
- } |
|
46 | 34 |
|
47 | 35 |
/* Main panel */ |
48 | 36 |
.main_panel { |
... | ... |
@@ -55,18 +43,23 @@ |
55 | 43 |
border:1px solid gray; |
56 | 44 |
border-left:none; |
57 | 45 |
list-style-type: none; |
58 |
- height:40px; |
|
59 | 46 |
padding-left:0px; |
60 | 47 |
background-color:#F5F5F5; |
48 |
+ overflow:hidden; |
|
49 |
+ height:36px; |
|
61 | 50 |
} |
62 | 51 |
.main_menu li { |
63 |
- text-align:center; |
|
64 |
- padding:10px 0px; |
|
65 | 52 |
float:left; |
66 |
- width:124px; |
|
67 |
- display:block; |
|
53 |
+ text-align:center; |
|
54 |
+ width:14%; |
|
68 | 55 |
border-left:1px solid gray; |
69 |
- height:20px; |
|
56 |
+ } |
|
57 |
+ |
|
58 |
+ .main_menu a { |
|
59 |
+ display:block; |
|
60 |
+ width:100%; |
|
61 |
+ height:100%; |
|
62 |
+ padding:10px 0px; |
|
70 | 63 |
} |
71 | 64 |
|
72 | 65 |
/* Source tree */ |
... | ... |
@@ -87,9 +80,23 @@ |
87 | 80 |
width:700px; |
88 | 81 |
float:left; |
89 | 82 |
} |
83 |
+ .tree_header2_left_right { |
|
84 |
+ color:gray; |
|
85 |
+ } |
|
90 | 86 |
.tree_header2_right { |
91 | 87 |
text-align:right; |
88 |
+ font-size:90%; |
|
89 |
+ color:gray; |
|
90 |
+ } |
|
91 |
+ .tree_header2_right a { |
|
92 |
+ color:gray; |
|
93 |
+ text-decoration:none; |
|
92 | 94 |
} |
95 |
+ .tree_header2_right a:hover { |
|
96 |
+ color:gray; |
|
97 |
+ text-decoration:underline; |
|
98 |
+ } |
|
99 |
+ |
|
93 | 100 |
.tree_body { |
94 | 101 |
font-size:80%; |
95 | 102 |
width: 100%; |
... | ... |
@@ -119,8 +126,4 @@ |
119 | 126 |
text-decoration:none; |
120 | 127 |
} |
121 | 128 |
|
122 |
- /* Utility */ |
|
123 |
- .clear { |
|
124 |
- clear:both; |
|
125 |
- } |
|
126 | 129 |
% end |
... | ... |
@@ -3,17 +3,16 @@ |
3 | 3 |
% end |
4 | 4 |
<div class="header"> |
5 | 5 |
<div class="header_panel"> |
6 |
- <div class="header_left"> |
|
7 |
- <div class="header_home"><a href="<%= url_for('/') %>">Home</a></div> |
|
8 |
- </div> |
|
9 |
- <div class="header_right"> |
|
10 |
- <div class="header_signout"><a href="<%= url_for("/logout") %>"><s>Sign out</s></a></div> |
|
11 |
- <div class="header_account_set"> |
|
6 |
+ <ul class="header_left"> |
|
7 |
+ <li><a href="<%= url_for('/') %>">Home</a></li> |
|
8 |
+ </ul> |
|
9 |
+ <ul class="header_right"> |
|
10 |
+ <li><a href="<%= url_for("/logout") %>"><s>Sign out</s></a></li> |
|
11 |
+ <li> |
|
12 | 12 |
<a href="<%= url_for("/setting/profile") %>"><s>Account setting</s></a> |
13 |
- </div> |
|
14 |
- <div class="header_new_rep"><a href="<%= url_for("/new") %>"><s>Create a new repo</s></a></div> |
|
15 |
- <div class="header_user"><a href="<%= url_for("/$user") %>"><%= $user %></a></div> |
|
16 |
- </div> |
|
13 |
+ </li> |
|
14 |
+ <li><a href="<%= url_for("/new") %>"><s>Create a new repo</s></a></li> |
|
15 |
+ <li><a href="<%= url_for("/$user") %>"><%= $user %></a></li> |
|
16 |
+ </ul> |
|
17 | 17 |
</div> |
18 | 18 |
</div> |
19 |
-<div style="clear:both"/> |
... | ... |
@@ -35,7 +35,7 @@ |
35 | 35 |
else { $tid = $commit->{tree} } |
36 | 36 |
} |
37 | 37 |
$self->render_not_found unless defined $tid; |
38 |
- |
|
38 |
+ |
|
39 | 39 |
# Get tree (command "git ls-tree") |
40 | 40 |
my @entries = (); |
41 | 41 |
my $show_sizes = 0; |
... | ... |
@@ -48,6 +48,9 @@ |
48 | 48 |
} |
49 | 49 |
close $fh |
50 | 50 |
or $api->croak(404, "Reading tree failed"); |
51 |
+ |
|
52 |
+ # Commit log |
|
53 |
+ my $latest_commit_log = $git->latest_commit_log($rep, $ref); |
|
51 | 54 |
|
52 | 55 |
# Parse tree |
53 | 56 |
my $trees; |
... | ... |
@@ -211,6 +214,7 @@ |
211 | 214 |
} |
212 | 215 |
.code_menu_branches { |
213 | 216 |
padding:5px; |
217 |
+ float:left; |
|
214 | 218 |
} |
215 | 219 |
.code_menu_right { |
216 | 220 |
text-align:right; |
... | ... |
@@ -261,17 +265,17 @@ |
261 | 265 |
<div class="user_rep"> |
262 | 266 |
<a href="<%= url_for("/$user") %>"><%= $user %></a> |
263 | 267 |
/ |
264 |
- <a href="<%= url_for %>"><%= $repository %> |
|
268 |
+ <a href="<%= url_for %>"><%= $repository %></a> |
|
265 | 269 |
</div> |
266 | 270 |
|
267 | 271 |
<ul class="main_menu"> |
268 |
- <a href="<%= url_for %>"><li>Code</li></a> |
|
269 |
- <a href="<%= url_for("/$user/$repository/network") %>"><li><s>Network</s></li></a> |
|
270 |
- <a href="<%= url_for("/$user/$repository/pulls") %>"><li><s>Pull Requests 0</s></li></a> |
|
271 |
- <a href="<%= url_for("/$user/$repository/issues") %>"><li><s>Issues 1</s></li></a> |
|
272 |
- <a href="<%= url_for("/$user/$repository/wiki") %>"><li><s>Wiki</s></li></a> |
|
273 |
- <a href="<%= url_for("/$user/$repository/graphs") %>"><li><s>Graphs</s></li></a> |
|
274 |
- <a href="<%= url_for("/$user/$repository/admin") %>"><li><s>Admin</s></li></a> |
|
272 |
+ <li><a href="<%= url_for %>">Code</a></li> |
|
273 |
+ <li><a href="<%= url_for("/$user/$repository/network") %>"><s>Network</s></a></li> |
|
274 |
+ <li><a href="<%= url_for("/$user/$repository/pulls") %>"><s>Pull Requests 0</s></a></li> |
|
275 |
+ <li><a href="<%= url_for("/$user/$repository/issues") %>"><s>Issues 1</s></a></li> |
|
276 |
+ <li><a href="<%= url_for("/$user/$repository/wiki") %>"><s>Wiki</s></a></li> |
|
277 |
+ <li><a href="<%= url_for("/$user/$repository/graphs") %>"><s>Graphs</s></a></li> |
|
278 |
+ <li><a href="<%= url_for("/$user/$repository/admin") %>"><s>Admin</s></a></li> |
|
275 | 279 |
</ul> |
276 | 280 |
|
277 | 281 |
<div class="description"><%= $desc %></div> |
... | ... |
@@ -321,9 +325,13 @@ |
321 | 325 |
</div> |
322 | 326 |
<div class="tree_header2"> |
323 | 327 |
<div class="tree_header2_left"> |
324 |
- Author | time |
|
328 |
+ <b><%= $latest_commit_log->{author} %></b> <span class="tree_header2_left_right">authored <%= $latest_commit_log->{author_date} %></span> |
|
329 |
+ </div> |
|
330 |
+ <div class="tree_header2_right"> |
|
331 |
+ <a href="<%= url_for("/$user/$rep/commit/$commit->{id}") %>"> |
|
332 |
+ latest commit <%= substr($commit->{id}, 0, 10) %> |
|
333 |
+ </a> |
|
325 | 334 |
</div> |
326 |
- <div class="tree_header2_right">latest commit</div> |
|
327 | 335 |
</div> |
328 | 336 |
<table class="tree_body"> |
329 | 337 |
% for (my $i = 0; $i <@$trees; $i++) { |