{% extends "repo_master.html" %}
{% block title %}Tree - {{ repo.name }}{% endblock %}
{%block tag %}home{% endblock %}
{% block repo %}
<h2>
<a href="{{ url_for('view_tree', username=username,
repo=repo.name, identifier=branchname)
}}">{{ branchname }}</a>/{%
for file in filename.split('/') %}
{% if loop.first %}
{% set path = file %}
{% else %}
{% set path = path + '/' + file %}
{% endif %}
{% if loop.index != loop.length %}<a
href="{{ url_for('view_file', username=username,
repo=repo.name, identifier=branchname,
filename=path)}}"
>{{ file }}</a>/{% else %}{{ file }}{% endif %}
{% endfor %}
</h2>
{% if content %}
{% if output_type == 'file' or output_type == 'binary' or output_type == 'image' %}
<section class="file_content">
<header>
<ul class="buttons">
<li><a class="button blob" href="{{ url_for('view_file', username=username,
repo=repo.name, identifier=branchname,
filename=filename) }}" title="View as blob">Blob</a></li>
<li><a class="button raw" href="{{ url_for('view_raw_file', username=username,
repo=repo.name, identifier=branchname,
filename=filename) }}" title="View as raw">Raw</a></li>
</ul>
</header>
{% if output_type=='file' %}
{% autoescape false %}
{{ content | format_loc}}
{% endautoescape %}
{% elif output_type == 'image' %}
<img src="{{ url_for('view_raw_file', username=username,
repo=repo.name, identifier=branchname,
filename=filename) }}"/>
{% elif output_type == 'binary' %}
<p class="noresult">
Binary files cannot be rendered.<br/>
Please
<a href="{{ url_for('view_raw_file', username=username,
repo=repo.name, identifier=branchname,
filename=filename) }}">view the raw version
</a>
</p>
{% endif %}
</section>
{% else %}
<section class="tree_list">
<h3>Tree</h3>
<ul>
{% for entry in content %}
<li class="{% if entry.filemode == 16384 %}folder{% else %}file{% endif %}">
<a href="{{ url_for('view_file', username=username,
repo=repo.name, identifier=branchname,
filename=filename + '/' + entry.name if filename else entry.name) }}">
{{ entry.name }}
</a>
<span class="filehex">{{ entry.hex|short }}</span>
</li>
{% endfor %}
</ul>
</section>
{% endif %}
{% else %}
No content found in this repository
{% endif %}
{% endblock %}