Tucker McKnight
Delete old NJK templates that aren't used anymore.
1 2 3 4 5 6 7
<ul>
{% for branch in branches %}
{% if branch.repoName == branchInfo.repoName %}
<li><a href="{{reposPath}}/{{branch.repoName | slugify}}/branches/{{branch.branchName | slugify}}">{{branch.branchName}}</a>{% if branch.branchName == branchInfo.branchName %} (current){% endif %}</li>
{% endif %}
{% endfor %}
</ul>
1 2 3 4 5 6 7
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
<h3>{{fileInfo.file | getFileName}}</h3>
{% if fileInfo.file | isDirectory(fileInfo.repoName, fileInfo.branchName) %}
<ul class="list-group">
{% set dirs = fileInfo.repoName | getDirectoryContents(fileInfo.branchName, fileInfo.file) | topLevelFilesOnly(fileInfo.file + '/') %}
{% for dir in dirs %}
<li class="list-group-item">
{% if dir.isDirectory %}
<i class="bi bi-folder-fill"></i>
{% else %}
<i class="bi bi-file-earmark"></i>
{% endif %}
<a href="{{reposPath}}/{{fileInfo.repoName | slugify}}/branches/{{fileInfo.branchName | slugify}}/files/{{dir.fullPath | slugify}}.html">{{fileInfo.file | getRelativePath(dir.name)}}</a>
</li>
{% endfor %}
</ul>
{% else %}
<div class="row py-2">
<div class="col-auto">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="showLastTouch">
<label class="form-check-label" for="showLastTouch">Show last line change</label>
</div>
</div>
<div class="col">
<a href="{{reposPath}}/{{fileInfo.repoName | slugify}}/branches/{{fileInfo.branchName | slugify}}/raw/{{fileInfo.file | slugify}}">View raw file</a>
</div>
</div>
<div class="row">
<div class="col-auto border-end">
{% set fileContents = fileInfo.repoName | getFileContents(fileInfo.branchName, fileInfo.file) %}
<code style="white-space: pre;"><pre class="language-text">
{%- for lineNumber in fileContents | lineNumbers -%}
{{ lineNumber }}
{% endfor -%}</pre></code>
</div>
<div id="annotations" class="col-auto d-none">
{% set annotations = fileInfo.repoName | getFileLastTouchInfo(fileInfo.branchName, fileInfo.file) %}
<code style="white-space: pre;"><pre class="language-text">
{%- for annotation in annotations -%}
<a href="{{reposPath}}/{{fileInfo.repoName | slugify}}/branches/{{fileInfo.branchName | slugify}}/commits/{{annotation.sha}}">{{ (annotation.sha | truncate(6, true, '')) }}</a> {{ annotation.author }}
{% endfor -%}
</pre></code>
</div>
<div class="col overflow-scroll">
<code>
{{- fileContents | highlightCode((fileInfo.file | languageExtension(fileInfo.repoName))) | safe }}
</code>
</div>
</div>
{% endif %}
<script type="text/javascript">
const toggleLastTouch = (event) => {
const isOn = event.target.checked
const annotations = document.getElementById("annotations")
if (isOn) {
annotations.classList.remove("d-none")
} else {
annotations.classList.add("d-none")
}
}
document.getElementById("showLastTouch")?.addEventListener('click', toggleLastTouch)
</script>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<div class="row">
<div class="col">
<ul class="list-group">
{% set files = currentBranch.fileList | topLevelFilesOnly('') %}
{% for file in files %}
<li class="list-group-item">
{% if file.isDirectory %}
<i class="bi bi-folder-fill"></i>
{% else %}
<i class="bi bi-file-earmark"></i>
{% endif %}
<a href="{{reposPath}}/{{branchInfo.repoName | slugify}}/branches/{{branchInfo.branchName | slugify}}/files/{{file.fullPath | slugify}}.html">{{file.name}}</a>
</li>
{% endfor %}
</ul>
</div>
</div>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
1 2 3 4 5
<ul>
{% for repo in repos %}
<li><a href="{{reposPath}}/{{repo.name | slugify}}/branches/{{reposConfig.repos[repo.name].defaultBranch}}">{{repo.name}}</a></li>
{% endfor %}
</ul>
1 2 3 4 5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
<div class="row">
<div class="col-md-8 col-sm-12 order-md-1 order-sm-2">
{{ branch.repoName | getReadMe(branch.branchName) | renderContentIfAvailable("md") | safe }}
</div>
<div class="col-md-4 col-sm-12 order-md-2 order-sm-1">
<div class="row">
<div class="col">
<div class="row align-items-center">
<div class="col-auto">
<h2 class="fs-6 my-0">Recent patches in {{branch.branchName}}</h2>
</div>
{% if rssAvailable %}
<div class="col-auto">
<a href="{{reposPath}}/{{ branch.repoName | slugify }}/branches/{{ branch.branchName | slugify }}/patches.xml" class="initialism">RSS<i class="bi bi-rss-fill ms-2" style="color: orange;"></i></a>
</div>
{% endif %}
</div>
</div>
</div>
</div>
</div>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22