Fix raw blob view

A previous change of mine had broken it.

Also rename a route parameter in CommitController for consistency with
other route params.
This commit is contained in:
Nate Eagleson
2013-02-18 23:06:40 -05:00
parent 6e4e8912b0
commit c0e63d14e6
2 changed files with 5 additions and 5 deletions

View File

@@ -91,11 +91,11 @@ class CommitController implements ControllerProviderInterface
->assert('commit', '[a-f0-9^]+')
->bind('commit');
$route->get('{repo}/blame/{branch_file}', function($repo, $branch_file) use ($app) {
$route->get('{repo}/blame/{commitish_path}', function($repo, $commitish_path) use ($app) {
$repository = $app['git']->getRepository($app['git.repos'] . $repo);
list($branch, $file) = $app['util.routing']
->parseCommitishPathParam($branch_file, $repo);
->parseCommitishPathParam($commitish_path, $repo);
list($branch, $file) = $app['util.repository']->extractRef($repository, $branch, $file);
@@ -110,7 +110,7 @@ class CommitController implements ControllerProviderInterface
'blames' => $blames,
));
})->assert('repo', $app['util.routing']->getRepositoryRegex())
->assert('branch_file', $app['util.routing']->getCommitishPathRegex())
->assert('commitish_path', $app['util.routing']->getCommitishPathRegex())
->bind('blame');
return $route;

View File

@@ -13,12 +13,12 @@
<div class="btn-group pull-right">
<a href="{{ path('blob_raw', {repo: repo, commitish_path: branch ~ '/' ~ file}) }}" class="btn btn-small"><i class="icon-file"></i> Raw</a>
<a href="{{ path('blame', {repo: repo, branch_file: branch ~ '/' ~ file}) }}" class="btn btn-small"><i class="icon-bullhorn"></i> Blame</a>
<a href="{{ path('blame', {repo: repo, commitish_path: branch ~ '/' ~ file}) }}" class="btn btn-small"><i class="icon-bullhorn"></i> Blame</a>
<a href="{{ path('commits', {repo: repo, commitish_path: branch ~ '/' ~ file}) }}" class="btn btn-small"><i class="icon-list-alt"></i> History</a>
</div>
</div>
{% if fileType == 'image' %}
<center><img src="{{ path('blob_raw', {repo: repo, branch: branch, file: file}) }}" alt="{{ file }}" class="image-blob" /></center>
<center><img src="{{ path('blob_raw', {repo: repo, commitish_path: branch ~ '/' ~ file}) }}" alt="{{ file }}" class="image-blob" /></center>
{% elseif fileType == 'markdown' %}
<div class="readme-view"><div id="readme-content">{{ blob }}</div></div>