{% extends "base/container.html" %}

{% block content %}
<section>
  <form action='' method='POST'>
    {{ form.hidden_tag() }}
    {{ form.submit }}
  </form>

  <h2>List of members</h2>

  <table style="width:70%; margin: auto;">
    <tr><th>Name</th><th>Email</th><th>Register</th><th>XP</th><th>Inn.</th>
    	  <th>Newsletter</th></tr>

  	{% for user in users %}
  	  <tr><td><a href="{{ url_for('user_by_id', user_id=user.id) }}" >{{ user.name }}</a></td>
          <td>{{ user.email }}</td>
  	  	  <td>{{ user.register_date }}</td><td>{{ user.xp }}</td>
  	  	  <td>{{ user.innovation }}</td>
  	  	  <td>{{ "Yes" if user.newsletter else "No" }}</td></tr>
  	{% endfor %}
  </table>

  <h2>List of groups</h2>

  <table style="width:70%; margin: auto;">
    <tr><th>Group</th><th>Members</th><th>Privileges</th></tr>

    {% for group in groups %}
      <tr><td><span style="{{ group.css }}">{{ group.name }}</span></td><td>
        {% for user in group.members %}
          {{ user.name }}
        {% endfor %}
      </td><td>
      	{% for priv in group.privs %}
      	  <code>{{ priv }}</code>
      	{% endfor %}
      </td></tr>
    {% endfor %}
  </table>
</section>
{% endblock %}
