mirror of
https://github.com/klaussilveira/gitlist.git
synced 2026-01-22 15:33:01 +01:00
fixed URL management
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user