misuzu/templates/manage/changelog/change_edit.twig

109 lines
4.9 KiB
Twig
Raw Normal View History

2018-08-15 01:12:58 +00:00
{% extends 'manage/changelog/master.twig' %}
2018-07-07 01:32:09 +00:00
{% block manage_content %}
2018-07-07 01:32:09 +00:00
<div class="container">
<form action="?v=change{{ edit_change is defined ? '&c=' ~ edit_change.change_id : '' }}" method="post">
<h1 class="container__title">
{% if edit_change is defined %}
Editing #{{ edit_change.change_id }}
{% else %}
Adding a new change
{% endif %}
</h1>
<label class="form__label" style="width:100%">
<div class="form__label__text">Log</div>
<div class="form__label__input">
<input class="input__text" type="text" value="{{ edit_change is defined ? edit_change.change_log : '' }}" name="change[log]" maxlength="255">
2018-07-07 01:32:09 +00:00
</div>
</label>
<label class="form__label" style="width:100%">
<div class="form__label__text">Text</div>
<div class="form__label__input">
<textarea class="input__textarea" name="change[text]" maxlength="65535">{{ edit_change is defined ? 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">
<select name="change[action]" class="input input--select">
{% for action in changelog_actions %}
<option value="{{ action.action_id }}"{% if edit_change is defined and action.action_id == edit_change.action_id %} selected{% endif %}>
{{ action.action_name }}
</option>
{% endfor %}
</select>
</div>
</label>
<label class="form__label">
<div class="form__label__text">Contributor Id</div>
<div class="form__label__input">
<input class="input__text" type="number" value="{{ edit_change is defined ? edit_change.user_id : current_user.user_id }}" name="change[user]" 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">
<input class="input__text" type="text" value="{{ edit_change is defined ? edit_change.change_created : ''|date('Y-m-d H:i:s') }}" name="change[created]">
2018-07-07 01:32:09 +00:00
</div>
</label>
<div>
<button class="input__button" name="csrf" value="{{ csrf_token() }}">Save</button>
2018-07-07 01:32:09 +00:00
</div>
</form>
{% if edit_change is defined %}
<h1 class="container__title">
Tags
</h1>
{% if edit_change_assigned_tags|length > 0 %}
<form class="container" method="post" action="" style="display:inline-block">
<label class="form__label">
<div class="form__label__text">Assigned Tags</div>
<div class="form__label__input">
<select name="remove_tag" class="input input--select">
{% for tag in edit_change_assigned_tags %}
<option value="{{ tag.tag_id }}">
{{ tag.tag_name }}
</option>
{% endfor %}
</select>
</div>
</label>
<div>
<button class="input__button" name="csrf" value="{{ csrf_token() }}">Remove</button>
2018-07-07 01:32:09 +00:00
</div>
</form>
{% endif %}
{% if edit_change_available_tags|length > 0 %}
<form class="container" method="post" action="" style="display:inline-block">
<label class="form__label">
<div class="form__label__text">Available Tags</div>
<div class="form__label__input">
<select name="add_tag" class="input input--select">
{% for tag in edit_change_available_tags %}
<option value="{{ tag.tag_id }}">
{{ tag.tag_name }}
</option>
{% endfor %}
</select>
</div>
</label>
<div>
<button class="input__button" name="csrf" value="{{ csrf_token() }}">Add</button>
2018-07-07 01:32:09 +00:00
</div>
</form>
{% endif %}
{% endif %}
</div>
{% endblock %}