Move Code into repo

This commit is contained in:
Aaron Kimbre
2022-01-16 12:22:00 -06:00
parent 1eef1854bc
commit 53ffe927f3
196 changed files with 33149 additions and 0 deletions

View 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 %}

View 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 %}

View 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 %}

View 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 %}