users.html 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. {% extends theme("admin/admin_layout.html") %}
  2. {% block admin_content %}
  3. {% from theme('macros.html') import render_pagination %}
  4. {% from theme("macros.html") import render_field, group_field %}
  5. <legend>Manage Users | <a href="{{ url_for('admin.add_user') }}">Add User</a></legend>
  6. <div class="pull-left" style="padding-bottom: 10px">
  7. {{ render_pagination(users, url_for('admin.users')) }}
  8. </div>
  9. <div class="pull-right" style="padding-bottom: 10px">
  10. <form role="form" method="post">
  11. <div class="input-group">
  12. {{ search_form.hidden_tag() }}
  13. {{ group_field(search_form.search_query) }}
  14. <span class="input-group-btn">
  15. <button class="btn btn-primary" type="button">Search</button>
  16. </span>
  17. </div>
  18. </form>
  19. </div>
  20. <table class="table table-bordered">
  21. <thead>
  22. <tr>
  23. <th>#</th>
  24. <th>Username</th>
  25. <th>Posts</th>
  26. <th>Date registered</th>
  27. <th>Group</th>
  28. <th>Manage</th>
  29. </tr>
  30. </thead>
  31. <tbody>
  32. {% for user in users.items %}
  33. <tr>
  34. <td>{{ user.id }}</td>
  35. <td><a href="{{ url_for('user.profile', username=user.username) }}">{{ user.username }}</a></td>
  36. <td>{{ user.post_count }}</td>
  37. <td>{{ user.date_joined|format_date('%b %d %Y') }}</td>
  38. <td>{{ user.primary_group.name }}</td>
  39. <td>
  40. <a href="{{ url_for('admin.edit_user', user_id = user.id) }}">Edit</a> |
  41. <a href="{{ url_for('admin.delete_user', user_id = user.id) }}">Delete</a>
  42. </td>
  43. </tr>
  44. {% else %}
  45. <tr>
  46. <td colspan="6">
  47. No users found matching your search query
  48. </td>
  49. </tr>
  50. {% endfor %}
  51. </tbody>
  52. </table>
  53. {% endblock %}