misuzu/templates/manage/changelog/change_edit.twig

69 lines
3 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
2019-04-02 19:02:35 +00:00
{% if edit_change is not null %}
{% set site_link = url('changelog-change', {'change': edit_change.change_id}) %}
{% endif %}
{% block manage_content %}
2018-07-07 01:32:09 +00:00
<div class="container">
2019-04-02 19:02:35 +00:00
<form action="?v=change{{ edit_change is not null ? '&c=' ~ edit_change.change_id : '' }}" method="post">
{{ input_csrf('changelog_add') }}
2018-10-02 19:16:42 +00:00
2019-04-02 19:02:35 +00:00
{{ container_title(edit_change is not null ? 'Editing #' ~ edit_change.change_id : 'Adding a new change') }}
2018-07-07 01:32:09 +00:00
<div style="display: flex; margin: 2px 5px;">
2019-04-11 22:31:23 +00:00
{{ input_select('change[action]', changelog_actions, edit_change.change_action|default(0), 'action_name', 'action_id') }}
2019-04-02 19:02:35 +00:00
{{ input_text('change[log]', '', edit_change is not null ? edit_change.change_log : '', '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">
2019-04-02 19:02:35 +00:00
<textarea class="input__textarea" name="change[text]" maxlength="65535">{{ edit_change is not null ? edit_change.change_text : '' }}</textarea>
2018-07-07 01:32:09 +00:00
</div>
</label>
<label class="form__label">
<div class="form__label__text">Action</div>
<div class="form__label__input">
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">
2018-10-27 19:06:16 +00:00
{{ input_text('change[user]', '', edit_change.user_id|default(current_user.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">
2019-04-02 19:02:35 +00:00
{{ input_text('change[created]', '', (edit_change is not null ? edit_change.change_created : ''|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 edit_change_tags %}
<label class="manage__tag">
<div class="manage__tag__background"></div>
<div class="manage__tag__content">
{{ input_checkbox('tags[]', '', tag.has_tag, 'manage__tag__checkbox', tag.tag_id) }}
<div class="manage__tag__title">
{{ tag.tag_name }}
</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 %}