{% set page_title = "Memberlist" %}

{% extends theme("layout.html") %}
{% block content %}
{% from theme('macros.html') import render_pagination %}

<ul class="breadcrumb">
    <li><a href="{{ url_for('forum.index') }}">Forum</a></li>
    <li class="active">Memberlist</li>
</ul>

  <div class="pull-left" style="padding-bottom: 10px">
    {{ render_pagination(users, url_for('forum.memberlist')) }}
  </div><!-- /.col-pull-left -->
  <div class="pull-right" style="padding-bottom: 10px">
    <div class="input-group">
      <input type="text" class="form-control" placeholder="Search">
      <span class="input-group-btn">
        <button class="btn btn-default" type="button">Search</button>
      </span>
    </div><!-- /input-group -->
</div><!-- /.row -->

<table class="table table-bordered">
    <thead>
        <tr>
            <th>#</th>
            <th>Username</th>
            <th>Posts</th>
            <th>Date registered</th>
            <th>Group</th>
        </tr>
    </thead>
    <tbody>
        {% for user in users.items %}
        <tr>
            <td>{{ user.id }}</td>
            <td><a href="{{ user.url }}">{{ user.username }}</a></td>
            <td>{{ user.post_count }}</td>
            <td>{{ user.date_joined|format_date('%b %d %Y') }}</td>
            <td>{{ user.primary_group.name }}</td>
        </tr>
        {% endfor %}
    </tbody>
</table>

{% endblock %}
