Add direct links to each source file

Currently, each source file which is an external link (http://,
https://, ...) is a clickable link.

This commit extends the behaviour by making files from the repository
clickable as well. The link brings the user to the corresponding cgit
page.

Also, the link to the PKGBUILD is altered to make the configuration more
consistent.

Signed-off-by: Janne Heß <jannehess@gmail.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
Janne Heß 2017-02-12 17:37:38 +01:00 committed by Lukas Fleischer
parent 3a167a109b
commit 9df1bd5fe2
3 changed files with 7 additions and 5 deletions

View file

@ -1,6 +1,6 @@
<?php
$pkgbuild_uri = sprintf(config_get('options', 'pkgbuild_uri'), urlencode($row['BaseName']));
$pkgbuild_uri = sprintf(config_get('options', 'source_file_uri'), 'PKGBUILD', urlencode($row['BaseName']));
$log_uri = sprintf(config_get('options', 'log_uri'), urlencode($row['BaseName']));
$snapshot_uri = sprintf(config_get('options', 'snapshot_uri'), urlencode($row['BaseName']));
$git_clone_uri_anon = sprintf(config_get('options', 'git_clone_uri_anon'), htmlspecialchars($row['BaseName']));
@ -299,7 +299,7 @@ endif;
<div>
<ul id="pkgsrcslist">
<?php while (list($k, $src) = each($sources)): ?>
<li><?= pkg_source_link($src[0], $src[1]) ?></li>
<li><?= pkg_source_link($src[0], $src[1], urlencode($row['BaseName'])) ?></li>
<?php endwhile; ?>
</ul>
</div>