A php killer game implementation
at master 61 lines 2.2 kB view raw
1{% extends "admin/base.html" %} 2{% block title %}Användare{% endblock %} 3 4 5{% block content %} 6 7 <div class="row"> 8 <div class="col"> 9 <h3>Skapa användare manuellt</h3> 10 <form action="users.php" method="post"> 11 <div class="form-group"> 12 <label for="username">Användarnamn</label> 13 <input class="form-control" type="text" name="username" id="username" autocomplete="off"> 14 </div> 15 <div class="form-group"> 16 <label for="name">Namn</label> 17 <input class="form-control" type="text" name="name" id="name" required > 18 </div> 19 <div class="form-group"> 20 <label for="class">Klass</label> 21 <input class="form-control" type="text" name="class" id="class" required > 22 </div> 23 <div class="form-group"> 24 <label for="is_admin">Admin</label> 25 <input class="form-control" type="number" min="0" max="1" name="is_admin" id="is_admin" required > 26 </div> 27 28 <input class="btn btn-dark" type="submit" name="action" value="Skapa"> 29 </form> 30 </div> 31 </div> 32 33 <h3>Användare ({{ users|length }})</h3> 34 <table class="table table-striped"> 35 <thead> 36 <tr> 37 <th>Id</th> 38 <th>Användarnamn</th> 39 <th>Namn</th> 40 <th>Klass</th> 41 <th>Roll</th> 42 <th>Registrerad datum</th> 43 <th>?</th> 44 </tr> 45 </thead> 46 <tbody> 47 {% for user in users %} 48 <tr> 49 <td>{{ user.id }}</td> 50 <td>{{ user.username }}</td> 51 <td>{{ user.name }}</td> 52 <td>{{ user.class }}</td> 53 <td>{{ user.is_admin ? 'Admin' : 'Användare' }}</td> 54 <td>{{ user.created_date }}</td> 55 <td><a class="btn btn-info" href="users.php?id={{ user.id }}">Visa</a></td> 56 </tr> 57 {% endfor %} 58 </tbody> 59 </table> 60{% endblock %} 61