misuzu/templates/manage/news/category.twig

35 lines
1.4 KiB
Twig
Raw Normal View History

2022-09-13 13:14:49 +00:00
{% extends 'manage/news/master.twig' %}
{% from 'macros.twig' import container_title %}
{% from '_layout/input.twig' import input_hidden, input_csrf, input_text, input_checkbox %}
{% block manage_content %}
<form method="post" action="{{ url('manage-news-category', {'category': category_info.id|default(0)}) }}" class="container">
2023-07-15 17:02:46 +00:00
{{ container_title(category_new ? 'New Category' : 'Editing ' ~ category_info.name) }}
2022-09-13 13:14:49 +00:00
{{ input_csrf() }}
<table style="color:inherit">
<tr>
<td>Name</td>
2023-07-15 17:02:46 +00:00
<td>{{ input_text('nc_name', '', category_info.name|default(), 'text', '', true) }}</td>
2022-09-13 13:14:49 +00:00
</tr>
<tr>
<td>Description</td>
2023-07-15 17:02:46 +00:00
<td><textarea name="nc_desc" required class="input__textarea">{{ category_info.description|default() }}</textarea></td>
2022-09-13 13:14:49 +00:00
</tr>
<tr>
<td>Is Hidden</td>
2023-07-15 17:02:46 +00:00
<td>{{ input_checkbox('nc_hidden', '', category_info.isHidden|default(false)) }}</td>
2022-09-13 13:14:49 +00:00
</tr>
</table>
2023-07-15 17:02:46 +00:00
<div>
<button class="input__button">Save</button>
{% if not category_new %}
<a href="{{ url('manage-news-category-delete', {'category': category_info.id}) }}" class="input__button input__button--destroy" onclick="return confirm('Are you sure?');">Delete</a>
{% endif %}
</div>
2022-09-13 13:14:49 +00:00
</form>
{% endblock %}