useradmin.html 7.46 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 %} SRCT Go &bull; Administration Panel {% endblock %}
6

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

10 11 12
<!-- Tell Django to load static files -->
{% load staticfiles %}

David Haynes's avatar
David Haynes committed
13
<!-- define the page header div -->
14 15 16
<div class="page-header" id="banner">
  <div class="row">
    <div class="col-md-12">
17
      <h1>
18 19 20 21
        <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>
22 23
        Moderation Panel
      </h1>
24 25 26 27
    </div>
  </div>
</div>

Zosman's avatar
Zosman committed
28
<!-- Table 1 -->
Zosman's avatar
Zosman committed
29
<!-- define the table that displays blocked users and allows us to unblock them -->
30
<div class="row">
31 32 33 34 35 36 37 38 39 40 41 42 43
  <div class="col-md-12">
    <input class="inputfilter" type="text" id="blockedInput"
      placeholder="Search Usernames or Full Names">
    <h3>Blocked Users</h3>
    <form method="post" action="useradmin">
      <!-- csrf protection  -->
      {% csrf_token %}
      <table class="table table-striped table-hover" id="blockedTable">
        <!-- define the header row -->
        <thead>
          <tr>
            <th>Selected</th>
            <th>Username</th>
Zac Wood's avatar
Zac Wood committed
44
            <th>Email</th>
45 46
          </tr>
        </thead>
47

48 49 50 51 52 53 54
        <!-- define the body rows -->
        <tbody>
          <!-- loop through all blocked users -->
          {% for blockedUsers in blocked_users %}
          <tr>
            <td><input type="checkbox" name="username" value={{ blockedUsers.user }}></td>
            <td>{{ blockedUsers.user }}</td>
Zac Wood's avatar
Zac Wood committed
55
            <td>{{ blockedUsers.user.email }}</td>
56 57 58 59 60 61 62 63 64 65 66
          </tr>
          <!-- unless there are no blocked users -->
          {% empty %}
          <tr>
            <td>none</td>
            <td>none</td>
            <td>none</td>
          </tr>
          {% endfor %}
        </tbody>
      </table>
Grady Moran's avatar
Grady Moran committed
67

68 69 70 71
      <!-- define an unblock button -->
      <div class="form-group">
        <!-- input type="submit" name="_unblock" value="Un-Block" class="btn btn-default btn-sm btn-Unblock"-->
        <a class="btn btn-default btn-sm btn-Unblock" data-target="#unblockModal" data-toggle="modal"> Unblock </a>
Grady Moran's avatar
Grady Moran committed
72

73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
        <!--Define Un-Block Modal-->
        <div id="unblockModal" class="modal fade" role="dialog" tabindex="-1">
          <div class="modal-dialog">
            <!-- Modal content-->
            <div class="modal-content" style="background-color:#f5f5f5; border-radius: 7px">
              <div class="modal-header" style="text-align:center;">
                <h4 class="modal-title  text-center" style="font-weight:bold; font-size: 21px !important;">
                  Are you sure you would like to unblock a user?</h4>
              </div>
              <div class="modal-body" style="padding-bottom: 80px">
                <a type="button" class="btn btn-success btn-lg" style="border-width: 0px;float:left; width:49%; background-color: #A9B0AD; color: #ffffff; border-radius: 4px;"
                  data-dismiss="modal">Cancel</a>
                <input type="submit" name="_unblock" value="Un-Block" class="btn btn-default btn-lg"
                  style="border-width: 0px;float:right; width:49%; background-color: #e7e7e7; color: #000000; border-radius: 4px;">
              </div>
88
            </div>
89 90 91 92 93 94
          </div>
        </div>

      </div>
    </form>
  </div>
95 96
</div>

Zac Wood's avatar
Zac Wood committed
97
<!-- Table 2 -->
98
<!-- define the table of current users -->
99
<div class="row">
100 101 102 103 104 105 106 107 108 109 110 111
  <div class="col-md-12">
    <input class="inputfilter" type="text" id="currentInput" 
      placeholder="Search Usernames or Full Names">
    <h3>Current Users</h3>
    <form method="post" action="useradmin">
      <!-- csrf protection  -->
      {% csrf_token %}
      <table class="table table-striped table-hover " id="currentTable">
        <!-- define the header row -->
        <thead>
          <tr>
            <th>Selected</th>
