TabbycatDebate/tabbycat

View on GitHub
tabbycat/tournaments/templates/tournament_index_links.html

Summary

Maintainability
Test Coverage
{% load i18n %}

<div class="list-group mt-2">

  {% url 'tournament-admin-home' tournament_slug=tournament.slug as admin_url %}
  {% url 'tournament-assistant-home' tournament_slug=tournament.slug as assistant_url %}
  {% url 'tournament-public-index' tournament_slug=tournament.slug as public_url %}

  {% if user.is_superuser %}
    {% blocktrans trimmed asvar text with tn=tournament.name %}
      Administrator area for <strong>{{ tn }}</strong>
    {% endblocktrans %}
    {% include "components/item-action.html" with icon="settings" type=type subtext=subtext url=admin_url %}
  {% endif %}

  {% if user.is_authenticated %}
    {% blocktrans trimmed asvar text with tn=tournament.name %}
      Assistant area for <strong>{{ tn }}</strong>
    {% endblocktrans %}
   {% include "components/item-action.html" with icon="pocket" type=type subtext=subtext url=assistant_url %}

    {% blocktrans trimmed asvar text with tn=tournament.name %}
      Public area for <strong>{{ tn }}</strong>
    {% endblocktrans %}
    {% include "components/item-action.html" with icon="globe" type=type subtext=subtext url=public_url %}

  {% else %}

    {% include "components/item-action.html" with text=tournament.name icon="award" url=public_url%}

  {% endif %}

</div>