TabbycatDebate/tabbycat

View on GitHub
tabbycat/participants/templates/in_this_round.html

Summary

Maintainability
Test Coverage
{% load debate_tags i18n %}

<div class="card mt-3 {% if debateadjudications or debateteams and draw_released %}panel-primary{% else %}panel-default{% endif %}">
  <div class="list-group list-group-flush">

    <div class="list-group-item">
      <h4 class="card-title mb-0">
        {% if tournament.current_rounds|length == 1 %}
          {% blocktrans trimmed with round=current_round.name %}
            In This Round ({{ round }})
          {% endblocktrans %}
        {% else %}
          {% trans "In This Round" %}
        {% endif %}
        {% if admin_page and not draw_released %}
          <em>{% trans "(Not Released to Public)" %}</em>
        {% endif %}
      </h4>
    </div>

    {% if draw_released or admin_page %}

      {% trans "Room TBA" as venue_tba %}

      {% if debateadjudications != None %}
        {% for debateadjudicator in debateadjudications %}
          {% with debate=debateadjudicator.debate %}
            {% include "current_round/round_adj.html" %}
          {% endwith %}
        {% empty %}

        <div class="list-group-item">
          <em>
            {% if grammatical_person == "3" %}
              {% person_display_name adjudicator as adjudicator_name %}
              {% blocktrans trimmed with adjudicator=adjudicator_name %}
                {{ adjudicator }} is not adjudicating this round.
              {% endblocktrans %}
            {% else %}
              {% blocktrans trimmed %}
                You are not adjudicating this round.
              {% endblocktrans %}
            {% endif %}
          </em>
        </div>

        {% endfor %}

      {% elif debateteams != None %}

        {% if debateteams|length > 1 %}
          <div class="list-group-item">
            <em>
              {# This is never in the singular, it's just needed to make pluralization work with i18n. #}
              {% blocktrans trimmed with team=team_short_name count ndebates=debateteams|length %}
                It looks like {{ team }} is competing in {{ ndebates }} debate this round.
              {% plural %}
                It looks like {{ team }} is competing in {{ ndebates }} debates this round.
              {% endblocktrans %}
              {% if not admin_page %}
                {% trans "If this is an error, please contact a tab director immediately." %}
              {% endif %}
            </em>
          </div>
        {% endif %}

        {% for debateteam in debateteams %}
          {% with debate=debateteam.debate %}
            {% include "current_round/round_team.html" %}
          {% endwith %}
        {% empty %}

        <div class="list-group-item">
          <em>
            {% if grammatical_person == "3" %}
              {% blocktrans trimmed with team=team_short_name %}
                {{ team }} does not have a debate this round.
              {% endblocktrans %}
            {% else %}
              {% blocktrans trimmed %}
                You do not have a debate this round.
              {% endblocktrans %}
            {% endif %}
          </em>
        </div>
        {% endfor %}
      {% endif %}

    {% else %} {# elif not (draw_released or admin_page) #}

      <div class="list-group-item">
        <em>{% trans "The draw for this round hasn't yet been released." %}</em>
      </div>

    {% endif %} {# draw_released or admin_page #}

  </div>
</div>