| ... | ... |
@@ -116,7 +116,7 @@ sub startup {
|
| 116 | 116 |
sub template {
|
| 117 | 117 |
my $template = shift; |
| 118 | 118 |
|
| 119 |
- return (cb => sub { shift->render($template, , 'mojo.maybe' => 1)});
|
|
| 119 |
+ return sub { shift->render($template, , 'mojo.maybe' => 1) };
|
|
| 120 | 120 |
} |
| 121 | 121 |
|
| 122 | 122 |
{
|
| ... | ... |
@@ -160,10 +160,10 @@ sub startup {
|
| 160 | 160 |
my $r = $r->route('/:user');
|
| 161 | 161 |
{
|
| 162 | 162 |
# Home |
| 163 |
- $r->get('/')->to(template '/user');
|
|
| 163 |
+ $r->get('/' => template '/user');
|
|
| 164 | 164 |
|
| 165 | 165 |
# Settings |
| 166 |
- $r->get('/_settings')->to(template '/user-settings');
|
|
| 166 |
+ $r->get('/_settings' => template '/user-settings');
|
|
| 167 | 167 |
} |
| 168 | 168 |
|
| 169 | 169 |
# Project |
| ... | ... |
@@ -171,50 +171,50 @@ sub startup {
|
| 171 | 171 |
my $r = $r->route('/:project');
|
| 172 | 172 |
|
| 173 | 173 |
# Home |
| 174 |
- $r->get('/')->to(template '/project');
|
|
| 174 |
+ $r->get('/' => template '/project');
|
|
| 175 | 175 |
|
| 176 | 176 |
# Commit |
| 177 |
- $r->get('/commit/*diff')->to(template '/commit');
|
|
| 177 |
+ $r->get('/commit/*diff' => template '/commit');
|
|
| 178 | 178 |
|
| 179 | 179 |
# Commits |
| 180 |
- $r->get('/commits/*rev_file', {file => undef})->to(template '/commits');
|
|
| 180 |
+ $r->get('/commits/*rev_file', {file => undef} => template '/commits');
|
|
| 181 | 181 |
|
| 182 | 182 |
# Branches |
| 183 |
- $r->any('/branches/*base_branch', {base_branch => undef})->to(template '/branches');
|
|
| 183 |
+ $r->any('/branches/*base_branch', {base_branch => undef} => template '/branches');
|
|
| 184 | 184 |
|
| 185 | 185 |
# Tags |
| 186 |
- $r->get('/tags');
|
|
| 186 |
+ $r->get('/tags' => template '/tags');
|
|
| 187 | 187 |
|
| 188 | 188 |
# Tree |
| 189 |
- $r->get('/tree/*rev_dir', {dir => undef})->to(template '/tree');
|
|
| 189 |
+ $r->get('/tree/*rev_dir' => template '/tree');
|
|
| 190 | 190 |
|
| 191 | 191 |
# Blob |
| 192 |
- $r->get('/blob/*rev_file', {file => undef})->to(template '/blob');
|
|
| 192 |
+ $r->get('/blob/*rev_file' => template '/blob');
|
|
| 193 | 193 |
|
| 194 | 194 |
# Raw |
| 195 |
- $r->get('/raw/*rev_file', {file => undef})->to(template '/raw');
|
|
| 195 |
+ $r->get('/raw/*rev_file' => template '/raw');
|
|
| 196 | 196 |
|
| 197 | 197 |
# Archive |
| 198 |
- $r->get('/archive/(*rev).tar.gz')->to(archive_type => 'tar')->to(template '/archive');
|
|
| 199 |
- $r->get('/archive/(*rev).zip')->to(archive_type => 'zip')->to(template '/archive');
|
|
| 198 |
+ $r->get('/archive/(*rev).tar.gz' => template '/archive')->to(archive_type => 'tar');
|
|
| 199 |
+ $r->get('/archive/(*rev).zip' => template '/archive')->to(archive_type => 'zip' );
|
|
| 200 | 200 |
|
| 201 | 201 |
# Compare |
| 202 |
- $r->get('/compare/(*rev1)...(*rev2)')->to(template '/compare');
|
|
| 202 |
+ $r->get('/compare/(*rev1)...(*rev2)' => template '/compare');
|
|
| 203 | 203 |
|
| 204 | 204 |
# Settings |
| 205 |
- $r->any('/settings')->to(template '/settings');
|
|
| 205 |
+ $r->any('/settings' => template '/settings');
|
|
| 206 | 206 |
|
| 207 | 207 |
# Fork |
| 208 |
- $r->any('/fork')->to(template '/fork');
|
|
| 208 |
+ $r->any('/fork' => template '/fork');
|
|
| 209 | 209 |
|
| 210 | 210 |
# Network |
| 211 |
- $r->get('/network')->to(template '/network');
|
|
| 211 |
+ $r->get('/network' => template '/network');
|
|
| 212 | 212 |
|
| 213 | 213 |
# Network Graph |
| 214 |
- $r->get('/network/graph/(*rev1)...(*rev2_abs)')->to(template '/network/graph');
|
|
| 214 |
+ $r->get('/network/graph/(*rev1)...(*rev2_abs)' => template '/network/graph');
|
|
| 215 | 215 |
|
| 216 | 216 |
# Get branches and tags |
| 217 |
- $r->get('/api/revs')->to(template '/api/revs');
|
|
| 217 |
+ $r->get('/api/revs' => template '/api/revs');
|
|
| 218 | 218 |
} |
| 219 | 219 |
} |
| 220 | 220 |
} |