A Python content management system designed for kirsle.net featuring a blog, comments and photo albums. https://rophako.kirsle.net/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
1.8 KiB

{% extends "layout.html" %}
{% block title %}Admin Center{% endblock %}
{% block content %}
<h1>User Management</h1>
<h2>Create New User</h2>
<form action="{{ url_for('admin.create_user') }}" method="POST">
<input type="hidden" name="token" value="{{ csrf_token() }}">
<legend>Create New User</legend>
<input type="text" class="form-control" size="40" name="username" placeholder="soandso"><p>
<strong>Real name:</strong><br>
<input type="text" class="form-control" size="40" name="name" placeholder="John Smith"><p>
<input type="password" class="form-control" size="40" name="password1" placeholder="correct horse battery staple"><p>
<input type="password" class="form-control" size="40" name="password2" placeholder="correct horse battery staple"><p>
<select name="role" class="form-control">
<option value="user" selected>User</option>
<option value="admin">Admin</option>
<button type="submit" class="btn btn-primary">Create</button>
<h2>User List</h2>
<table class="table table-wide">
<th width="100">User ID</th>
<th width="300">Username</th>
<th>Real name</th>
<th width="100">Role</th>
<th width="100">Log in</th>
{% for user in users %}
<td>{{ user["uid"] }}</td>
<td><a href="{{ url_for('admin.edit_user', uid=user['uid']) }}">{{ user["username"] }}</a></td>
<td>{{ user["name"] }}</td>
<td>{{ user["role"] }}</td>
{% if user["role"] != "admin" %}
<a href="{{ url_for('admin.impersonate', uid=user['uid']) }}">Log in as</a>
{% else %}
{% endif %}
{% endfor %}
{% endblock %}