mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-14 09:44:55 +02:00
AdminPanel updates - changelog
-Admin menu updates -Moved getchangelogtype/where to functions file and added to twig -Added changelog editor to admin panel and updated changelog page -Renamed the changelog md reader to clmd and edited the version file.
This commit is contained in:
59
system/templates/admin.changelog.form.html.twig
Normal file
59
system/templates/admin.changelog.form.html.twig
Normal file
@@ -0,0 +1,59 @@
|
||||
{% if action %}
|
||||
<div class="card card-info card-outline">
|
||||
<div class="card-header">
|
||||
<h5 class="m-0">{{ (action == 'edit') ? 'Edit' : 'Add' }}</h5>
|
||||
</div>
|
||||
<form role="form" method="post" action="{{ cl_link_form }}" id="cl-edit-form">
|
||||
<div class="card-body">
|
||||
{% if action == 'edit' %}
|
||||
<input type="hidden" name="id" value="{{ cl_id }}"/>
|
||||
{% endif %}
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="body">Content</label>
|
||||
<textarea class="form-control" id="body" name="body" maxlength="600" cols="50" rows="5">{{ body|raw }}</textarea>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-12 col-sm-12 col-lg-6">
|
||||
<label for="createdate" class="control-label">Date:</label>
|
||||
<input type="text" class="form-control" id="createdate" name="createdate" autocomplete="off" maxlength="20" value="{{ create_date|date("M d Y, H:i:s") }}"/>
|
||||
</div>
|
||||
<div class="col-sm-6 pl-0">
|
||||
<label for="player_id">Author</label>
|
||||
<select class="form-control" name="player_id" id="player_id">
|
||||
{% for player in account_players %}
|
||||
<option value="{{ player.getId() }}"{% if player_id is defined and player.getId() == player_id %} selected="selected"{% endif %}>{{ player.getName() }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-6 pl-0">
|
||||
<label for="select-where">Where</label>
|
||||
<select class="form-control" name="where" id="select-where">
|
||||
{% for id, cat in log_where %}
|
||||
<option value="{{ cat.id }}"
|
||||
{% if (where == 0 and id == 1) or (where == cat.id) %}selected="selected"{% endif %}>{{ cat.icon|capitalize }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-6 pl-0">
|
||||
<label for="select-type">Type</label>
|
||||
<select class="form-control" name="type" id="select-type">
|
||||
{% for id, cat in log_type %}
|
||||
<option value="{{ cat.id }}"
|
||||
{% if (type == 0 and id == 1) or (type == cat.id) %}selected="selected"{% endif %}>{{ cat.icon|capitalize }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button type="submit" class="btn btn-info"><i class="fas fa-update"></i> {{ (action == 'edit') ? 'Update' : 'Add' }}</button>
|
||||
<button type="button" onclick="window.location = '{{ constant('ADMIN_URL') }}?p=changelog';"
|
||||
class="btn btn-danger float-right"><i class="fas fa-cancel"></i> Cancel
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
55
system/templates/admin.changelog.html.twig
Normal file
55
system/templates/admin.changelog.html.twig
Normal file
@@ -0,0 +1,55 @@
|
||||
<div class="card card-info card-outline">
|
||||
<div class="card-header">
|
||||
<h5 class="m-0">News:
|
||||
<a href="{{ constant('ADMIN_URL') }}?p=changelog&action=new" class="float-right"><span
|
||||
class="btn btn-sm btn-success">New</span></a>
|
||||
</h5>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<table class="tb_datatable table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="5%">ID</th>
|
||||
<th>Date</th>
|
||||
<th>Description</th>
|
||||
<th>Type</th>
|
||||
<th>Where</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if changelogs|length > 0 %}
|
||||
{% set i = 0 %}
|
||||
{% for log in changelogs %}
|
||||
<tr>
|
||||
<td>{{ log.id }}</td>
|
||||
<td>{{ log.date|date("j.m.Y") }}</td>
|
||||
<td>{{ truncate(log.body|raw,20) }}</td>
|
||||
<td><img src="{{ constant('BASE_URL') }}images/changelog/{{ log.type }}.png" title="{{ log.type|capitalize }}"/> {{ log.type|capitalize }}</td>
|
||||
<td><img src="{{ constant('BASE_URL') }}images/changelog/{{ log.where }}.png" title="{{ log.where|capitalize }}"/> {{ log.where|capitalize }}</td>
|
||||
<td>
|
||||
<div class="btn-group">
|
||||
<a href="{{ constant('ADMIN_URL') }}?p=changelog&action=edit&id={{ log.id }}" class="btn btn-success btn-sm" title="Edit">
|
||||
<i class="fas fa-pencil-alt"></i>
|
||||
</a>
|
||||
<a href="{{ constant('ADMIN_URL') }}?p=changelog&action=delete&id={{ log.id }}" class="btn btn-danger btn-sm" onclick="return confirm('Are you sure?');" title="Delete">
|
||||
<i class="fas fa-trash"></i>
|
||||
</a>
|
||||
<a href="{{ constant('ADMIN_URL') }}?p=changelog&action=hide&id={{ log.id }}" class="btn btn-{{ (log.hidden != 1) ? 'info' : 'default' }} btn-sm" title="{% if log.hidden != 1 %}Hide{% else %}Show{% endif %}">
|
||||
<i class="fas fa-eye{{ (log.hidden != 1) ? '' : '-slash' }}"></i>
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% set i = i + 1 %}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="6">There are no changelogs for the moment.</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
@@ -1,23 +1,41 @@
|
||||
<br/>
|
||||
{% if canEdit %}
|
||||
<a href="{{ constant('ADMIN_URL') }}?p=changelog&action=new" class="btn btn-success btn-sm" title="Add New" target="_blank">Add New</a>
|
||||
{% endif %}
|
||||
<table border="0" cellspacing="1" cellpadding="4" width="100%">
|
||||
<tr bgcolor="{{ config.vdarkborder }}">
|
||||
<td width="22"><span class="white"><b>Type</b></span></td>
|
||||
<td width="22"><span class="white"><b>Where</b></span></td>
|
||||
<td width="50"><span class="white"><b>Date</b></span></td>
|
||||
<td><span class="white"><b>Description</b></span></td>
|
||||
{% if canEdit %}
|
||||
<td></td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% if changelogs|length > 0%}
|
||||
{% set i = 0 %}
|
||||
{% for log in changelogs %}
|
||||
<tr bgcolor="{{ getStyle(i) }}">
|
||||
<td align="center">
|
||||
<img src="images/changelog/{{ log.type }}.png" title="{{ log.type|capitalize }}"/>
|
||||
<img src="{{ constant('BASE_URL') }}images/changelog/{{ log.type }}.png" title="{{ log.type|capitalize }}"/>
|
||||
</td>
|
||||
<td align="center">
|
||||
<img src="images/changelog/{{ log.where }}.png" title="{{ log.where|capitalize }}"/>
|
||||
<img src="{{ constant('BASE_URL') }}images/changelog/{{ log.where }}.png" title="{{ log.where|capitalize }}"/>
|
||||
</td>
|
||||
<td>{{ log.date|date("j.m.Y") }}</td>
|
||||
<td>{{ log.body|raw }}</td>
|
||||
<td>{{ log.body|nl2br}}</td>
|
||||
{% if canEdit %}
|
||||
<td>
|
||||
<a href="{{ constant('ADMIN_URL') }}?p=changelog&action=edit&id={{ log.id }}" title="Edit in Admin Panel" target="_blank">
|
||||
<img src="images/edit.png"/>Edit
|
||||
</a>
|
||||
<a href="{{ constant('ADMIN_URL') }}?p=changelog&action=delete&id={{ log.id }}" onclick="return confirm('Are you sure?');" title="Delete in Admin Panel" target="_blank">
|
||||
<img src="images/del.png"/>Delete
|
||||
</a>
|
||||
<a href="{{ constant('ADMIN_URL') }}?p=changelog&action=hide&id={{ log.id }}" title="{% if log.hidden != 1 %}Hide{% else %}Show{% endif %} in Admin Panel" target="_blank">
|
||||
<img src="images/{{ (log.hidden != 1 ? 'success' : 'error') }}.png"/>{{ (log.hidden != 1) ? 'Hide' : 'Show' }}
|
||||
</a>
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% set i = i + 1 %}
|
||||
{% endfor %}
|
||||
@@ -35,4 +53,4 @@
|
||||
<tr><td width="100%" align="right" valign="bottom"><a href="{{ getLink('changelog/' ~ (page + 1)) }}" class="size_xxs">Next Page</a></td></tr>
|
||||
{% endif %}
|
||||
</table>
|
||||
</table>
|
||||
</table>
|
||||
|
Reference in New Issue
Block a user