{% import "macros/link.html" as link %}
{% extends "repo/base.html" %}

{% block content %}
<div class="table-responsive">
<table class="commit-info">
    <tbody>
    <tr>
        <th>tag name</th>
        <td>{{ tag.name }}</td>
    </tr>
    {% if let Some(tagger) = tag.tagger %}
        <tr>
            <th>tag date</th>
            <td>{{ tagger.time() }}</td>
        </tr>
        <tr>
            <th>tagged by</th>
            <td>{{ tagger.name() }} &lt;{{ tagger.email() }}&gt;</td>
        </tr>
    {% endif %}
    {% if let Some(tagged_object) = tag.tagged_object %}
        <tr>
            <th>tagged object</th>
            <td>
                {% match tagged_object %}
                    {% when crate::git::TaggedObject::Commit with (commit) %}
                        <a href="/{{ repo.display() }}/commit?id={{ commit }}{% call link::maybe_branch_suffix(branch) %}">commit {{ commit|truncate(10) }}...</a>
                    {% when crate::git::TaggedObject::Tree with (tree) %}
                        tree {{ tree }}
                {% endmatch %}
            </td>
        </tr>
    {% endif %}
    <tr>
        <th>download</th>
        <td colspan="2"><pre><a href="/{{ repo.display() }}/snapshot?h={{ tag.name }}">{{ tag.name }}.tar.gz</a></pre></td>
    </tr>
    </tbody>
</table>
</div>

<pre class="h2-first-line">{{ tag.message }}</pre>
{% endblock %}
