Files
kimai2/templates/activity/edit.html.twig
Kevin Papst 7907b43ef7 UI improvement (#1829)
* open "create new project/activity" form in modal
* re-use action translation for create action title
* do not pre-select first customer in list - fixes #1828
* sort user preferences in sections for better visual grouping
* show comment date only in hover of user avatar
2020-07-17 20:32:11 +02:00

50 lines
1.9 KiB
Twig

{% extends app.request.xmlHttpRequest ? 'form.html.twig' : 'base.html.twig' %}
{% import "activity/actions.html.twig" as actions %}
{% block page_title %}{{ 'admin_activity.title'|trans }}{% endblock %}
{% block page_actions %}{{ actions.activity(activity, 'edit') }}{% endblock %}
{% block main %}
{% set formEditTemplate = app.request.xmlHttpRequest ? 'default/_form_modal.html.twig' : 'default/_form.html.twig' %}
{% set formOptions = {
'title': activity.name|default('create-activity'|trans({}, 'actions')),
'form': form,
'back': path('admin_activity')
} %}
{% embed formEditTemplate with formOptions %}
{% block form_body %}
<div class="row">
<div class="col-md-10">
{{ form_row(form.name) }}
</div>
<div class="col-md-2">
{{ form_row(form.color) }}
</div>
</div>
{{ form_row(form.comment) }}
{{ form_row(form.customer) }}
{{ form_row(form.project) }}
{% if form.budget is defined %}
<div class="row">
<div class="col-md-6">
{{ form_row(form.budget) }}
</div>
<div class="col-md-6">
{{ form_row(form.timeBudget) }}
</div>
</div>
{% endif %}
{{ form_row(form.visible) }}
{% if form.metaFields is defined and form.metaFields is not empty %}
{{ form_row(form.metaFields) }}
{% endif %}
{% if form.create_more is defined and app.request.xmlHttpRequest %}
<div class="hidden">
{{ form_row(form.create_more) }}
</div>
{% endif %}
{{ form_widget(form) }}
{% endblock %}
{% endembed %}
{% endblock %}