feat: order and format the pickup fields
This commit is contained in:
1 parent
8da9af46f5
commit
392e67448e
9 files changed
+746
-21
No files matched your search
@@ -126,6 +126,47 @@
|
||||
{% endfor -%}
|
||||
{%- endblock choice_widget_expanded -%}
|
||||
|
||||
{#
|
||||
# The boarding points of a destination, as a radio list. Expanded rather than a dropdown
|
||||
# because a row carries three things - the town, the street and the departure time - and two
|
||||
# towns can repeat within one travel, where only the street tells them apart. App\Form\AssignmentType
|
||||
# puts the latter two on the choice as data attributes.
|
||||
#}
|
||||
{%- block pickup_choice_widget -%}
|
||||
{%- if choices is empty -%}
|
||||
{# no destination chosen yet, or one without boarding points - the caller says which #}
|
||||
<p class="text-sm leading-6 text-gray-500">{{ attr['data-empty-text']|default('Keine Zustiege verfügbar.') }}</p>
|
||||
{%- elseif expanded -%}
|
||||
{# 82% of destinations have seven boarding points or fewer and fit without scrolling;
|
||||
the longest hold fifteen, which would otherwise stretch the form past the fields
|
||||
beside it #}
|
||||
<div class="max-h-80 divide-y divide-gray-100 overflow-y-auto rounded-md ring-1 ring-inset ring-gray-300">
|
||||
{%- for child in form %}
|
||||
{%- set departure = child.vars.attr['data-departure']|default('') -%}
|
||||
{%- set street = child.vars.attr['data-street']|default('') -%}
|
||||
<div class="flex items-start gap-3 px-3 py-2">
|
||||
<div class="min-w-0 flex-1 text-sm leading-5">
|
||||
<label for="{{ child.vars.id }}" class="flex select-none items-baseline gap-2">
|
||||
<span class="font-medium text-gray-900">{{ child.vars.label }}</span>
|
||||
{%- if departure is not empty %}
|
||||
<span class="ml-auto shrink-0 tabular-nums text-gray-500">{{ departure }} Uhr</span>
|
||||
{%- endif %}
|
||||
</label>
|
||||
{%- if street is not empty %}
|
||||
<p class="truncate text-xs text-gray-500" title="{{ street }}">{{ street }}</p>
|
||||
{%- endif %}
|
||||
</div>
|
||||
<div class="flex h-5 items-center">
|
||||
{{- form_widget(child) -}}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor -%}
|
||||
</div>
|
||||
{%- else -%}
|
||||
{{- block('choice_widget_collapsed') -}}
|
||||
{%- endif -%}
|
||||
{%- endblock pickup_choice_widget -%}
|
||||
|
||||
{%- block birthday_widget -%}
|
||||
<div class="grid grid-cols-3 gap-x-1">
|
||||
{{ form_widget(form.children['day']) }}
|
||||
|
||||
Reference in new issue
Block a user