diff --git a/src/Form/EntityFormTrait.php b/src/Form/EntityFormTrait.php
index 0c39f74b..1c815303 100644
--- a/src/Form/EntityFormTrait.php
+++ b/src/Form/EntityFormTrait.php
@@ -43,6 +43,7 @@ trait EntityFormTrait
])
->add('timeBudget', DurationType::class, [
'label' => 'label.timeBudget',
+ 'icon' => 'clock',
'required' => false,
])
;
diff --git a/src/Form/Extension/IconExtension.php b/src/Form/Extension/IconExtension.php
new file mode 100644
index 00000000..d1f4897c
--- /dev/null
+++ b/src/Form/Extension/IconExtension.php
@@ -0,0 +1,47 @@
+vars['icon'] = $options['icon'] ?? null;
+ }
+
+ /**
+ * @param OptionsResolver $resolver
+ */
+ public function configureOptions(OptionsResolver $resolver)
+ {
+ $resolver->setDefined(['icon']);
+ $resolver->setAllowedTypes('icon', 'string');
+ $resolver->setDefault('icon', '');
+ }
+}
diff --git a/src/Form/Type/AvatarType.php b/src/Form/Type/AvatarType.php
new file mode 100644
index 00000000..291c2abe
--- /dev/null
+++ b/src/Form/Type/AvatarType.php
@@ -0,0 +1,35 @@
+setDefaults([
+ 'label' => 'label.avatar',
+ ]);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getParent()
+ {
+ return TextType::class;
+ }
+}
diff --git a/src/Form/UserEditType.php b/src/Form/UserEditType.php
index 743ab842..2d552900 100644
--- a/src/Form/UserEditType.php
+++ b/src/Form/UserEditType.php
@@ -10,6 +10,7 @@
namespace App\Form;
use App\Entity\User;
+use App\Form\Type\AvatarType;
use App\Form\Type\YesNoType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
@@ -36,8 +37,7 @@ class UserEditType extends AbstractType
'label' => 'label.title',
'required' => false,
])
- ->add('avatar', TextType::class, [
- 'label' => 'label.avatar',
+ ->add('avatar', AvatarType::class, [
'required' => false,
])
->add('email', EmailType::class, [
diff --git a/templates/activity/edit.html.twig b/templates/activity/edit.html.twig
index 8b7af6cb..d37203b7 100644
--- a/templates/activity/edit.html.twig
+++ b/templates/activity/edit.html.twig
@@ -6,9 +6,52 @@
{% block page_actions %}{{ actions.activity(activity, 'edit') }}{% endblock %}
{% block main %}
- {{ include(app.request.xmlHttpRequest ? 'default/_form_modal.html.twig' : 'default/_form.html.twig', {
+ {% set formEditTemplate = app.request.xmlHttpRequest ? 'default/_form_modal.html.twig' : 'default/_form.html.twig' %}
+ {% set formOptions = {
'title': activity.name|default('create'|trans),
'form': form,
'back': path('admin_activity')
- }) }}
+ } %}
+ {% embed formEditTemplate with formOptions %}
+ {% block form_body %}
+
+
+ {{ form_row(form.name) }}
+
+
+ {{ form_row(form.color) }}
+
+
+ {{ form_row(form.comment) }}
+ {{ form_row(form.customer) }}
+ {{ form_row(form.project) }}
+
+ {{ form_row(form.visible) }}
+ {% if form.metaFields is defined and form.metaFields is not empty %}
+
+ {% endif %}
+ {{ form_widget(form) }}
+ {% endblock %}
+ {% endembed %}
{% endblock %}
diff --git a/templates/customer/edit.html.twig b/templates/customer/edit.html.twig
index 212d9bfc..3b0639f2 100644
--- a/templates/customer/edit.html.twig
+++ b/templates/customer/edit.html.twig
@@ -6,9 +6,91 @@
{% block page_actions %}{{ actions.customer(customer, 'edit') }}{% endblock %}
{% block main %}
- {{ include(app.request.xmlHttpRequest ? 'default/_form_modal.html.twig' : 'default/_form.html.twig', {
+ {% set formEditTemplate = app.request.xmlHttpRequest ? 'default/_form_modal.html.twig' : 'default/_form.html.twig' %}
+ {% set formOptions = {
'title': customer.name|default('create'|trans),
'form': form,
'back': path('admin_customer')
- }) }}
+ } %}
+ {% embed formEditTemplate with formOptions %}
+ {% block form_body %}
+
+
+ {{ form_row(form.name) }}
+
+
+ {{ form_row(form.color) }}
+
+
+ {{ form_row(form.comment) }}
+
+
+
+ {{ form_row(form.visible) }}
+ {% if form.metaFields is defined and form.metaFields is not empty %}
+
+ {% endif %}
+ {{ form_widget(form) }}
+ {% endblock %}
+ {% endembed %}
{% endblock %}
diff --git a/templates/form/kimai-theme.html.twig b/templates/form/kimai-theme.html.twig
index 7e7bcb75..c6d8a361 100644
--- a/templates/form/kimai-theme.html.twig
+++ b/templates/form/kimai-theme.html.twig
@@ -32,3 +32,16 @@
{{ block('form_widget_simple') }}
{%- endif -%}
{%- endblock datetime_widget %}
+
+{% block text_widget -%}
+ {% if icon is not empty %}
+
+ {% else %}
+ {{ block('form_widget_simple') }}
+ {% endif %}
+{%- endblock text_widget %}
diff --git a/templates/project/edit.html.twig b/templates/project/edit.html.twig
index cc428d92..c4c466d5 100644
--- a/templates/project/edit.html.twig
+++ b/templates/project/edit.html.twig
@@ -6,9 +6,59 @@
{% block page_actions %}{{ actions.project(project, 'edit') }}{% endblock %}
{% block main %}
- {{ include(app.request.xmlHttpRequest ? 'default/_form_modal.html.twig' : 'default/_form.html.twig', {
+ {% set formEditTemplate = app.request.xmlHttpRequest ? 'default/_form_modal.html.twig' : 'default/_form.html.twig' %}
+ {% set formOptions = {
'title': project.name|default('create'|trans),
'form': form,
'back': path('admin_project')
- }) }}
+ } %}
+ {% embed formEditTemplate with formOptions %}
+ {% block form_body %}
+
+
+ {{ form_row(form.name) }}
+
+
+ {{ form_row(form.color) }}
+
+
+ {{ form_row(form.comment) }}
+ {{ form_row(form.customer) }}
+
+
+ {{ form_row(form.orderNumber) }}
+
+
+ {{ form_row(form.orderDate) }}
+
+
+
+ {{ form_row(form.visible) }}
+ {% if form.metaFields is defined and form.metaFields is not empty %}
+
+ {% endif %}
+ {{ form_widget(form) }}
+ {% endblock %}
+ {% endembed %}
{% endblock %}