Implement Cosmetics Configuration to the Administrators Panel

This commit is contained in:
Jeremy Zhang
2017-07-22 05:02:59 +00:00
parent f4608794a0
commit 1304ea6153
5 changed files with 231 additions and 3 deletions

View File

@ -0,0 +1,80 @@
{% extends 'site_layout.html.j2' %}
{% set title="Editing User Cosmetics Privilages" %}
{% block content %}
<h1>Administrating User Cosmetics Privilages</h1>
<div class="row">
<div class="col s12">
<div class="card-panel indigo lighten-5 z-depth-3 hoverable black-text">
<p class="flow-text">New Entry</p>
<table class="bordered striped">
<thead>
<tr>
<th>User ID</th>
<th>CSS</th>
<th>Submit</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<div class="input-field inline">
<input id="new_user_id">
</div>
</td>
<td>
<div class="switch">
<label>
Off
<input type="checkbox" id="new_css_switch">
<span class="lever"></span>
On
</label>
</div>
</td>
<td>
<a class="waves-effect waves-light btn" id="new_submit">Submit</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="col s12">
<div class="card-panel indigo lighten-5 z-depth-3 hoverable black-text">
<table class="bordered striped">
<thead>
<tr>
<th>Remove</th>
<th>User ID</th>
<th>CSS</th>
</tr>
</thead>
<tbody>
{% for cosmetic in cosmetics %}
<tr>
<td><a class="waves-effect waves-light btn red" id="new_submit" onclick="delete_user('{{ cosmetic.user_id }}');">Remove</a></td>
<td>{{ cosmetic.user_id }}</td>
<td>
<div class="switch">
<label>
Off
<input type="checkbox" id="new_css_switch" {% if cosmetic.css %}checked{% endif %} onchange="update_css_switch('{{ cosmetic.user_id }}', this)">
<span class="lever"></span>
On
</label>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endblock %}
{% block script %}
<script type="text/javascript" src="{{ url_for('static', filename='js/admin_cosmetics.js') }}"></script>
{% endblock %}

View File

@ -2,5 +2,16 @@
{% set title="Admin" %}
{% block content %}
<h1>Administrate Titan Embeds</h1>
<p class="flow-text">Select an action.</p>
<div class="row">
<div class="col s12">
<div class="card-panel indigo lighten-5 z-depth-3 hoverable black-text">
<h4>Cosmetics</h4>
<p class="flow-text">Give or revoke special <em>cosmetics privilages</em> for users.</p>
<a class="waves-effect waves-light btn" href="{{ url_for('admin.cosmetics') }}">Manage</a>
</div>
</div>
</div>
{% endblock %}