fixed URL management

This commit is contained in:
Fabien Potencier
2012-07-06 21:49:55 +02:00
parent 5ecb02ba15
commit 65e0bd402b
23 changed files with 99 additions and 98 deletions

View File

@@ -12,7 +12,6 @@ $app->get('{repo}/commits/{branch}', function($repo, $branch) use($app) {
}
return $app['twig']->render('commits.twig', array(
'baseurl' => $app['baseurl'],
'page' => 'commits',
'pager' => $pager,
'repo' => $repo,
@@ -23,7 +22,8 @@ $app->get('{repo}/commits/{branch}', function($repo, $branch) use($app) {
));
})->assert('repo', '[\w-._]+')
->assert('branch', '[\w-._]+')
->value('branch', 'master');
->value('branch', 'master')
->bind('commits');
$app->get('{repo}/commits/{branch}/{file}/', function($repo, $branch, $file) use($app) {
$repository = $app['git']->getRepository($app['git.repos'] . $repo);
@@ -37,7 +37,6 @@ $app->get('{repo}/commits/{branch}/{file}/', function($repo, $branch, $file) use
}
return $app['twig']->render('commits.twig', array(
'baseurl' => $app['baseurl'],
'page' => 'commits',
'pager' => $pager,
'repo' => $repo,
@@ -55,21 +54,20 @@ $app->get('{repo}/commit/{commit}/', function($repo, $commit) use($app) {
$commit = $repository->getCommit($commit);
return $app['twig']->render('commit.twig', array(
'baseurl' => $app['baseurl'],
'page' => 'commits',
'branch' => 'master',
'repo' => $repo,
'commit' => $commit,
));
})->assert('repo', '[\w-._]+')
->assert('commit', '[a-f0-9]+');
->assert('commit', '[a-f0-9]+')
->bind('commit');
$app->get('{repo}/blame/{branch}/{file}/', function($repo, $branch, $file) use($app) {
$repository = $app['git']->getRepository($app['git.repos'] . $repo);
$blames = $repository->getBlame("$branch -- $file");
return $app['twig']->render('blame.twig', array(
'baseurl' => $app['baseurl'],
'page' => 'commits',
'file' => $file,
'repo' => $repo,
@@ -80,4 +78,5 @@ $app->get('{repo}/blame/{branch}/{file}/', function($repo, $branch, $file) use($
));
})->assert('repo', '[\w-._]+')
->assert('file', '.+')
->assert('branch', '[\w-._]+');
->assert('branch', '[\w-._]+')
->bind('blame');