django_coreprotect/templates/coreprotect/coreprotect.html

226 lines
10 KiB
HTML

{% load static %}
<!doctype html>
<html lang="en">
<head>
<title>CoreProtect Web Interface</title>
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Ubuntu" >
<link rel="stylesheet" type="text/css" href="{% static 'coreprotect/css/bulma.min.css' %}"/>
<link rel="stylesheet" type="text/css" href="{% static 'coreprotect/css/bulma.dark.css' %}"/>
<link rel="stylesheet" type="text/css" href="{% static 'coreprotect/css/bulma-extensions.min.css' %}"/>
<link rel="stylesheet" type="text/css" href="{% static 'coreprotect/css/flatpickr.min.css' %}"/>
<link rel="stylesheet" type="text/css" href="{% static 'coreprotect/css/flatpickr.dark.css' %}"/>
<script src="{% static 'coreprotect/js/flatpickr.js' %}"></script>
</head>
<body>
<div class="block"></div>
<div class="has-text-centered">
<h1 class="title">CoreProtect Web GUI</h1>
<hr/>
</div>
<div class="columns">
<form style="margin-left: 7rem;" class="has-text-left column is-one-third">
<div class="columns">
<div class="column is-one-half">
<h4 class="title is-5 has-text-primary">
Actions
</h4>
<div class="field">
<input class="is-checkradio is-block is-info" id="block_break" name="block_break" type="checkbox" {% if form.block_break %}checked{% endif %}>
<label for="block_break">Block Break</label>
</div>
<div class="field">
<input class="is-checkradio is-block is-info" id="block_place" name="block_place" type="checkbox" {% if form.block_place %}checked{% endif %}>
<label for="block_place">Block Place</label>
</div>
<div class="field">
<input class="is-checkradio is-block is-info" id="chat" name="chat" type="checkbox" {% if form.chat %}checked{% endif %}>
<label for="chat">Chat</label>
</div>
<div class="field">
<input class="is-checkradio is-block is-info" id="chest_use" name="chest_use" type="checkbox" {% if form.chest_use %}checked{% endif %}>
<label for="chest_use">Chest Use</label>
</div>
<div class="field">
<input class="is-checkradio is-block is-info" id="command" name="command" type="checkbox" {% if form.command %}checked{% endif %}>
<label for="command">Command</label>
</div>
<div class="field">
<input class="is-checkradio is-block is-info" id="interact" name="interact" type="checkbox" {% if form.interact %}checked{% endif %}>
<label for="interact">Interact</label>
</div>
<div class="field">
<input class="is-checkradio is-block is-info" id="login_logout" name="login_logout" type="checkbox" {% if form.login_logout %}checked{% endif %}>
<label for="login_logout">Login/Logout</label>
</div>
<div class="field">
<input class="is-checkradio is-block is-info" id="sign_place" name="sign_place" type="checkbox" {% if form.sign_place %}checked{% endif %}>
<label for="sign_place">Sign Place</label>
</div>
<br/>
<h4 class="title is-5 has-text-primary">
Worlds
</h4>
{% for world in form.worlds %}
<div class="field">
<input class="is-checkradio is-block is-info" id="{{world.id}}" name="{{world.id}}" type="checkbox" {% if world.checked %}checked{% endif %}>
<label for="{{world.id}}">{{world.name}}</label>
</div>
{% endfor %}
<br/>
<h4 class="title is-5 has-text-primary">
Options
</h4>
<div class="field">
<input class="is-checkradio is-block is-info" id="ignore_environment" name="ignore_environment" type="checkbox" {% if form.ignore_environment %}checked{% endif %}>
<label for="ignore_environment">Ignore Environment</label>
</div>
<br/>
<h4 class="title is-5 has-text-primary">
Limit Results
</h4>
<div class="field">
<p class="control">
<span class="select">
<select id="limit_results" name="limit_results">
<option value="200" {% if form.limit_results == "200" %}selected{% endif %}>200</option>
<option value="500" {% if form.limit_results == "500" %}selected{% endif %}>500</option>
<option value="1000" {% if form.limit_results == "1000" %}selected{% endif %}>1000</option>
<option value="2000" {% if form.limit_results == "2000" %}selected{% endif %}>2000</option>
<option value="4000" {% if form.limit_results == "4000" %}selected{% endif %}>4000</option>
<option value="10000" {% if form.limit_results == "10000" %}selected{% endif %}>10000</option>
<option value="25000" {% if form.limit_results == "25000" %}selected{% endif %}>25000</option>
<option value="-1" {% if form.limit_results == "-1" %}selected{% endif %}>All</option>
</select>
</span>
</p>
</div>
</div>
<div class="column is-one-half">
<h4 class="title is-5 has-text-primary">
Players
</h4>
<div class="field tooltip" data-tooltip="Accepts full or partial names. Separated by commas.">
<input class="input" id="players" name="players" type="text" placeholder="Player Names" value="{{form.players}}">
</div>
<br/>
<h4 class="title is-5 has-text-primary">
Coordinates
</h4>
<div class="field has-addons tooltip" data-tooltip="Whole numbers only.">
<p class="control">
<input class="input" id="x" name="x" type="text" placeholder="X" value="{{form.x}}">
</p>
<p class="control">
<input class="input" id="y" name="y" type="text" placeholder="Y" value="{{form.y}}">
</p>
<p class="control">
<input class="input" id="z" name="z" type="text" placeholder="Z" value="{{form.z}}">
</p>
</div>
<div class="field tooltip" data-tooltip="Whole numbers only.">
<p class="control">
<input class="input" id="radius" name="radius" type="text" placeholder="Radius" value="{{form.radius}}">
</p>
</div>
<br/>
<h4 class="title is-5 has-text-primary">
Blocks
</h4>
<div class="field tooltip is-tooltip-multiline" data-tooltip="Accepts full names, partial names, or block IDs. Separated by commas.">
<input class="input is-4" id="blocks" name="blocks" type="text" placeholder="Block Names or IDs" value="{{form.blocks}}">
</div>
<br/>
<h4 class="title is-5 has-text-primary">
Date and Time
</h4>
<div class="field tooltip" data-tooltip="Click to open date/time picker.">
<p class="control">
<input type="date" id="date_from" name="date_from" placeholder="Date From" value="{{form.date_from}}">
</p>
</div>
<div class="field tooltip" data-tooltip="Click to open date/time picker.">
<p class="control">
<input type="date" id="date_to" name="date_to" placeholder="Date To" value="{{form.date_to}}">
</p>
</div>
<br/>
<div class="field is-grouped">
<p class="control">
<button class="button is-primary" name="search" value="true" type="submit">Search</button>
</p>
<p class="control">
<button class="button is-dark" id="clear" type="button">Clear</button>
</p>
</div>
</div>
</div>
</form>
<div class="column is-three-fifths">
</div>
</div>
</body>
<script src="{% static 'coreprotect/js/bulma-extensions.min.js' %}"></script>
<script src="{% static 'coreprotect/js/main.js' %}"></script>
<script>
document.getElementById("clear").addEventListener("click", function() {
// Actions
document.getElementById("block_break").checked = false;
document.getElementById("block_place").checked = false;
document.getElementById("chat").checked = false;
document.getElementById("chest_use").checked = false;
document.getElementById("command").checked = false;
document.getElementById("interact").checked = false;
document.getElementById("login_logout").checked = false;
document.getElementById("sign_place").checked = false;
// Worlds
{% for world in form.worlds %}
document.getElementById("{{world.id}}").checked = false;
{% endfor %}
// Options
document.getElementById("ignore_environment").checked = false;
// Limit Results
document.getElementById("limit_results").selectedIndex = "0";
// Players
document.getElementById("players").value = "";
// Coordinates
document.getElementById("x").value = "";
document.getElementById("y").value = "";
document.getElementById("z").value = "";
document.getElementById("radius").value = "";
// Blocks
document.getElementById("blocks").value = "";
// Date and Time
document.getElementById("date_from")._flatpickr.setDate();
document.getElementById("date_to")._flatpickr.setDate();
});
</script>
</html>