Zac Wood's avatar
Zac Wood committed
112 113
	    <th>Username</th>
            <th>Email</th>
114 115
          </tr>
        </thead>
116

117 118 119 120 121 122
        <!-- define the body rows -->
        <tbody>
          <!-- loop through all current users -->
          {% for currentUsers in current_users %}
          <tr>
            <td><input type="checkbox" name="username" value={{ currentUsers.user }}></td>
Zac Wood's avatar
Zac Wood committed
123 124
	    <td>{{ currentUsers.user }}</td>
            <td>{{ currentUsers.user.email }}</td>
125 126 127 128
          </tr>
          <!-- unless there are none -->
          {% empty %}
          <tr>
Zac Wood's avatar
Zac Wood committed
129
	    <td>none</td>
130 131 132 133 134 135
            <td>none</td>
            <td>none</td>
          </tr>
          {% endfor %}
        </tbody>
      </table>
136

137 138 139 140 141
      <!-- display our removal and blocking buttons -->
      <div class="form-group">
        <a class="btn btn-danger btn-sm" data-target="#removeModal" data-toggle="modal"> Remove </a>
        <a class="btn btn-default btn-sm btn-blockUsr" data-target="#blockModal2" data-toggle="modal"
          style="background-color: black; color: white;"> Block </a>
142

143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158
        <!--Define Remove Modal-->
        <div id="removeModal" class="modal fade" role="dialog" tabindex="-1">
          <div class="modal-dialog">
            <!-- Modal content-->
            <div class="modal-content" style="background-color:#f5f5f5; border-radius: 7px">
              <div class="modal-header" style="text-align:center;">
                <h4 class="modal-title  text-center" style="font-weight:bold; font-size: 21px !important;">
                  Are you sure you would like to remove a user?</h4>
                <h6 style="font-weight:500; margin-top: 0px; margin-bottom: 0px;">
                  Please remember the user's feelings</h6>
              </div>
              <div class="modal-body" style="padding-bottom: 80px">
                <a type="button" class="btn btn-success btn-lg" style="border-width: 0px;float:left; width:49%; background-color: #A9B0AD; color: #ffffff; border-radius: 4px;"
                  data-dismiss="modal">Cancel</a>
                <input type="submit" name="_remove" value="Remove" class="btn btn-danger btn-lg"
                  style="border-width: 0px; float:right; width:49%;background-color: #ac1d37; color: #ffffff; border-radius: 4px;">
159
              </div>
160 161 162
            </div>
          </div>
        </div>
163

164 165 166 167 168 169 170 171 172 173 174 175 176 177 178
        <!--Define Block Modal 2-->
        <div id="blockModal2" class="modal fade" role="dialog" tabindex="-1">
          <div class="modal-dialog">
            <!-- Modal content-->
            <div class="modal-content" style="background-color:#f5f5f5; border-radius: 7px">
              <div class="modal-header" style="text-align:center;">
                <h4 class="modal-title  text-center" style="font-weight:bold; font-size: 21px !important;">
                  Are you sure you would like to block a user?</h4>
                <h6 style="font-weight:500; margin-top: 0px; margin-bottom: 0px;">
                  Please remember the user's feelings</h6>
              </div>
              <div class="modal-body" style="padding-bottom: 80px">
                <a type="button" class="btn btn-success btn-lg" style="border-width: 0px;float:left; width:49%; background-color: #A9B0AD; color: #ffffff; border-radius: 4px;"
                  data-dismiss="modal">Cancel</a>
                <input type="submit" name="_block" value="Block" class="btn btn-danger btn-lg" style="border-width: 0px; float:right; width:49%;background-color: #000000; color: #ffffff; border-radius: 4px;">
Grady Moran's avatar
Grady Moran committed
179
              </div>
180
            </div>
181 182 183 184 185
          </div>
        </div>
      </div>
    </form>
  </div>
186
</div>
187

188
<script src="{% static "js/useradmin.js" %}"></script>
189

Zac Wood's avatar
Zac Wood committed
190
{% endblock %}