74 lines
3.4 KiB
Twig
74 lines
3.4 KiB
Twig
|
{% extends 'manage/general/master.twig' %}
|
||
|
{% from 'home/macros.twig' import chat_quote_display %}
|
||
|
{% from 'macros.twig' import pagination %}
|
||
|
|
||
|
{% block manage_content %}
|
||
|
<div class="container container--new">
|
||
|
<div class="container__title">Quotes</div>
|
||
|
|
||
|
{% if current_quote is defined %}
|
||
|
<form method="post" action="">
|
||
|
{{ 'add_quote'|csrf|raw }}
|
||
|
<input type="hidden" name="quote[id]" value="{{ current_quote.quote_id|default(0) }}">
|
||
|
|
||
|
* = optional
|
||
|
|
||
|
<table style="color:inherit">
|
||
|
<tr>
|
||
|
<td>Parent ID*</td>
|
||
|
<td><input type="number" name="quote[parent]" value="{{ current_quote.quote_parent|default(quote_parent) }}" class="input__text input__text--new"></td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td>User ID*</td>
|
||
|
<td><input type="number" name="quote[user][id]" class="input__text input__text--new" value="{{ current_quote.quote_user_id|default(0) }}"></td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td>Date/time*</td>
|
||
|
<td><input type="text" name="quote[time]" class="input__text input__text--new" value="{{ current_quote.quote_timestamp|default(0)|date('Y-m-d H:i:s') }}"></td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td>Username</td>
|
||
|
<td><input type="text" required name="quote[user][name]" class="input__text input__text--new" value="{{ current_quote.quote_username|default() }}"></td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td>User Colour</td>
|
||
|
<td><input type="number" required name="quote[user][colour]" class="input__text input__text--new" value="{{ current_quote.quote_user_colour|default(constant('MSZ_COLOUR_INHERIT')) }}"></td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td colspan="2">
|
||
|
<textarea name="quote[text]" required class="input__textarea input__textarea--new">{{ current_quote.quote_text|default() }}</textarea>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
|
||
|
<button class="input__button input__button--new">Save</button>
|
||
|
</form>
|
||
|
{% elseif quote_set is defined %}
|
||
|
{{ chat_quote_display(quote_set) }}
|
||
|
|
||
|
<a href="?v=quotes&q=-1&s={{ quote_set[0].quote_id }}" class="input__button input__button--new">Add</a>
|
||
|
|
||
|
Edit:
|
||
|
{% for key, quote in quote_set %}
|
||
|
<a href="?v=quotes&q={{ quote.quote_id }}&s={{ quote_set[0].quote_id }}" class="input__button input__button--new">{{ key + 1 }} ({{ quote.quote_username }})</a>
|
||
|
{% endfor %}
|
||
|
{% else %}
|
||
|
<a href="?v=quotes&q=-1" class="input__button input__button--new">Create</a>
|
||
|
|
||
|
{% for parent in quote_parents %}
|
||
|
<div class="container container--new">
|
||
|
<a href="?v=quotes&s={{ parent.quote_id }}" class="container__title container__title--link">{{ parent.quote_timestamp|date('Y-m-d') }}</a>
|
||
|
{{ chat_quote_display([parent]) }}
|
||
|
</div>
|
||
|
{% endfor %}
|
||
|
|
||
|
{{ pagination(quote_count, 15, quote_offset, '?v=quotes') }}
|
||
|
{% endif %}
|
||
|
</div>
|
||
|
{% endblock %}
|