codereview/templates/browser/navigation.html
2010-11-22 15:12:09 -05:00

35 lines
1.2 KiB
HTML

{% load vcs %}
<h2><a href="{% url codereview.browser.views.log repository=repository %}?c={{ ref }}">{{ repository }}</a></h2>
<h3>Branches</h3>
<ul>
{% for branch, commit in repo.branches.items %}
<li>
{% if ref == branch or ref == commit.id %}
<strong>{{ branch }}</strong>
{% else %}
<a href="{% url codereview.browser.views.log repository=repository %}?c={{branch}}">{{ branch }}</a>
{% endif %}
</li>
{% endfor %}
</ul>
<h3>Browse</h3>
{% if path %}
<strong>{{ path }}</strong><br />
<a href="{% url codereview.browser.views.log repository=repository path=path|dirname %}?c={{ ref }}">Up one</a>
{% endif %}
<ul class="tree">
{% for dir in navigation.dirs %}
<li class="dir">
<a href="{% url codereview.browser.views.log repository=repository path=dir %}?c={{ ref }}">{{ dir|basename }}</a>
</li>
{% endfor %}
{% for file in navigation.files %}
<li class="file">
{% if file == path %}
<strong>{{ file|basename }}</strong>
{% else %}
<a href="{% url codereview.browser.views.blob repository=repository path=file %}?c={{ ref }}">{{ file|basename }}</a>
{% endif %}
</li>
{% endfor %}
</ul>