Admin Panel Updates

- Updated Admin Panel to Bootstrap 4.
- Code cleanup
- Rewrote menu generation code
- Added top 10 coins, top 10 premium points, last 10 logins to modules page.
- Added full account list to Account editor
- Added load outfits from XML to player editor and lists all enabled outfits in editor (will default to textbox if array of outfits do not exist)
- Added tabs to account editor - account, characters,store history, bans(this is based off the bans.php page so will not work on TFS 0.2/1.0)
- Updated datepickers to display the actual date rather than unix time.
- Added last 10 posts to player editor
This commit is contained in:
Lee
2020-03-31 02:03:16 +01:00
parent 92c0671da2
commit eaa11c68f3
88 changed files with 11220 additions and 8080 deletions

View File

@@ -1,83 +1,65 @@
{% if action %}
<div class="row">
{% if (action == 'edit' or action == 'new') %}
<div class="card card-info card-outline">
<div class="card-header">
<h5 class="m-0">{% if action == 'edit' %}Edit{% else %}Add{% endif %} page</h5>
</div>
<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{% endif %}{% if action == 'edit' %} disabled{% endif %}/>
{% if action == 'edit' %}
<input type="hidden" name="php" value="{% if php %}1{% else %}0{% endif %}"/>
{% endif %}
</div>
</div>
{% if not php %}
<div class="form-group">
<label for="enable_tinymce" class="col-sm-2 control-label">Enable TinyMCE</label>
<div class="col-sm-10">
<input type="checkbox" id="enable_tinymce" name="enable_tinymce"
title="Check if you want to use TinyMCE Editor"
value="1"{% if enable_tinymce %} checked{% endif %}{% if action == 'edit' %} disabled{% endif %}/>
{% if action == 'edit' %}
<input type="hidden" name="enable_tinymce" value="{% if enable_tinymce %}1{% else %}0{% endif %}"/>
{% endif %}
</div>
</div>
{% endif %}
<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 class="card-body">
<div class="form-group row">
<label for="title">Page Title</label>
<input type="text" id="title" name="title" class="form-control" autocomplete="off"
maxlength="29"
style="cursor: auto;" value="{{ title }}">
</div>
<div class="form-group row">
<label for="name">Link/name</label>
<input type="text" id="name" name="name" class="form-control" autocomplete="off"
maxlength="29"
style="cursor: auto;" value="{{ name }}">
</div>
<div class="form-group row">
<label for="access">Access</label>
<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 class="form-group row">
<label for="php">PHP
<input type="checkbox" id="php" name="php"
title="Check if page should be executed as PHP"
value="1"{% if php %} checked{% endif %}{% if action == 'edit' %} disabled{% endif %}/>
{% if action == 'edit' %}
<input type="hidden" name="php" value="{% if php %}1{% else %}0{% endif %}"/>
{% endif %}</label>
</div>
{% if not php %}
<div class="form-group row">
<label for="enable_tinymce">Enable TinyMCE
<input type="checkbox" id="enable_tinymce" name="enable_tinymce"
title="Check if you want to use TinyMCE Editor"
value="1"{% if enable_tinymce %} checked{% endif %}{% if action == 'edit' %} disabled{% endif %}/>
{% if action == 'edit' %}
<input type="hidden" name="enable_tinymce" value="{% if enable_tinymce %}1{% else %}0{% endif %}"/>
{% endif %}
</label>
</div>
{% endif %}
<div class="form-group row">
<label for="body">Content</label>
<textarea class="form-control" id="body" name="body" maxlength="65000" cols="50"
rows="10">{{ body|raw }}</textarea>
</div>
</div>
<div class="card-footer">
<button type="submit" class="btn btn-info"><i class="fas fa-update"></i> Update</button>
<button type="button" onclick="window.location = '{{ constant('ADMIN_URL') }}?p=pages';" class="btn btn-danger float-right"><i class="fas fa-cancel"></i> Cancel</button>
</div>
</form>
</div>
@@ -91,8 +73,7 @@
} else {
if (tinymce.editors.length > 0) {
tinymce.activeEditor.show();
}
else {
} else {
init_tinymce();
}
}