byceps/byceps

View on GitHub
byceps/blueprints/admin/board/templates/admin/board/category_copy_from_form.html

Summary

Maintainability
Test Coverage
{% extends 'layout/admin/base.html' %}
{% from 'macros/admin.html' import render_backlink %}
{% from 'macros/icons.html' import render_icon %}
{% set current_page = 'board_admin' %}
{% set current_page_brand = brand %}
{% set page_title = _('Copy category') %}

{% block before_body %}
{{ render_backlink(url_for('.board_view', board_id=board.id), _('Board') ~ ' "%s"'|format(board.id)) }}
{%- endblock %}

{% block body %}

  <h1 class="title">{{ page_title }}</h1>

  {%- if categories %}
  <table class="itemlist is-vcentered is-wide">
    <thead>
      <tr>
        <th>{{ _('Title') }}<br>{{ _('Slug') }}</th>
        <th>{{ _('Description') }}</th>
        <th></th>
      </tr>
    </thead>
    <tbody>
      {%- for category in categories|sort(attribute='position') %}
      <tr>
        <td>
          <strong>{{ category.title }}</strong><br>
          {{ category.slug|dim }}
        </td>
        <td>{{ category.description }}</td>
        <td style="text-align: right;"><a class="button is-compact" href="{{ url_for('.category_create_form', board_id=board.id, source_category_id=category.id) }}"><span>{{ _('choose') }}</span> {{ render_icon('chevron-right') }}</a></td>
      </tr>
      {%- endfor %}
    </tbody>
  </table>
  {%- else %}
  <div class="box">
    <div class="dimmed-box centered">{{ _('None defined') }}</div>
  </div>
  {%- endif %}

{%- endblock %}