50 lines
1.7 KiB
Twig
50 lines
1.7 KiB
Twig
{% extends "layouts/app.twig" %}
|
|
{% import 'macros/base.twig' as m %}
|
|
{% import 'macros/form.twig' as f %}
|
|
|
|
{% block title %}{{ __(is_edit ? 'worklog.edit' : 'worklog.add') }}{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="container">
|
|
<h1>{{ block('title') }}</h1>
|
|
|
|
{% include 'layouts/parts/messages.twig' %}
|
|
|
|
<form method="post">
|
|
{{ csrf() }}
|
|
<div class="row g-2">
|
|
<div class="col-12">
|
|
{{ m.button(__('back'), url('/users?action=view&user_id=' ~ user.id)) }}
|
|
</div>
|
|
<div class="col-12">
|
|
<div>
|
|
<label class="form-label">{{ __('User') }}</label>
|
|
</div>
|
|
{{ m.user(user, {'pronoun': true}) }}
|
|
</div>
|
|
<div class="col-12">
|
|
{{ f.input(
|
|
'work_date',
|
|
__('worklog.date'),
|
|
'date',
|
|
{'value': work_date.format('Y-m-d'), 'required': true}
|
|
) }}
|
|
{{ f.input(
|
|
'work_hours',
|
|
__('worklog.hours'),
|
|
'number',
|
|
{'value': work_hours, 'required': true, 'step': '0.01', 'min': 0}
|
|
) }}
|
|
{{ f.input(
|
|
'comment',
|
|
__('worklog.comment'),
|
|
'text',
|
|
{'value': comment, 'required': true, 'max_length': 200}
|
|
) }}
|
|
{{ f.submit(__('form.save')) }}
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
{% endblock %}
|