byceps/byceps

View on GitHub
byceps/blueprints/admin/ticketing/templates/admin/ticketing/index_bundle_for_party.html

Summary

Maintainability
Test Coverage
{% extends 'layout/admin/ticketing.html' %}
{% from 'macros/admin.html' import render_extra_in_heading %}
{% from 'macros/admin/user.html' import render_user_avatar_and_admin_link %}
{% from 'macros/misc.html' import render_tag %}
{% from 'macros/pagination.html' import render_pagination_nav %}
{% set current_page_party = party %}
{% set current_tab = 'bundles' %}
{% set page_title = [_('Ticket bundles'), party.title] %}

{% block body %}

  <h1 class="title">{{ _('Ticket bundles') }} {{ render_extra_in_heading(bundles.total) }}</h1>

  {%- if bundles.items %}
  <table class="itemlist is-vcentered is-wide">
    <thead>
      <tr>
        <th>{{ _('Description') }}<br>{{ _('ID') }}</th>
        <th>{{ _('Created') }}</th>
        <th>{{ _('Owner') }}</th>
        <th>{{ _('Category') }}</th>
        <th class="number">{{ _('Tickets') }}</th>
      </tr>
    </thead>
    <tbody>
      {%- for bundle in bundles.items %}
      <tr>
        <td>
          <a class="disguised" href="{{ url_for('.view_bundle', bundle_id=bundle.id) }}"><strong>{{ bundle.label|fallback(_('unnamed')) }}</strong></a>
          {% if bundle.revoked %}{{ render_tag(_('revoked'), class='color-danger nowrap', icon='disabled') }}{% endif %}
          <br>
          <span class="monospace">{{ bundle.id }}</span>
        </td>
        <td>{{ bundle.created_at|datetimeformat }}</td>
        <td>{{ render_user_avatar_and_admin_link(bundle.owned_by, size=20) }}</td>
        <td>{{ bundle.ticket_category.title }}</td>
        <td class="bignumber number">{{ bundle.ticket_quantity }}</td>
      </tr>
      {%- endfor %}
    </tbody>
  </table>
  {%- else %}
  <div class="box">
    <div class="dimmed-box centered">{{ _('none') }}</div>
  </div>
  {%- endif %}

{{ render_pagination_nav(bundles, '.index_bundle_for_party', {
  'party_id': party.id,
  'per_page': per_page,
}) }}

{%- endblock %}