Browse Source

create (and initial content) for /user/index.html template.

The code in here is for the site's administrator to see a list of all
the users with an account with edit and delete options. There is,
also, a section to create new users (non-admin. accounts).
stable
Craig Oates 2 years ago
parent
commit
11e5e6a08e
  1. 43
      templates/user/index.html

43
templates/user/index.html

@ -0,0 +1,43 @@
{% extends "layouts/default.html" %}
{% block title %}Users{% endblock %}
{% block content %}
<h1>Users</h1>
<a href="/dashboard">Dashboard</a>
<form action="/user/admin/create" method="post">
<fieldset>
<legend>Create New Account</legend>
<input type="hidden" name="AUTHENTICITY-TOKEN" value="{{token}}">
<label>Username</label>
<input required type="text" name="USERNAME">
<label>Display Name</label>
<input required type="text" name="DISPLAY-NAME">
<label>Password</label>
<input required type="password" name="PASSWORD">
<label>Password Check</label>
<input required type="password" name="PASSWORD-CHECK">
<input type="submit" value="Create Account">
</fieldset>
</form>
{% for account in users %}
{% if account.username != user.username %}
<div>
<p>{{account.username}}</p>
<p>{{account.display-name}}</p>
<form action="/user/admin/edit-password" method="post">
<input required type="hidden" name="AUTHENTICITY-TOKEN" value="{{token}}">
<input required type="hidden" name="USERNAME" value="{{account.username}}">
<input required type="text" name="PASSWORD">
<input type="submit" value="Change Password">
</form>
<form action="/user/admin/delete" method="post">
<input required type="hidden" name="AUTHENTICITY-TOKEN" value="{{token}}">
<input required type="hidden" name="USERNAME" value="{{account.username}}">
<input type="submit" value="Delete Account">
</form>
</div>
{% endif %}
{% endfor %}
{% endblock %}
Loading…
Cancel
Save