useradmin.html 3.23 KB
Newer Older
David Haynes's avatar
David Haynes committed
1
<!-- include the base html template -->
2 3
{% extends 'layouts/base.html' %}

David Haynes's avatar
David Haynes committed
4
<!-- define the page title block -->
5
{% block title %}
David Haynes's avatar
David Haynes committed
6
SRCT Go &bull; Administration Panel
7 8
{% endblock %}

David Haynes's avatar
David Haynes committed
9
<!-- define the content block for the page -->
10 11
{% block content %}

David Haynes's avatar
David Haynes committed
12
<!-- define the page header div -->
13 14 15
<div class="page-header" id="banner">
  <div class="row">
    <div class="col-md-12">
16 17 18 19 20 21 22
      <h1><strong>
        <span class="fa-stack fa-lg">
          <i class="fa fa-circle fa-stack-2x"></i>
          <i class="fa fa-balance-scale fa-stack-1x fa-inverse"></i>
        </span>
        <i class="fa">Moderation Panel</i>
      </strong></h1>
23 24 25 26
    </div>
  </div>
</div>

David Haynes's avatar
David Haynes committed
27
<!-- define the div where we can select users from a table to judge them -->
28 29
<div class="row">
  <div class="col-md-12">
30
    <h3>Users awaiting moderation</h3>
David Haynes's avatar
David Haynes committed
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
    <!-- define our useradmin form which is later submitted to add users -->
    <form method="post" action="useradmin">
        <!-- csrf protection -->
        {% csrf_token %}

        <!-- define our table of users -->
        <table class="table table-striped table-hover">
            <!-- define the table head row -->
            <thead>
                <tr>
                  <th>Selected</th>
                  <th>Username</th>
                  <th>Full Name</th>
                  <th>Description</th>
                </tr>
            </thead>

            <!-- define the table body rows -->
            <tbody>
                <!-- loop through every user in the need_approval list -->
                {% for unapproved in need_approval %}
                    <!-- create a new row for this user -->
                    <tr>
                        <!-- checkbox to select user -->
                        <td>
                            <input type="checkbox" name="username" value={{ unapproved.user }}>
                        </td>
                        <!-- username -->
                        <td>{{ unapproved.user }}</td>
                        <!-- user's full name -->
                        <td>{{ unapproved.full_name }}</td>
                        <!--
                            The description provided by the user (unless they
                            did not provide one)
                        -->
                        <td>
                            {{ unapproved.description|default:"No description provided" }}
                        </td>
                    </tr>

                    <!-- if the list is empty.. display a blank row -->
                    {% empty %}
                        <tr>
                          <td>none</td>
                          <td>none</td>
                          <td>none</td>
                          <td>none</td>
                        </tr>
                  {% endfor %}
            </tbody>
        </table>

        <!-- define the div that contains submit buttons for our form -->
        <div class="form-group">
            <!-- approve selected users -->
            <input type="submit" name="_approve" value="Approve"
                    class="btn btn-primary btn-sm">
            <!-- approve selected users -->
            <input type="submit" name="_deny" value="Deny"
                    class="btn btn-danger btn-sm">
        </div>
92 93 94 95 96
    </form>
  </div>
</div>

{% endblock %}