Commit 9d516619 authored by Markus Willman's avatar Markus Willman

further tweak source view

parent 7852f0dc
......@@ -19,7 +19,7 @@ define('IP_HEADER', 'CF-Connecting-IP');
// Define these to add git matadata to templates
define('GIT_BIN_PATH', '/usr/bin/git');
define('GIT_CACHE_PATH', DCBASE_CACHE_PATH . 'git_cache/');
define('GIT_HISTORY_URL', '//gitlab.com/dcnf/dcbase.org/commits/master');
define('GIT_PUBLIC_URL', '//gitlab.com/dcnf/dcbase.org');
// Define this to tell the world about the middleware layer
define('DCBASE_EXPOSE', true);
......
......@@ -132,8 +132,12 @@
Copyright © {{ 'now' | date('Y') }} {{ content_owner }}
<small class="float-right d-none d-lg-inline d-print-none">
{{ util.git_stats(git_info) }} {{ util.page_stats() }} |
{% if constant('GIT_HISTORY_URL') is defined %}<a class="history-link" href="{{ constant('GIT_HISTORY_URL') ~ git_info.file }}" rel="nofollow">History</a> |{% endif %}
{% if source_view %}<a class="source-link" href="{{ make_url(path_info, 'source=view') }}" rel="nofollow">Source</a> |{% endif %}
{% if source_view -%}
{% if if git_info and constant('GIT_PUBLIC_URL') is defined -%}
<a class="history-link" href="{{ constant('GIT_PUBLIC_URL') ~ '/commits/master' ~ git_info.file }}" rel="nofollow">History</a> |
{%- endif %}
<a class="source-link" href="{{ make_url(path_info, 'source=view') }}" rel="nofollow">Source</a> |
{%- endif %}
<a class="style-toggle d-none" href="#"></a>
</small>
<br>
......
......@@ -57,6 +57,8 @@
{% if source_lang == 'twig' -%}
$('.hljs-template-tag > .hljs-name:contains(markdown)').each(sourceRefs);
$('.hljs-template-tag > .hljs-name:contains(include)').each(sourceRefs);
$('.hljs-template-tag > .hljs-name:contains(import)').each(sourceRefs);
$('.hljs-template-tag > .hljs-name:contains(extends)').each(sourceRefs);
{%- endif %}
});
......@@ -67,6 +69,9 @@
<h4 class="float-left">Source of: {{ source_file }}</h4>
<p class="text-right">
{% if git_info and constant('GIT_PUBLIC_URL') is defined -%}
<a href="{{ constant('GIT_PUBLIC_URL') ~ '/blob/master' ~ git_info.file }}" class="btn btn-primary" rel="nofollow">View in Git</a>
{%- endif %}
<button type="button" class="wordwrap-toggle btn btn-primary" data-toggle="button" aria-pressed="false" autocomplete="off">Word Wrap</button>
</p>
<div class="card bg-light shadow-sm">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment