Code clean up + datatables (#64)

* Reformat Code

Reformat Code
- spaces + tabs

* Code cleanup

removed duplicated datatables code

* Datatables

replace spells, monsters tables with JavaScript Sortable Tables (DataTables?)
This commit is contained in:
Lee
2018-12-02 05:30:36 +00:00
committed by slawkens
parent e3bcbc4da9
commit 876b1b988a
38 changed files with 2396 additions and 2510 deletions

View File

@@ -1,102 +1,102 @@
<div class="row">
<div class="col-md-6">
<div class="box box-warning">
<div class="box-header with-border">
<h3 class="box-title">Maintenance</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<form action="?p=dashboard&maintenance" method="post" class="form-horizontal">
<div class="box-body">
<div class="form-group">
<label for="status" class="col-sm-2 control-label">Website:</label>
<div class="col-sm-10">
<select class="form-control" id="status" name="status">
<option value="0"{% if not is_closed %} selected{% endif %}>Open</option>
<option value="1"{% if is_closed %} selected{% endif %}>Closed</option>
</select>
</div>
</div>
<div class="form-group">
<label for="message" class="col-sm-2 control-label">Message:<br>
<small>(only if closed)</small>
</label>
<div class="col-sm-10">
<div class="col-md-6">
<div class="box box-warning">
<div class="box-header with-border">
<h3 class="box-title">Maintenance</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<form action="?p=dashboard&maintenance" method="post" class="form-horizontal">
<div class="box-body">
<div class="form-group">
<label for="status" class="col-sm-2 control-label">Website:</label>
<div class="col-sm-10">
<select class="form-control" id="status" name="status">
<option value="0"{% if not is_closed %} selected{% endif %}>Open</option>
<option value="1"{% if is_closed %} selected{% endif %}>Closed</option>
</select>
</div>
</div>
<div class="form-group">
<label for="message" class="col-sm-2 control-label">Message:<br>
<small>(only if closed)</small>
</label>
<div class="col-sm-10">
<textarea name="message" cols="40" class="form-control" rows="5" maxlength="255"
placeholder="Enter ...">{{ closed_message }}</textarea>
</div>
</div>
</div>
<div class="box-footer">
<a href="?p=dashboard&clear_cache" onclick="return confirm('Are you sure?');"><span
class="btn btn-danger">Clear cache</span></a>
<div class="pull-right">
<input type="submit" class="btn btn-primary" value="Update"/>
</div>
</div>
</form>
</div>
</div>
</div>
{% if points is iterable %}
<div class="col-md-3">
<div class="box">
<div class="box-header">
<h3 class="box-title">Top 10 - Most premium points</h3>
</div>
<div class="box-body no-padding">
<table class="table table-condensed">
<tbody>
<tr>
<th>#</th>
<th>Account {{ account_type }}</th>
<th>Premium points</th>
</tr>
{% set i = 0 %}
{% for result in points %}
{% set i = i + 1 %}
<tr>
<td>{{ i }}</td>
<td>{{ result.name }}</td>
<td>{{ result.premium_points }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endif %}
{% if coins is iterable %}
<div class="col-md-3">
<div class="box">
<div class="box-header">
<h3 class="box-title">Top 10 - Most coins</h3>
</div>
<div class="box-body no-padding">
<table class="table table-condensed">
<tbody>
<tr>
<th>#</th>
<th>Account {{ account_type }}</th>
<th>Tibia coins</th>
</tr>
{% set i = 0 %}
{% for result in coins %}
{% set i = i + 1 %}
<tr>
<td>{{ i }}</td>
<td>{{ result.name }}</td>
<td>{{ result.coins }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endif %}
placeholder="Enter ...">{{ closed_message }}</textarea>
</div>
</div>
</div>
<div class="box-footer">
<a href="?p=dashboard&clear_cache" onclick="return confirm('Are you sure?');"><span
class="btn btn-danger">Clear cache</span></a>
<div class="pull-right">
<input type="submit" class="btn btn-primary" value="Update"/>
</div>
</div>
</form>
</div>
</div>
</div>
{% if points is iterable %}
<div class="col-md-3">
<div class="box">
<div class="box-header">
<h3 class="box-title">Top 10 - Most premium points</h3>
</div>
<div class="box-body no-padding">
<table class="table table-condensed">
<tbody>
<tr>
<th>#</th>
<th>Account {{ account_type }}</th>
<th>Premium points</th>
</tr>
{% set i = 0 %}
{% for result in points %}
{% set i = i + 1 %}
<tr>
<td>{{ i }}</td>
<td>{{ result.name }}</td>
<td>{{ result.premium_points }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endif %}
{% if coins is iterable %}
<div class="col-md-3">
<div class="box">
<div class="box-header">
<h3 class="box-title">Top 10 - Most coins</h3>
</div>
<div class="box-body no-padding">
<table class="table table-condensed">
<tbody>
<tr>
<th>#</th>
<th>Account {{ account_type }}</th>
<th>Tibia coins</th>
</tr>
{% set i = 0 %}
{% for result in coins %}
{% set i = i + 1 %}
<tr>
<td>{{ i }}</td>
<td>{{ result.name }}</td>
<td>{{ result.coins }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endif %}
</div>

View File

@@ -1,4 +1,4 @@
<form method="post" action="{{ constant('ADMIN_URL') }}?p=items">
<input type="hidden" name="reload" value="1" />
<input type="submit" value="Reload items and weapons (it may take some time to finish)" />
<input type="hidden" name="reload" value="1"/>
<input type="submit" value="Reload items and weapons (it may take some time to finish)"/>
</form>

View File

@@ -1,38 +1,38 @@
<div class="login-box">
{% if logout %}
<div class="alert alert-success alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<h4><i class="icon fa fa-check"></i> Status</h4>
{{ logout }}
</div>
{% endif %}
{% if logout %}
<div class="alert alert-success alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<h4><i class="icon fa fa-check"></i> Status</h4>
{{ logout }}
</div>
{% endif %}
<form method="post">
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title">Please login.</h3>
</div>
<div class="box-body">
<div class="form-group">
<div class="form-group input-group">
<span class="input-group-addon"><i class="fa fa-lock"></i></span>
<input type="password" class="form-control" id="account-name-input" name="account_login"
placeholder="Account {{ account }}" required autofocus>
</div>
<div class="form-group input-group">
<span class="input-group-addon"><i class="fa fa-key"></i></span>
<input type="password" class="form-control" placeholder="Password" name="password_login"
placeholder="Password" required>
</div>
</div>
</div>
<div class="box-footer">
<label>
<input type="checkbox" id="remember_me" name="remember_me" value="true"> Remember me
</label>
<input type="hidden" name="admin" value="1"/>
<button type="submit" class="btn btn-info pull-right">Sign in</button>
</div>
</div>
</form>
<form method="post">
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title">Please login.</h3>
</div>
<div class="box-body">
<div class="form-group">
<div class="form-group input-group">
<span class="input-group-addon"><i class="fa fa-lock"></i></span>
<input type="password" class="form-control" id="account-name-input" name="account_login"
placeholder="Account {{ account }}" required autofocus>
</div>
<div class="form-group input-group">
<span class="input-group-addon"><i class="fa fa-key"></i></span>
<input type="password" class="form-control" placeholder="Password" name="password_login"
placeholder="Password" required>
</div>
</div>
</div>
<div class="box-footer">
<label>
<input type="checkbox" id="remember_me" name="remember_me" value="true"> Remember me
</label>
<input type="hidden" name="admin" value="1"/>
<button type="submit" class="btn btn-info pull-right">Sign in</button>
</div>
</div>
</form>
</div>

View File

@@ -1,47 +1,47 @@
<script type="text/javascript" src="{{ constant('BASE_URL') }}tools/tinymce/tinymce.min.js"></script>
<script type="text/javascript">
tinymce.init({
selector: "textarea",
theme: "modern",
plugins: 'print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists textcolor wordcount spellchecker imagetools contextmenu colorpicker textpattern help code emoticons',
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | emoticons link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat code',
image_advtab: true,
relative_urls: false,
remove_script_host: false,
document_base_url: "{{ constant('BASE_URL') }}"
});
tinymce.init({
selector: "textarea",
theme: "modern",
plugins: 'print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists textcolor wordcount spellchecker imagetools contextmenu colorpicker textpattern help code emoticons',
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | emoticons link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat code',
image_advtab: true,
relative_urls: false,
remove_script_host: false,
document_base_url: "{{ constant('BASE_URL') }}"
});
</script>
<div class="row">
<div class="col-md-8">
<div class="box box-danger">
<div class="box-header with-border">
<h3 class="box-title">Mailer</h3>
</div>
<form method="post">
<div class="box-body">
<div align="center" class="row"><p class="note note-image" style="width: 80%;">Sending mails may
take some time if there are many users in db.</p></div>
<div class="form-group">
<div class="row">
<div class="col-xs-12 ">
<label for="mail_subject" class="control-label">Subject:</label>
<input class="form-control" type="text" id="mail_subject" name="mail_subject"
value="{{ mail_subject }}" size="30" maxlength="30"/>
</div>
</div>
<div class="col-md-8">
<div class="box box-danger">
<div class="box-header with-border">
<h3 class="box-title">Mailer</h3>
</div>
<form method="post">
<div class="box-body">
<div align="center" class="row"><p class="note note-image" style="width: 80%;">Sending mails may
take some time if there are many users in db.</p></div>
<div class="form-group">
<div class="row">
<div class="col-xs-12 ">
<label for="mail_subject" class="control-label">Subject:</label>
<input class="form-control" type="text" id="mail_subject" name="mail_subject"
value="{{ mail_subject }}" size="30" maxlength="30"/>
</div>
</div>
</div>
<label for="mail_content" class="control-label">Content:</label>
<textarea id="mail_content" name="mail_content" style="width: 100%"
class="tinymce">{{ mail_content }}</textarea>
</div>
<div class="box-footer">
<input type="checkbox" name="preview" id="preview" value="1"/><label for="preview">Just send test
email to me (preview)</label>{% if preview_done %} - <b>Done.</b>{% endif %}<br/>
<button type="submit" name="submit" value="Send" class="btn btn-primary">Send</button>
</div>
</form>
</div>
</div>
</div>
<label for="mail_content" class="control-label">Content:</label>
<textarea id="mail_content" name="mail_content" style="width: 100%"
class="tinymce">{{ mail_content }}</textarea>
</div>
<div class="box-footer">
<input type="checkbox" name="preview" id="preview" value="1"/><label for="preview">Just send test
email to me (preview)</label>{% if preview_done %} - <b>Done.</b>{% endif %}<br/>
<button type="submit" name="submit" value="Send" class="btn btn-primary">Send</button>
</div>
</form>
</div>
</div>
</div>

View File

@@ -1,28 +1,28 @@
<div class="row">
<div class="col-md-6">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">Templates</h3>
</div>
<div class="box-body">
<form method="post" action="?p=menus">
<p>Please choose template in which you want to edit menu items.</p>
<div class="row">
<div class="col-xs-6">
<div class="input-group input-group-sm">
<select id="template" name="template" class="form-control">
{% for template in templates %}
<option value="{{ template.template }}">{{ template.template }}</option>
{% endfor %}
</select>
<span class="input-group-btn">
<div class="col-md-6">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">Templates</h3>
</div>
<div class="box-body">
<form method="post" action="?p=menus">
<p>Please choose template in which you want to edit menu items.</p>
<div class="row">
<div class="col-xs-6">
<div class="input-group input-group-sm">
<select id="template" name="template" class="form-control">
{% for template in templates %}
<option value="{{ template.template }}">{{ template.template }}</option>
{% endfor %}
</select>
<span class="input-group-btn">
<button type="submit" type="button" class="btn btn-primary btn-flat">Edit</button>
</span>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>

View File

@@ -5,59 +5,66 @@
{% for cat, menu in menus %}
last_id[{{ cat }}] = {{ last_id[cat] }};
{% endfor %}
$( function() {
$(function () {
$(".sortable").sortable();
$(".sortable").disableSelection();
$(".remove-button").click(function() {
$(".remove-button").click(function () {
var id = $(this).attr("id");
$('#list-' + id.replace('remove-button-', '')).remove();
});
$(".add-button").click(function() {
$(".add-button").click(function () {
var cat = $(this).attr("id").replace('add-button-', '');
var id = last_id[cat];
last_id[cat]++;
$('#sortable-' + cat).append('<li class="ui-state-default" id="list-' + cat + '-' + id + '"><input type="text" name="menu[' + cat + '][]" value=""/> <input type="text" name="menu_link[' + cat + '][]" value=""/><input type="hidden" name="menu_blank[' + cat + '][]" value="0" /> <label><input class="blank-checkbox" type="checkbox"/><span title="Open in New Window">Blank</span></label> <input class="color-picker" type="text" name="menu_color[' + cat + '][]" value="#ffffff" /><a class="remove-button" id="remove-button-' + cat + '-' + id + '"><img src="{{ constant('BASE_URL') }}images/del.png"/></a></li>'); //add input bo
$('#remove-button-' + cat + '-' + id).click(function() {
$('#remove-button-' + cat + '-' + id).click(function () {
$('#list-' + $(this).attr("id").replace('remove-button-', '')).remove();
});
initialiceSpectrum();
});
$("#menus-form").submit(function(e) {
$('.blank-checkbox:not(:checked)').each(function(i, obj) {
$("#menus-form").submit(function (e) {
$('.blank-checkbox:not(:checked)').each(function (i, obj) {
$(obj).parent().prev().val("off");
});
$('.blank-checkbox:checked').each(function(i, obj) {
$('.blank-checkbox:checked').each(function (i, obj) {
$(obj).parent().prev().val("on");
});
});
});
</script>
<style type="text/css">
.sortable { list-style-type: none; margin: 0; padding: 0; width: 100%; }
.sortable {
list-style-type: none;
margin: 0;
padding: 0;
width: 100%;
}
.remove-button, .add-button {
cursor: pointer;
}
</style>
<script type="text/javascript" src="{{ constant('BASE_URL') }}tools/js/spectrum.js"></script>
<link type="text/css" rel="stylesheet" href="{{ constant('BASE_URL') }}tools/css/spectrum.css" />
<link type="text/css" rel="stylesheet" href="{{ constant('BASE_URL') }}tools/css/spectrum.css"/>
<script type="text/javascript">
initialiceSpectrum();
function initialiceSpectrum() {
$(".color-picker").spectrum({
preferredFormat: "hex",
showInput: true,
showPalette: true,
palette: [
['black', 'white', 'blanchedalmond',
'rgb(255, 128, 0);', 'hsv 100 70 50'],
['red', 'yellow', 'green', 'blue', 'violet']
]
});
}
initialiceSpectrum();
function initialiceSpectrum() {
$(".color-picker").spectrum({
preferredFormat: "hex",
showInput: true,
showPalette: true,
palette: [
['black', 'white', 'blanchedalmond',
'rgb(255, 128, 0);', 'hsv 100 70 50'],
['red', 'yellow', 'green', 'blue', 'violet']
]
});
}
</script>

View File

@@ -1,24 +1,24 @@
<div class="row">
<div class="col-md-6">
<div class="box box-danger">
<div class="box-header with-border">
<h3 class="box-title">Notepad</h3>
</div>
<form method="post">
<div class="box-body">
<div class="form-group">
<label>This is your personal notepad. Be sure to save it each time you modify something.</label>
<textarea class="form-control" style="text-align: left;" name="content" cols="50" rows="15"
onchange="notepad_onchange(this);">{% if content is not null %}{{ content }}{% endif %}</textarea>
</div>
</div>
<div class="box-footer">
<button name="submit" onclick="notepad_save(this);" value="Save" class="btn btn-primary">Save
</button>
</div>
</form>
</div>
</div>
<div class="col-md-6">
<div class="box box-danger">
<div class="box-header with-border">
<h3 class="box-title">Notepad</h3>
</div>
<form method="post">
<div class="box-body">
<div class="form-group">
<label>This is your personal notepad. Be sure to save it each time you modify something.</label>
<textarea class="form-control" style="text-align: left;" name="content" cols="50" rows="15"
onchange="notepad_onchange(this);">{% if content is not null %}{{ content }}{% endif %}</textarea>
</div>
</div>
<div class="box-footer">
<button name="submit" onclick="notepad_save(this);" value="Save" class="btn btn-primary">Save
</button>
</div>
</form>
</div>
</div>
</div>
{# <?php echo isset($_content) ? htmlentities($_content, ENT_COMPAT, 'UTF-8') : ''; ?> #}
@@ -26,31 +26,31 @@
{# confirm leaving current page if content of the notepad has been modified #}
<script type="text/javascript">
var original_value = document.getElementsByName("content")[0].value;
var original_value = document.getElementsByName("content")[0].value;
function confirm_exit(e) {
var e = e || window.event;
var message = 'Are you sure you want to quit? Remaining changes will be unsaved.';
function confirm_exit(e) {
var e = e || window.event;
var message = 'Are you sure you want to quit? Remaining changes will be unsaved.';
// for IE and Firefox prior to version 4
if (e) {
e.returnValue = message;
}
// for IE and Firefox prior to version 4
if (e) {
e.returnValue = message;
}
// for Safari
return message;
}
// for Safari
return message;
}
function notepad_onchange(e) {
if (original_value != e.value) {
window.onbeforeunload = confirm_exit;
}
return true;
}
function notepad_onchange(e) {
if (original_value != e.value) {
window.onbeforeunload = confirm_exit;
}
return true;
}
function notepad_save(e) {
window.onbeforeunload = function (e) {
};
return true;
}
function notepad_save(e) {
window.onbeforeunload = function (e) {
};
return true;
}
</script>

View File

@@ -1,111 +1,111 @@
{% if action %}
<div class="row">
<form class="form-horizontal" method="post"
action="?p=pages&action={% if action == 'edit' %}edit{% else %}add{% endif %}">
{% if action == 'edit' %}
<input type="hidden" name="id" value="{{ id }}"/>
{% endif %}
<div class="col-md-8" id="page-edit-table">
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title">{% if action == 'edit' %}Edit{% else %}Add{% endif %} page</h3>
</div>
<div class="box-body">
<div class="form-group">
<label for="name" class="col-sm-2 control-label">Link/name</label>
<div class="col-sm-10">
<input type="text" id="name" name="name" class="form-control" autocomplete="off"
maxlength="29"
style="cursor: auto;" value="{{ name }}">
</div>
</div>
<div class="form-group">
<label for="title" class="col-sm-2 control-label">Title</label>
<div class="row">
<form class="form-horizontal" method="post"
action="?p=pages&action={% if action == 'edit' %}edit{% else %}add{% endif %}">
{% if action == 'edit' %}
<input type="hidden" name="id" value="{{ id }}"/>
{% endif %}
<div class="col-md-8" id="page-edit-table">
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title">{% if action == 'edit' %}Edit{% else %}Add{% endif %} page</h3>
</div>
<div class="box-body">
<div class="form-group">
<label for="name" class="col-sm-2 control-label">Link/name</label>
<div class="col-sm-10">
<input type="text" id="name" name="name" class="form-control" autocomplete="off"
maxlength="29"
style="cursor: auto;" value="{{ name }}">
</div>
</div>
<div class="form-group">
<label for="title" class="col-sm-2 control-label">Title</label>
<div class="col-sm-10">
<input type="text" id="title" name="title" class="form-control" autocomplete="off"
maxlength="29"
style="cursor: auto;" value="{{ title }}">
</div>
</div>
<div class="form-group">
<label for="php" class="col-sm-2 control-label">PHP</label>
<div class="col-sm-10">
<input type="checkbox" id="php" name="php"
title="Check if page should be executed as PHP"
value="1"{% if php %} checked="true"{% endif %}{% if action == 'edit' %} disabled{% endif %}/>
{% if action == 'edit' %}
<input type="hidden" name="php" value="{% if php %}1{% else %}0{% endif %}"/>
{% endif %}
</div>
</div>
<div class="form-group">
<label for="body" class="col-sm-2 control-label">Content</label>
<div class="col-sm-10" id="body-parent">
<div class="col-sm-10">
<input type="text" id="title" name="title" class="form-control" autocomplete="off"
maxlength="29"
style="cursor: auto;" value="{{ title }}">
</div>
</div>
<div class="form-group">
<label for="php" class="col-sm-2 control-label">PHP</label>
<div class="col-sm-10">
<input type="checkbox" id="php" name="php"
title="Check if page should be executed as PHP"
value="1"{% if php %} checked="true"{% endif %}{% if action == 'edit' %} disabled{% endif %}/>
{% if action == 'edit' %}
<input type="hidden" name="php" value="{% if php %}1{% else %}0{% endif %}"/>
{% endif %}
</div>
</div>
<div class="form-group">
<label for="body" class="col-sm-2 control-label">Content</label>
<div class="col-sm-10" id="body-parent">
<textarea class="form-control" id="body" name="body" maxlength="65000" cols="50"
rows="5">{{ body|raw }}</textarea>
</div>
</div>
<div class="form-group">
<label for="access" class="col-sm-2 control-label">Access</label>
<div class="col-sm-10">
<select class="form-control" id="access" name="access">
{% for id, group in groups %}
<option value="{{ group.getId() }}"{% if access == group.getId() %} selected{% endif %}>{{ group.getName() }}</option>
{% endfor %}
</select>
</div>
</div>
</div>
<div class="box-footer">
<td align="right"><input type="submit" class="btn btn-info pull-right" value="Save"/></td>
<td align="left">
<input type="button" onclick="window.location = '{{ constant('ADMIN_URL') }}?p=pages';"
class="btn btn-default" value="Cancel"/>
</td>
</div>
</div>
</div>
</form>
</div>
rows="5">{{ body|raw }}</textarea>
</div>
</div>
<div class="form-group">
<label for="access" class="col-sm-2 control-label">Access</label>
<div class="col-sm-10">
<select class="form-control" id="access" name="access">
{% for id, group in groups %}
<option value="{{ group.getId() }}"{% if access == group.getId() %} selected{% endif %}>{{ group.getName() }}</option>
{% endfor %}
</select>
</div>
</div>
</div>
<div class="box-footer">
<td align="right"><input type="submit" class="btn btn-info pull-right" value="Save"/></td>
<td align="left">
<input type="button" onclick="window.location = '{{ constant('ADMIN_URL') }}?p=pages';"
class="btn btn-default" value="Cancel"/>
</td>
</div>
</div>
</div>
</form>
</div>
<script type="text/javascript" src="{{ constant('BASE_URL') }}tools/tinymce/tinymce.min.js"></script>
<script type="text/javascript">
$(function () {
$('#php').on('change', function (e) {
if (this.checked) {
tinymce.remove('#body');
} else {
if (tinymce.editors.length > 0) {
tinymce.activeEditor.show();
}
else {
init_tinymce();
}
}
});
<script type="text/javascript" src="{{ constant('BASE_URL') }}tools/tinymce/tinymce.min.js"></script>
<script type="text/javascript">
$(function () {
$('#php').on('change', function (e) {
if (this.checked) {
tinymce.remove('#body');
} else {
if (tinymce.editors.length > 0) {
tinymce.activeEditor.show();
}
else {
init_tinymce();
}
}
});
{% if not php %}
init_tinymce();
{% endif %}
{% if not php %}
init_tinymce();
{% endif %}
function init_tinymce() {
tinymce.init({
selector: "#body",
theme: "modern",
plugins: 'code print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists textcolor wordcount spellchecker imagetools contextmenu colorpicker textpattern help emoticons',
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | emoticons link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat code',
image_advtab: true,
relative_urls: false,
remove_script_host: false,
document_base_url: "{{ constant('BASE_URL') }}"
});
}
function init_tinymce() {
tinymce.init({
selector: "#body",
theme: "modern",
plugins: 'code print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists textcolor wordcount spellchecker imagetools contextmenu colorpicker textpattern help emoticons',
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | emoticons link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat code',
image_advtab: true,
relative_urls: false,
remove_script_host: false,
document_base_url: "{{ constant('BASE_URL') }}"
});
}
function decodeHtml(html) {
var txt = document.createElement("textarea");
txt.innerHTML = html;
return txt.value;
}
});
</script> {% endif %}
function decodeHtml(html) {
var txt = document.createElement("textarea");
txt.innerHTML = html;
return txt.value;
}
});
</script> {% endif %}

View File

@@ -1,66 +1,69 @@
<div class="box">
<div class="box-header">
<h3 class="box-title">Pages:</h3>
<div class="box-tools pull-right">
<a href="?p=pages&action=new"><span class="btn btn-success">New</span></a>
</div>
</div>
<div class="box-body">
<div id="tb_pages_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
<div class="row">
<div class="col-sm-12">
<table id="tb_pages" class="table table-bordered table-striped dataTable" role="grid"
aria-describedby="tb_pages_info">
<thead>
<tr role="row">
<th class="sorting_asc" tabindex="0" aria-controls="tb_pages" rowspan="1" colspan="1"
aria-sort="ascending" aria-label="Name: activate to sort column descending">Name
</th>
<th class="sorting" tabindex="0" aria-controls="tb_pages" rowspan="1" colspan="1"
aria-sort="ascending" aria-label="Title: activate to sort column descending">Title
</th>
<th class="" tabindex="0" aria-controls="tb_pages" rowspan="1" colspan="1" style="width: 150px;">Options
</th>
</tr>
</thead>
<tbody>
{% for page in pages %}
<tr>
<td>{{ page.link|raw }}</td>
<td><i>{{ page.title }}</i></td>
<td>
<a href="?p=pages&action=edit&id={{ page.id }}" class="ico" title="Edit"><span
class="btn btn-success btn-sm edit btn-flat"><i class="fa fa-edit"></i></span></a>
<a href="?p=pages&action=delete&id={{ page.id }}" class="ico"
onclick="return confirm('Are you sure?');" title="Delete"><span
class="btn btn-danger btn-sm delete btn-flat"><i
class="fa fa-trash"></i></span></a>
<a href="?p=pages&action=hide&id={{ page.id }}" class="ico"
title="{% if page.hidden != 1 %}Hide{% else %}Show{% endif %}">
{% if page.hidden != 1 %}
<span class="btn btn-primary btn-sm btn-flat"><i class="fa fa-eye"></i></span>
{% else %}
<span class="btn btn-default btn-sm btn-flat"><i class="fa fa-eye-slash"></i></span>
{% endif %}
</a>
</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<th>Name</th>
<th>Title</th>
<th>Options</th>
</tfoot>
</table>
</div>
</div>
</div>
</div>
<div class="box-header">
<h3 class="box-title">Pages:</h3>
<div class="box-tools pull-right">
<a href="?p=pages&action=new"><span class="btn btn-success">New</span></a>
</div>
</div>
<div class="box-body">
<div id="tb_pages_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
<div class="row">
<div class="col-sm-12">
<table id="tb_pages" class="table table-bordered table-striped dataTable" role="grid"
aria-describedby="tb_pages_info">
<thead>
<tr role="row">
<th class="sorting_asc" tabindex="0" aria-controls="tb_pages" rowspan="1" colspan="1"
aria-sort="ascending" aria-label="Name: activate to sort column descending">Name
</th>
<th class="sorting" tabindex="0" aria-controls="tb_pages" rowspan="1" colspan="1"
aria-sort="ascending" aria-label="Title: activate to sort column descending">Title
</th>
<th class="" tabindex="0" aria-controls="tb_pages" rowspan="1" colspan="1"
style="width: 150px;">Options
</th>
</tr>
</thead>
<tbody>
{% for page in pages %}
<tr>
<td>{{ page.link|raw }}</td>
<td><i>{{ page.title }}</i></td>
<td>
<a href="?p=pages&action=edit&id={{ page.id }}" class="ico" title="Edit"><span
class="btn btn-success btn-sm edit btn-flat"><i class="fa fa-edit"></i></span></a>
<a href="?p=pages&action=delete&id={{ page.id }}" class="ico"
onclick="return confirm('Are you sure?');" title="Delete"><span
class="btn btn-danger btn-sm delete btn-flat"><i
class="fa fa-trash"></i></span></a>
<a href="?p=pages&action=hide&id={{ page.id }}" class="ico"
title="{% if page.hidden != 1 %}Hide{% else %}Show{% endif %}">
{% if page.hidden != 1 %}
<span class="btn btn-primary btn-sm btn-flat"><i
class="fa fa-eye"></i></span>
{% else %}
<span class="btn btn-default btn-sm btn-flat"><i
class="fa fa-eye-slash"></i></span>
{% endif %}
</a>
</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<th>Name</th>
<th>Title</th>
<th>Options</th>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
<script>
$(function () {
$('#tb_pages').DataTable()
})
$(function () {
$('#tb_pages').DataTable()
})
</script>

View File

@@ -2,10 +2,12 @@
<a href="admin/?p=pages&action=edit&id={{ page.id }}" title="Edit in Admin Panel" target="_blank">
<img src="images/edit.png"/>Edit
</a>
<a id="delete" href="admin/?p=pages&action=delete&id={{ page.id }}" onclick="return confirm('Are you sure?');" title="Delete in Admin Panel" target="_blank">
<a id="delete" href="admin/?p=pages&action=delete&id={{ page.id }}" onclick="return confirm('Are you sure?');"
title="Delete in Admin Panel" target="_blank">
<img src="images/del.png"/>Delete
</a>
<a href="admin/?p=pages&action=hide&id={{ page.id }}" title="{% if page.hidden != 1 %}Hide{% else %}Show{% endif %} in Admin Panel" target="_blank">
<a href="admin/?p=pages&action=hide&id={{ page.id }}"
title="{% if page.hidden != 1 %}Hide{% else %}Show{% endif %} in Admin Panel" target="_blank">
<img src="images/{% if page.hidden != 1 %}success{% else %}error{% endif %}.png"/>{% if page.hidden != 1 %}Hide{% else %}Show{% endif %}
</a>
<br/>

View File

@@ -1,27 +1,27 @@
<div class="row">
<div class="col-md-3">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">Install plugin:</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<form enctype="multipart/form-data" method="post" action="{{ constant('ADMIN_URL') }}?p=plugins">
<input type="hidden" name="upload_plugin"/>
<div class="box-body">
<div class="form-group">
<label for="exampleInputFile">File input</label>
<input type="file" name="plugin">
</div>
</div>
<div class="box-footer">
<button type="submit" class="btn btn-primary">Upload</button>
</div>
</form>
</div>
</div>
</div>
<div class="col-md-3">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">Install plugin:</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<form enctype="multipart/form-data" method="post" action="{{ constant('ADMIN_URL') }}?p=plugins">
<input type="hidden" name="upload_plugin"/>
<div class="box-body">
<div class="form-group">
<label for="exampleInputFile">File input</label>
<input type="file" name="plugin">
</div>
</div>
<div class="box-footer">
<button type="submit" class="btn btn-primary">Upload</button>
</div>
</form>
</div>
</div>
</div>
</div>

View File

@@ -1,67 +1,67 @@
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title">Installed plugins:</h3>
</div>
<div class="box-body">
<div id="plugins_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
<div class="row">
<div class="col-sm-12">
<table id="plugins" class="table table-bordered table-striped dataTable" role="grid"
aria-describedby="plugins_info">
<thead>
<tr role="row">
<th class="sorting_asc" tabindex="0" aria-controls="plugins" rowspan="1"
colspan="1" aria-sort="ascending"
aria-label="Name: activate to sort column descending">Name
</th>
<th class="sorting" tabindex="0" aria-controls="plugins" rowspan="1" colspan="1"
aria-label="Description: activate to sort column ascending">Description
</th>
<th class="sorting" tabindex="0" aria-controls="plugins" rowspan="1" colspan="1"
aria-label="Author: activate to sort column ascending">Author
</th>
<th class="sorting" tabindex="0" aria-controls="plugins" rowspan="1" colspan="1"
aria-label="Filename: activate to sort column ascending">Filename
</th>
<th class="sorting" tabindex="0" aria-controls="plugins" rowspan="1" colspan="1"
aria-label="Options: activate to sort column ascending"
style="width: 55px;">Options
</th>
</tr>
</thead>
<tbody>
{% for plugin in plugins %}
<tr>
<td><b>{{ plugin.name }}</b><br>
<small>{{ plugin.description }}</small>
</td>
<td>{{ plugin.version }}</td>
<td><b>{{ plugin.author }}</b><br>
<small>{{ plugin.contact }}</small>
</td>
<td>{{ plugin.file }}.json</td>
<td>
{% if plugin.uninstall %}
<a href="?p=plugins&uninstall={{ plugin.file }}" title="Uninstall"
onclick="return confirm('Are you sure?');"><span
class="btn btn-danger btn-sm delete btn-flat"><i
class="fa fa-trash"></i></span></a>
{% endif %}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title">Installed plugins:</h3>
</div>
<div class="box-body">
<div id="plugins_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
<div class="row">
<div class="col-sm-12">
<table id="plugins" class="table table-bordered table-striped dataTable" role="grid"
aria-describedby="plugins_info">
<thead>
<tr role="row">
<th class="sorting_asc" tabindex="0" aria-controls="plugins" rowspan="1"
colspan="1" aria-sort="ascending"
aria-label="Name: activate to sort column descending">Name
</th>
<th class="sorting" tabindex="0" aria-controls="plugins" rowspan="1" colspan="1"
aria-label="Description: activate to sort column ascending">Description
</th>
<th class="sorting" tabindex="0" aria-controls="plugins" rowspan="1" colspan="1"
aria-label="Author: activate to sort column ascending">Author
</th>
<th class="sorting" tabindex="0" aria-controls="plugins" rowspan="1" colspan="1"
aria-label="Filename: activate to sort column ascending">Filename
</th>
<th class="sorting" tabindex="0" aria-controls="plugins" rowspan="1" colspan="1"
aria-label="Options: activate to sort column ascending"
style="width: 55px;">Options
</th>
</tr>
</thead>
<tbody>
{% for plugin in plugins %}
<tr>
<td><b>{{ plugin.name }}</b><br>
<small>{{ plugin.description }}</small>
</td>
<td>{{ plugin.version }}</td>
<td><b>{{ plugin.author }}</b><br>
<small>{{ plugin.contact }}</small>
</td>
<td>{{ plugin.file }}.json</td>
<td>
{% if plugin.uninstall %}
<a href="?p=plugins&uninstall={{ plugin.file }}" title="Uninstall"
onclick="return confirm('Are you sure?');"><span
class="btn btn-danger btn-sm delete btn-flat"><i
class="fa fa-trash"></i></span></a>
{% endif %}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(function () {
$('#plugins').DataTable()
})
$(function () {
$('#plugins').DataTable()
})
</script>

View File

@@ -1,39 +1,39 @@
<div class="row">
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="info-box">
<span class="info-box-icon bg-aqua"><i class="ion ion-person-add"></i></span>
<div class="info-box-content">
<span class="info-box-text">Total accounts:</span>
<span class="info-box-number">{{ total_accounts }}</span>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="info-box">
<span class="info-box-icon bg-red"><i class="fa fa-male"></i></span>
<div class="info-box-content">
<span class="info-box-text">Total players:</span>
<span class="info-box-number">{{ total_players }}</span>
</div>
</div>
</div>
<div class="clearfix visible-sm-block"></div>
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="info-box">
<span class="info-box-icon bg-green"><i class="ion ion-pie-graph"></i></span>
<div class="info-box-content">
<span class="info-box-text">Total guilds:</span>
<span class="info-box-number">{{ total_guilds }}</span>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="info-box">
<span class="info-box-icon bg-yellow"><i class="fa fa-home"></i></span>
<div class="info-box-content">
<span class="info-box-text">Total houses:</span>
<span class="info-box-number">{{ total_houses }}</span>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="info-box">
<span class="info-box-icon bg-aqua"><i class="ion ion-person-add"></i></span>
<div class="info-box-content">
<span class="info-box-text">Total accounts:</span>
<span class="info-box-number">{{ total_accounts }}</span>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="info-box">
<span class="info-box-icon bg-red"><i class="fa fa-male"></i></span>
<div class="info-box-content">
<span class="info-box-text">Total players:</span>
<span class="info-box-number">{{ total_players }}</span>
</div>
</div>
</div>
<div class="clearfix visible-sm-block"></div>
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="info-box">
<span class="info-box-icon bg-green"><i class="ion ion-pie-graph"></i></span>
<div class="info-box-content">
<span class="info-box-text">Total guilds:</span>
<span class="info-box-number">{{ total_guilds }}</span>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="info-box">
<span class="info-box-icon bg-yellow"><i class="fa fa-home"></i></span>
<div class="info-box-content">
<span class="info-box-text">Total houses:</span>
<span class="info-box-number">{{ total_houses }}</span>
</div>
</div>
</div>
</div>

View File

@@ -1,56 +1,56 @@
<div class="box">
<div class="box-header">
<h3 class="box-title">Users active within last {{ config_visitors_counter_ttl }} minutes.</h3>
</div>
<div class="box-body">
<div id="visitors_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
<div class="row">
<div class="col-sm-12">
<table id="visitors" class="table table-bordered table-striped dataTable" role="grid"
aria-describedby="visitors_info">
<thead>
<tr role="row">
<th class="sorting_asc" tabindex="0" aria-controls="visitors" rowspan="1" colspan="1"
aria-sort="ascending" aria-label="IP: activate to sort column descending"
style="width: 297px;">IP
</th>
<th class="sorting" tabindex="0" aria-controls="visitors" rowspan="1" colspan="1"
aria-label="Last visit: activate to sort column ascending" style="width: 361px;">Last
visit
</th>
<th class="sorting" tabindex="0" aria-controls="visitors" rowspan="1" colspan="1"
aria-label="Page: activate to sort column ascending" style="width: 322px;">Page
</th>
</tr>
</thead>
<tbody>
{% set i = 0 %}
{% for visitor in visitors %}
{% set i = i + 1 %}
<tr role="row" class="odd">
<td>{{ visitor.ip }}</td>
<td>{{ visitor.lastvisit|date("H:i:s") }}</td>
<td>
<a href="{{ visitor.page }}">{{ visitor.page|slice(0, 50) }}</a>
</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<th>IP</th>
<th>Last visit</th>
<th>Page</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
<div class="box-header">
<h3 class="box-title">Users active within last {{ config_visitors_counter_ttl }} minutes.</h3>
</div>
<div class="box-body">
<div id="visitors_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
<div class="row">
<div class="col-sm-12">
<table id="visitors" class="table table-bordered table-striped dataTable" role="grid"
aria-describedby="visitors_info">
<thead>
<tr role="row">
<th class="sorting_asc" tabindex="0" aria-controls="visitors" rowspan="1" colspan="1"
aria-sort="ascending" aria-label="IP: activate to sort column descending"
style="width: 297px;">IP
</th>
<th class="sorting" tabindex="0" aria-controls="visitors" rowspan="1" colspan="1"
aria-label="Last visit: activate to sort column ascending" style="width: 361px;">Last
visit
</th>
<th class="sorting" tabindex="0" aria-controls="visitors" rowspan="1" colspan="1"
aria-label="Page: activate to sort column ascending" style="width: 322px;">Page
</th>
</tr>
</thead>
<tbody>
{% set i = 0 %}
{% for visitor in visitors %}
{% set i = i + 1 %}
<tr role="row" class="odd">
<td>{{ visitor.ip }}</td>
<td>{{ visitor.lastvisit|date("H:i:s") }}</td>
<td>
<a href="{{ visitor.page }}">{{ visitor.page|slice(0, 50) }}</a>
</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<th>IP</th>
<th>Last visit</th>
<th>Page</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
<script>
$(function () {
$('#visitors').DataTable()
})
$(function () {
$('#visitors').DataTable()
})
</script>

View File

@@ -1,3 +1,4 @@
{% if canEdit %}
<form method="post" action="{{ getLink('spells') }}">
<input type="hidden" name="reload_spells" value="yes"/>
@@ -20,7 +21,6 @@
<option value="{{ id }}"{% if id == post_vocation_id and post_vocation_id != "all" and post_vocation_id != '' %} selected{% endif %}>{{ vocation }}</option>
{% endfor %}
</select>
<input type="hidden" name="order" value="{{ post_order }}">
</td>
<td>
{{ include('buttons.submit.html.twig') }}
@@ -32,40 +32,14 @@
</table>
</form>
<br/>
<table border="0" cellspacing="1" cellpadding="4" width="100%">
<tr bgcolor="{{ config.vdarkborder }}">
<td class="white">
<b><a href="{{ getLink('spells') ~ '/' ~ post_vocation|urlencode ~ '/spell' }}"><span class="white">Name</span></a></b>
</td>
<td class="white">
<b><a href="{{ getLink('spells') ~ '/' ~ post_vocation|urlencode ~ '/words' }}"><span class="white">Words</span></a></b>
</td>
<td class="white">
<b><a href="{{ getLink('spells') ~ '/' ~ post_vocation|urlencode ~ '/type' }}"><span class="white">Type<br/>(count)</span></a></b>
</td>
<td class="white">
<b><a href="{{ getLink('spells') ~ '/' ~ post_vocation|urlencode ~ '/mana' }}"><span class="white">Mana</span></a></b>
</td>
<td class="white">
<b><a href="{{ getLink('spells') ~ '/' ~ post_vocation|urlencode ~ '/level' }}"><span class="white">Level</span></a></b>
</td>
<td class="white">
<b><a href="{{ getLink('spells') ~ '/' ~ post_vocation|urlencode ~ '/maglevel' }}"><span class="white">Magic<br/>Level</span></a></b>
</td>
<td class="white">
<b><a href="{{ getLink('spells') ~ '/' ~ post_vocation|urlencode ~ '/soul' }}"><span class="white">Soul</span></a></b>
</td>
<td class="white">
<b>Premium</b>
</td>
<td class="white">
<b>Vocations:</b>
</td>
</tr>
<table id="spellstb" class=""><thead>
<tr role="row"><th>Name</th><th>Words</th><th>Type<br/>(count)</th>
<th>Mana</th><th>Level</th><th>Magic Level</th><th>Soul</th><th>Premium</th><th>Vocations</th></tr>
</thead><tbody>
{% set i = 0 %}
{% for spell in spells %}
{% set i = i + 1 %}
<tr bgcolor="{{ getStyle(i) }}">
<tr>
<td>{{ spell.name }}</td>
<td>{{ spell.words }}</td>
<td>
@@ -93,4 +67,4 @@
</td>
</tr>
{% endfor %}
</table>
</tbody></table>