Move Code into repo
This commit is contained in:
22
app/templates/play_keys/bulk.html.j2
Normal file
22
app/templates/play_keys/bulk.html.j2
Normal file
@@ -0,0 +1,22 @@
|
||||
{% extends 'base.html.j2' %}
|
||||
|
||||
{% block title %}
|
||||
Bulk Play Key Creation
|
||||
{% endblock title %}
|
||||
|
||||
{% block content_before %}
|
||||
Bulk Play Key Creation
|
||||
{% endblock content_before %}
|
||||
|
||||
{% block content %}
|
||||
<form method=post>
|
||||
{{ form.csrf_token }}
|
||||
<div class="card shadow-sm mx-auto pb-3 bg-dark border-primary" style="width: 20rem;">
|
||||
<div class="card-body">
|
||||
{{ helper.render_field(form.count) }}
|
||||
{{ helper.render_field(form.uses) }}
|
||||
{{ helper.render_submit_field(form.submit) }}
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock content %}
|
23
app/templates/play_keys/edit.html.j2
Normal file
23
app/templates/play_keys/edit.html.j2
Normal file
@@ -0,0 +1,23 @@
|
||||
{% extends 'base.html.j2' %}
|
||||
|
||||
{% block title %}
|
||||
Edit Play Key {{ key.key_string }}
|
||||
{% endblock title %}
|
||||
|
||||
{% block content_before %}
|
||||
Edit Play Key {{ key.key_string }}
|
||||
{% endblock content_before %}
|
||||
|
||||
{% block content %}
|
||||
<form method=post>
|
||||
{{ form.csrf_token }}
|
||||
<div class="card shadow-sm mx-auto pb-3 bg-dark border-primary" style="width: 20rem;">
|
||||
<div class="card-body">
|
||||
{{ helper.render_field(form.uses) }}
|
||||
{{ helper.render_checkbox_field(form.active) }}
|
||||
{{ helper.render_field(form.notes) }}
|
||||
{{ helper.render_submit_field(form.submit) }}
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock content %}
|
56
app/templates/play_keys/index.html.j2
Normal file
56
app/templates/play_keys/index.html.j2
Normal file
@@ -0,0 +1,56 @@
|
||||
{% extends 'base.html.j2' %}
|
||||
|
||||
{% block title %}
|
||||
Play Key Management
|
||||
{% endblock title %}
|
||||
|
||||
{% block content_before %}
|
||||
Play Key Management
|
||||
{% endblock content_before %}
|
||||
|
||||
{% block content %}
|
||||
{% if message %}
|
||||
<div class="row">
|
||||
<div class="col text-center">
|
||||
<h3>{{ message }}</h3>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
{% endif %}
|
||||
<a role="button" class="btn btn-primary btn btn-block"
|
||||
href='{{ url_for('play_keys.create') }}'>
|
||||
Create one Play Key with one use
|
||||
</a>
|
||||
<a role="button" class="btn btn-primary btn btn-block"
|
||||
href='{{ url_for('play_keys.bulk_create') }}'>
|
||||
Bulk Create Play Keys
|
||||
</a>
|
||||
<hr class="bg-primary"/>
|
||||
<table class="table" id="play_key_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Actions</th>
|
||||
<th>Key</th>
|
||||
<th>Uses Left</th>
|
||||
<th>Times Used</th>
|
||||
<th>Created</th>
|
||||
<th>Active</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block js %}
|
||||
{{ super () }}
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
let play_key_table = $('#play_key_table').DataTable({
|
||||
"processing": true,
|
||||
"serverSide": true,
|
||||
"ajax": "{{ url_for('play_keys.get') }}",
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
96
app/templates/play_keys/view.html.j2
Normal file
96
app/templates/play_keys/view.html.j2
Normal file
@@ -0,0 +1,96 @@
|
||||
{% extends 'base.html.j2' %}
|
||||
|
||||
{% block title %}
|
||||
Play Key {{ key.key_string }}
|
||||
{% endblock title %}
|
||||
|
||||
{% block content_before %}
|
||||
Play Key {{ key.key_string }}
|
||||
{% endblock content_before %}
|
||||
|
||||
{% block content %}
|
||||
<div class="card shadow-sm mx-auto pb-3 bg-dark border-primary" style="width: 30em;">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col text-center">
|
||||
<h4>Key Info</h4>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="row">
|
||||
<div class="col text-right">
|
||||
Uses Left:
|
||||
</div>
|
||||
<br/>
|
||||
<div class="col">
|
||||
{{ key.key_uses}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col text-right">
|
||||
Uses Left:
|
||||
</div>
|
||||
<br/>
|
||||
<div class="col">
|
||||
{{ key.key_uses}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col text-right">
|
||||
Created:
|
||||
</div>
|
||||
<br/>
|
||||
<div class="col">
|
||||
{{ key.created_at }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col text-right">
|
||||
Active:
|
||||
</div>
|
||||
<div class="col">
|
||||
{% if key.active %}
|
||||
<h5 class="far fa-check-square text-success"></h5>
|
||||
{% else %}
|
||||
<h5 class="far fa-times-circle text-danger"></h5>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col text-right">
|
||||
Notes:
|
||||
</div>
|
||||
<br/>
|
||||
<div class="col">
|
||||
{{ key.notes }}
|
||||
</div>
|
||||
</div>
|
||||
<hr class="bg-primary"/>
|
||||
<div class="row">
|
||||
<div class="col text-center">
|
||||
<h4>Associated Accounts</h4>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
{% if accounts %}
|
||||
{% for account in accounts %}
|
||||
<div class="row">
|
||||
<div class="col text-right">
|
||||
{{ account.username }}
|
||||
</div>
|
||||
<br/>
|
||||
<div class="col">
|
||||
<a role="button" class="btn btn-primary"
|
||||
href='{{ url_for('accounts.view', id=account.id) }}'>
|
||||
View Account
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
No accounts are using ths Play Key
|
||||
{% endif %}
|
||||
<br/>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
Reference in New Issue
Block a user