... | ... |
@@ -58,43 +58,43 @@ sub startup { |
58 | 58 |
# Home |
59 | 59 |
$r->get('/')->to('#home'); |
60 | 60 |
|
61 |
- # Repositories |
|
61 |
+ # Projects |
|
62 | 62 |
$r->get('/:user')->to('#projects'); |
63 | 63 |
|
64 |
- # Repository |
|
65 |
- $r->get('/:user/:project')->to('#project'); |
|
66 |
- |
|
67 |
- # Commit |
|
68 |
- $r->get('/:user/:project/commit/:diff')->to('#commit'); |
|
69 |
- |
|
70 |
- # Commits |
|
71 |
- $r->get('/:user/:project/commits/:rev', {id => 'HEAD'})->to('#commits'); |
|
72 |
- $r->get('/:user/:project/commits/:rev/(*blob)')->to('#commits'); |
|
73 |
- |
|
74 |
- # Branches |
|
75 |
- $r->get('/:user/:project/branches')->to('#branches'); |
|
64 |
+ # Project |
|
65 |
+ { |
|
66 |
+ my $r = $r->route('/:user/:project'); |
|
67 |
+ $r->get('/')->to('#project'); |
|
68 |
+ |
|
69 |
+ # Commit |
|
70 |
+ $r->get('/commit/:diff')->to('#commit'); |
|
71 |
+ |
|
72 |
+ # Commits |
|
73 |
+ $r->get('/commits/:rev', {id => 'HEAD'})->to('#commits'); |
|
74 |
+ $r->get('/commits/:rev/(*blob)')->to('#commits'); |
|
75 |
+ |
|
76 |
+ # Branches |
|
77 |
+ $r->get('/branches')->to('#branches'); |
|
76 | 78 |
|
77 |
- # Tags |
|
78 |
- $r->get('/:user/:project/tags')->to('#tags'); |
|
79 |
+ # Tags |
|
80 |
+ $r->get('/tags')->to('#tags'); |
|
79 | 81 |
|
80 |
- # Tree |
|
81 |
- $r->get('/:user/:project/tree/(*object)')->to('#tree'); |
|
82 |
- |
|
83 |
- # Blob |
|
84 |
- $r->get('/:user/:project/blob/(*object)')->to('#blob'); |
|
85 |
- |
|
86 |
- # Blob diff |
|
87 |
- $r->get('/:user/:project/blobdiff/(#diff)/(*file)')->to('#blobdiff'); |
|
88 |
- |
|
89 |
- # Raw |
|
90 |
- $r->get('/:user/:project/raw/(*id_file)')->to('#raw'); |
|
91 |
- |
|
92 |
- # Projects |
|
93 |
- $r->get('/(*home)/projects')->to('#projects')->name('projects'); |
|
94 |
- |
|
95 |
- # Archive |
|
96 |
- $r->get('/:user/:project/archive/(:rev).tar.gz')->to('#archive', archive_type => 'tar'); |
|
97 |
- $r->get('/:user/:project/archive/(:rev).zip')->to('#archive', archive_type => 'zip'); |
|
82 |
+ # Tree |
|
83 |
+ $r->get('/tree/(*object)')->to('#tree'); |
|
84 |
+ |
|
85 |
+ # Blob |
|
86 |
+ $r->get('/blob/(*object)')->to('#blob'); |
|
87 |
+ |
|
88 |
+ # Blob diff |
|
89 |
+ $r->get('/blobdiff/(#diff)/(*file)')->to('#blobdiff'); |
|
90 |
+ |
|
91 |
+ # Raw |
|
92 |
+ $r->get('/raw/(*id_file)')->to('#raw'); |
|
93 |
+ |
|
94 |
+ # Archive |
|
95 |
+ $r->get('/archive/(:rev).tar.gz')->to('#archive', archive_type => 'tar'); |
|
96 |
+ $r->get('/archive/(:rev).zip')->to('#archive', archive_type => 'zip'); |
|
97 |
+ } |
|
98 | 98 |
|
99 | 99 |
# File cache |
100 | 100 |
$git->search_projects; |
... | ... |
@@ -0,0 +1,36 @@ |
1 |
+% layout 'common'; |
|
2 |
+ %= include '/css/common'; |
|
3 |
+ |
|
4 |
+ %= stylesheet begin |
|
5 |
+ |
|
6 |
+ % end |
|
7 |
+ |
|
8 |
+ %= include '/include/header'; |
|
9 |
+ |
|
10 |
+ <div class="main_panel"> |
|
11 |
+ %= include '/include/sub_header'; |
|
12 |
+ |
|
13 |
+ <h2>Compare View</h2> |
|
14 |
+ <div class="description">Last commit a year ago</div> |
|
15 |
+ %= include '/include/code_menu', display => 'files'; |
|
16 |
+ |
|
17 |
+ <div class="commit_number"> |
|
18 |
+ <div class="commit_number_left"> |
|
19 |
+ <a href="<%= url_for %>"><%= $project %></a> |
|
20 |
+ </div> |
|
21 |
+ <div class="commit_number_right"> |
|
22 |
+ <a href="<%= url_for("/$user/$project/commits/master") %>"> |
|
23 |
+ <%= $commits_number %> commits |
|
24 |
+ </a> |
|
25 |
+ </div> |
|
26 |
+ </div> |
|
27 |
+ |
|
28 |
+ %= include '/include/tree'; |
|
29 |
+ |
|
30 |
+ <div class="readme"> |
|
31 |
+ <div class="readme_title">README</div> |
|
32 |
+ <div class="readme_body"><pre><%= $readme %></pre></div> |
|
33 |
+ </div> |
|
34 |
+ </div> |
|
35 |
+ |
|
36 |
+ %= include '/include/footer'; |