Projects / snek / src / snek / templates / repository_tree.html

git clone https://molodetz.nl/retoor/snek.git

Raw source file available here .

{% extends "app.html" %}

{% block header_text %}{{ username }}/{{ repo_name }}{% endblock %}

{% block sidebar %}{% endblock %}

{% block main %}
<div class="container">
<p>
<strong>Branch:</strong>
<select onchange="window.location.href='/repository/{{ username }}/{{ repo_name }}/{{ rel_path }}?branch=' + this.value">
{% for branch in branches %}
<option value="{{ branch }}" {% if branch == current_branch %}selected{% endif %}>{{ branch }}</option>
{% endfor %}
</select>
</p>

<p>
<a href="/repository/{{ username }}/{{ repo_name }}?branch={{ current_branch }}">{{ repo_name }}</a>
{% if rel_path %}
{% set parts = rel_path.split('/') %}
{% set cumulative = '' %}
{% for part in parts %}
{% if cumulative %}
{% set cumulative = cumulative + '/' + part %}
{% else %}
{% set cumulative = part %}
{% endif %}
/ <a href="/repository/{{ username }}/{{ repo_name }}/{{ cumulative }}?branch={{ current_branch }}">{{ part }}</a>
{% endfor %}
{% endif %}
</p>

<ul>
{% if parent_path != None %}
<li>
<a href="/repository/{{ username }}/{{ repo_name }}{% if parent_path %}/{{ parent_path }}{% endif %}?branch={{ current_branch }}">
⬆️ ..
</a>
</li>
{% endif %}
{% if items %}
{% for item in items %}
<li>
<a href="/repository/{{ username }}/{{ repo_name }}/{{ item.path }}?branch={{ current_branch }}">
{% if item.is_dir %}📁{% else %}📄{% endif %} {{ item.name }}
</a>
{% if not item.is_dir %}({{ item.size }} bytes){% endif %}
</li>
{% endfor %}
{% else %}
<p>No files found.</p>
{% endif %}
</ul>
</div>
{% endblock %}