Use same commit link style everywhere

This commit is contained in:
Joscha 2023-08-06 23:38:12 +02:00
parent 2b81d497bc
commit 794787a4be
10 changed files with 96 additions and 75 deletions

View file

@ -1,27 +1,8 @@
{% extends "base.html" %}
{% import "util.html" as util %}
{% block title %}{{ summary }}{% endblock %}
{% macro r_class(reachable) %}
{%- if reachable == 0 -%}
orphaned
{%- else if reachable == 1 -%}
reachable
{%- else -%}
tracked
{%- endif -%}
{% endmacro %}
{% macro r_title(reachable) %}
{%- if reachable == 0 -%}
This commit is orphaned. It can't be reached from any ref.
{%- else if reachable == 1 -%}
This commit can only be reached from untracked refs.
{%- else -%}
This commit can be reached from a tracked ref.
{%- endif -%}
{% endmacro %}
{% block body %}
<h2>Task</h2>
<div class="task">
@ -33,9 +14,11 @@ This commit can be reached from a tracked ref.
<dt>Priority:</dt>
<dd>{{ priority }}</dd>
<dt class="{% call r_class(reachable) %}" title="{% call r_title(reachable) %}">Commit:</dt>
<dd class="{% call r_class(reachable) %}" title="{% call r_title(reachable) %}">
<a href="{{ base.root }}/commit/{{ hash }}">{{ short }}</a>
<dt>Commit:</dt>
<dd>
<a href="{{ base.root }}/commit/{{ hash }}">
{% call util::commit_short(short, reachable) %}
</a>
</dd>
</dl>
</div>