byceps/byceps

View on GitHub
byceps/blueprints/site/user_group/templates/site/user_group/index.html

Summary

Maintainability
Test Coverage
{% extends 'layout/base.html' %}
{% from 'macros/icons.html' import render_icon %}
{% from 'macros/user.html' import render_user_avatar_and_name %}
{% set current_page = 'user_group' %}
{% set page_title = _('User groups') %}

{% block body %}

  <div class="block row row--space-between row--wrap">
    <div>
      <h1 class="title">{{ page_title }}</h1>
    </div>
    {%- if g.user.authenticated %}
    <div>
      <div class="button-row is-right-aligned">
        <a class="button" href="{{ url_for('.create_form') }}">{{ render_icon('add') }} <span>{{ _('Create') }}</span></a>
      </div>
    </div>
    {%- endif %}
  </div>

  {%- if groups %}
  <table class="itemlist is-vcentered is-wide">
    <thead>
      <tr>
        <th>{{ _('Name') }}</th>
        <th>{{ _('Creator') }}</th>
      </tr>
    </thead>
    <tbody>
      {%- for group in groups|sort(attribute='title') %}
      <tr>
        <td><strong><a class="disguised" href="{{ url_for('.view', group_id=group.id) }}">{{ group.title }}</a></strong></td>
        <td>{{ render_user_avatar_and_name(group.creator, size=24) }}</td>
      </tr>
      {%- endfor %}
      <tr>
    </tbody>
  </table>
  {%- else %}
  <div class="block dimmed">{{ _('No groups exist yet.') }}</div>
  {%- endif %}

{%- endblock %}