misuzu/templates/manage/changelog/change.twig

62 lines
2.6 KiB
Twig
Raw Normal View History

2018-08-15 01:12:58 +00:00
{% extends 'manage/changelog/master.twig' %}
2018-10-22 19:53:21 +00:00
{% from 'macros.twig' import container_title %}
2019-04-02 19:02:35 +00:00
{% from '_layout/input.twig' import input_csrf, input_text, input_select, input_checkbox %}
2018-07-07 01:32:09 +00:00
{% if change is not null %}
2020-05-20 18:09:38 +00:00
{% set site_link = url('changelog-change', {'change': change.id}) %}
{% endif %}
{% block manage_content %}
2018-07-07 01:32:09 +00:00
<div class="container">
2020-05-20 18:09:38 +00:00
<form action="{{ url('manage-changelog-change', {'change': change.id|default(0)}) }}" method="post">
2019-06-10 15:21:53 +00:00
{{ input_csrf() }}
2018-10-02 19:16:42 +00:00
2020-05-20 18:09:38 +00:00
{{ container_title(change is not null ? 'Editing #' ~ change.id : 'Adding a new change') }}
2018-07-07 01:32:09 +00:00
<div style="display: flex; margin: 2px 5px;">
2020-05-20 18:09:38 +00:00
{{ input_select('change[action]', change_actions, change.action|default(0), 'action_name', 'action_id') }}
{{ input_text('change[log]', '', change.header|default(''), 'text', '', true, {'maxlength':255,'style':'flex-grow:1'}) }}
</div>
2018-07-07 01:32:09 +00:00
<label class="form__label">
2018-07-07 01:32:09 +00:00
<div class="form__label__text">Text</div>
<div class="form__label__input">
2020-05-20 18:09:38 +00:00
<textarea class="input__textarea" name="change[text]" maxlength="65535">{{ change.body|default('') }}</textarea>
2018-07-07 01:32:09 +00:00
</div>
</label>
<label class="form__label">
<div class="form__label__text">Contributor Id</div>
<div class="form__label__input">
2020-06-10 18:20:30 +00:00
{{ input_text('change[user]', '', change.userId|default(current_user.id), 'number', '', false, {'min':1}) }}
2018-07-07 01:32:09 +00:00
</div>
</label>
<label class="form__label">
<div class="form__label__text">Created</div>
<div class="form__label__input">
2020-05-20 18:09:38 +00:00
{{ input_text('change[created]', '', change.createdTime|default(null)|date('Y-m-d H:i:s'), 'text', '', true) }}
2018-07-07 01:32:09 +00:00
</div>
</label>
2019-04-02 19:02:35 +00:00
<div class="manage__tags">
{% for tag in change_tags %}
2019-04-02 19:02:35 +00:00
<label class="manage__tag">
<div class="manage__tag__background"></div>
<div class="manage__tag__content">
2020-05-20 18:09:38 +00:00
{{ input_checkbox('tags[]', '', change.hasTag(tag)|default(false), 'manage__tag__checkbox', tag.id) }}
2019-04-02 19:02:35 +00:00
<div class="manage__tag__title">
2020-05-20 18:09:38 +00:00
{{ tag.name }}
2019-04-02 19:02:35 +00:00
</div>
</div>
</label>
{% endfor %}
</div>
2018-07-07 01:32:09 +00:00
<div>
2018-10-02 19:16:42 +00:00
<button class="input__button">Save</button>
2018-07-07 01:32:09 +00:00
</div>
</form>
</div>
{% endblock %}