Activity Form : display field according to the parameters

This commit is contained in:
Jean-Francois Monfort
2021-04-29 16:35:39 +02:00
parent 45671bda52
commit 82d8556f24
8 changed files with 354 additions and 209 deletions

View File

@@ -29,12 +29,40 @@
{{ form_row(edit_form.scope) }}
<h2>{{ 'Activity data'|trans }}</h2>
{{ form_row(edit_form.date) }}
{{ form_row(edit_form.durationTime) }}
{{ form_row(edit_form.type) }}
{{ form_row(edit_form.attendee) }}
{{ form_row(edit_form.reasons) }}
{{ form_row(edit_form.comment) }}
{%- if form.date is defined -%}
{{ form_row(form.date) }}
{% endif %}
{%- if form.durationTime is defined -%}
{{ form_row(form.durationTime) }}
{% endif %}
{%- if form.travelTime is defined -%}
{{ form_row(form.travelTime) }}
{% endif %}
{%- if form.attendee is defined -%}
{{ form_row(form.attendee) }}
{% endif %}
{%- if form.comment is defined -%}
{{ form_row(form.comment) }}
{% endif %}
{%- if form.reasons is defined -%}
{{ form_row(form.reasons) }}
{% endif %}
{%- if form.persons is defined -%}
{{ form_row(form.persons) }}
{% endif %}
{%- if form.thirdParties is defined -%}
{{ form_row(form.thirdParties) }}
{% endif %}
{%- if form.users is defined -%}
{{ form_row(form.users) }}
{% endif %}
{%- if form.emergency is defined -%}
{{ form_row(form.emergency) }}
{% endif %}
{%- if form.sentReceived is defined -%}
{{ form_row(form.sentReceived) }}
{% endif %}
{{ form_widget(edit_form) }}
<ul class="record_actions sticky-form-buttons">

View File

@@ -30,11 +30,39 @@
<h2 class="chill-red">{{ 'Activity data'|trans }}</h2>
{{ form_row(form.date) }}
{{ form_row(form.durationTime) }}
{{ form_row(form.attendee) }}
{{ form_row(form.reasons) }}
{{ form_row(form.comment) }}
{%- if form.date is defined -%}
{{ form_row(form.date) }}
{% endif %}
{%- if form.durationTime is defined -%}
{{ form_row(form.durationTime) }}
{% endif %}
{%- if form.travelTime is defined -%}
{{ form_row(form.travelTime) }}
{% endif %}
{%- if form.attendee is defined -%}
{{ form_row(form.attendee) }}
{% endif %}
{%- if form.comment is defined -%}
{{ form_row(form.comment) }}
{% endif %}
{%- if form.reasons is defined -%}
{{ form_row(form.reasons) }}
{% endif %}
{%- if form.persons is defined -%}
{{ form_row(form.persons) }}
{% endif %}
{%- if form.thirdParties is defined -%}
{{ form_row(form.thirdParties) }}
{% endif %}
{%- if form.users is defined -%}
{{ form_row(form.users) }}
{% endif %}
{%- if form.emergency is defined -%}
{{ form_row(form.emergency) }}
{% endif %}
{%- if form.sentReceived is defined -%}
{{ form_row(form.sentReceived) }}
{% endif %}
<div class="grid-12 centered sticky-form-buttons">
<button class="sc-button green margin-10" type="submit"><i class="fa fa-save"></i> {{ 'Add a new activity'|trans }}</button>

View File

@@ -7,13 +7,14 @@
{% block personcontent %}
<h2 class="chill-red">{{ "Activity creation"|trans }}</h2>
{{ form_start(form) }}
{{ form_row(form.type) }}
<div class="grid-12 centered sticky-form-buttons">
<button class="sc-button green margin-10" type="submit"><i class="fa fa-save"></i> {{ 'Next Step'|trans }}</button>
{# TODO: refaire l'html css des tuilles #}
<div style="display:flex;justify-content:center;gap:12px;flex-wrap:wrap;">
{% for activityType in activityTypes %}
<a href="{{ path('chill_activity_activity_new', {'person_id': person.id, 'activityType_id': activityType.id }) }}">
<div style="width:200px;height:200px;border:1px dotted red;display:flex;justify-content:center;align-items:center;align-content:center;">
{{ activityType.name|localize_translatable_string }}
</div>
</a>
{% endfor %}
</div>
{{ form_end(form) }}
{% endblock %}