Browse Source

Fixed app prefix adding leading /

pull/24/head
Teknikode 8 years ago
parent
commit
88f3a6dbce
  1. 2
      git/index.php
  2. 2
      git/src/GitList/Application.php
  3. 2
      git/views/tree.twig

2
git/index.php

@ -45,7 +45,7 @@ if ($_GET['user']) @@ -45,7 +45,7 @@ if ($_GET['user'])
$_SERVER['HTTP_X_ORIGINAL_URL'] = str_replace("/u/".$_GET['user'], "", $_SERVER['HTTP_X_ORIGINAL_URL']);
$config->set('git', 'repositories', array('G:\\Repositories\\u\\'.$_GET['user']));
$config->set('git', 'hidden', array(''));
$config->set('app', 'path_prefix', 'u/'.$_GET['user']);
$config->set('app', 'path_prefix', '/u/'.$_GET['user']);
$config->set('app', 'clone_url', 'ssh://git@teknik.io:u/'.$_GET['user'].'/');
$app = require 'boot.php';
$app->run();

2
git/src/GitList/Application.php

@ -32,7 +32,7 @@ class Application extends SilexApplication @@ -32,7 +32,7 @@ class Application extends SilexApplication
$this['debug'] = $config->get('app', 'debug');
$this['filetypes'] = $config->getSection('filetypes');
$this['cache.archives'] = $this->getCachePath() . 'archives';
$this['path_prefix'] = '/'.$config->get('app', 'path_prefix');
$this['path_prefix'] = $config->get('app', 'path_prefix');
$this['clone_url'] = $config->get('app', 'clone_url');
// Register services

2
git/views/tree.twig

@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
{% block extra %}
<div class="pull-right">
<div class="btn-group download-buttons">
<a href="{{ app.clone_url }}{{ repo }}" class="btn btn-default btn-xs" title="Clone '{{ repo }}'"><span class="fa fa-cloud-download"></span> Clone</a>
<a href="{{ app.clone_url }}{{ repo }}" class="btn btn-default btn-xs" title="Clone {{ repo }}"><span class="fa fa-cloud-download"></span> Clone</a>
<a href="{{ app.path_prefix }}{{ path('archive', {repo: repo, branch: branch, format: 'zip'}) }}" class="btn btn-default btn-xs" title="Download '{{ branch }}' as a ZIP archive">ZIP</a>
<a href="{{ app.path_prefix }}{{ path('archive', {repo: repo, branch: branch, format: 'tar'}) }}" class="btn btn-default btn-xs" title="Download '{{ branch }}' as a TAR archive">TAR</a>
</div>

Loading…
Cancel
Save