mirror of
https://github.com/klaussilveira/gitlist.git
synced 2026-07-05 12:07:25 +02:00
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:
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user