From 3e63b4abf30736c41afccb7af97fd259f3bfb6cb Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Tue, 4 Jul 2023 16:42:56 +0200 Subject: [PATCH] UX: improve FilterOrder box design --- .../translations/messages.fr.yml | 2 + .../Form/Type/Listing/FilterOrderType.php | 3 + .../Resources/public/chill/scss/forms.scss | 12 +++ .../views/FilterOrder/base.html.twig | 81 ++++++++----------- 4 files changed, 50 insertions(+), 48 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/translations/messages.fr.yml b/src/Bundle/ChillActivityBundle/translations/messages.fr.yml index c53a04f31..d37b3488f 100644 --- a/src/Bundle/ChillActivityBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillActivityBundle/translations/messages.fr.yml @@ -96,6 +96,8 @@ activity_filter: My activities: Mes échanges (où j'interviens) Types: Par type d'échange Jobs: Par métier impliqué + By: Filtrer par + Search: Chercher dans la liste #timeline '%user% has done an %activity_type%': '%user% a effectué un échange de type "%activity_type%"' diff --git a/src/Bundle/ChillMainBundle/Form/Type/Listing/FilterOrderType.php b/src/Bundle/ChillMainBundle/Form/Type/Listing/FilterOrderType.php index 16038515d..1f373400c 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Listing/FilterOrderType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Listing/FilterOrderType.php @@ -38,6 +38,9 @@ final class FilterOrderType extends \Symfony\Component\Form\AbstractType $builder->add('q', SearchType::class, [ 'label' => false, 'required' => false, + 'attr' => [ + 'placeholder' => 'activity_filter.Search', + ] ]); } diff --git a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/forms.scss b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/forms.scss index 0ae568244..cd81f36dc 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/forms.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/forms.scss @@ -42,3 +42,15 @@ form { font-weight: 700; margin-bottom: .375em; } + +.chill_filter_order { + background: $gray-100; /* + border: 3px dashed $white; + background: repeating-linear-gradient( + -45deg, + $gray-100, + $gray-100 2px, + $white 2px, + $white 6px + ); */ +} \ No newline at end of file diff --git a/src/Bundle/ChillMainBundle/Resources/views/FilterOrder/base.html.twig b/src/Bundle/ChillMainBundle/Resources/views/FilterOrder/base.html.twig index d4a6bbdd4..8faef5d14 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/FilterOrder/base.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/FilterOrder/base.html.twig @@ -1,102 +1,87 @@ {{ form_start(form) }} -
-
+ {% set btnSubmit = 0 %} +
+
{% if form.vars.has_search_box %} -
-
- {{ form_widget(form.q)}} - +
+
+ {{ form_widget(form.q) }} +
{% endif %}
{% if form.dateRanges is defined %} + {% set btnSubmit = 1 %} {% if form.dateRanges|length > 0 %} {% for dateRangeName, _o in form.dateRanges %} -
+
{% if form.dateRanges[dateRangeName].vars.label is not same as(false) %} -
{{ form_label(form.dateRanges[dateRangeName])}} -
{% endif %} -
-
+
+
{{ 'chill_calendar.From'|trans }} {{ form_widget(form.dateRanges[dateRangeName]['from']) }} {{ 'chill_calendar.To'|trans }} {{ form_widget(form.dateRanges[dateRangeName]['to']) }}
-
- -
{% endfor %} {% endif %} {% endif %} {% if form.checkboxes is defined %} + {% set btnSubmit = 1 %} {% if form.checkboxes|length > 0 %} {% for checkbox_name, options in form.checkboxes %} -
-
+
+
{{ 'activity_filter.By'|trans }}
+
{% for c in form['checkboxes'][checkbox_name].children %} -
- {{ form_widget(c) }} - {{ form_label(c) }} -
+ {{ form_widget(c) }} + {{ form_label(c) }} {% endfor %}
- {% if loop.last %} -
-
-
    -
  • - -
  • -
-
-
- {% endif %} {% endfor %} {% endif %} {% endif %} {% if form.entity_choices is defined %} + {% set btnSubmit = 1 %} {% if form.entity_choices |length > 0 %} {% for checkbox_name, options in form.entity_choices %} -
+
{% if form.entity_choices[checkbox_name].vars.label is not same as(false) %} -
- {{ form_label(form.entity_choices[checkbox_name])}} -
+ {{ form_label(form.entity_choices[checkbox_name])}} {% endif %} -
+
{% for c in form['entity_choices'][checkbox_name].children %} -
- {{ form_widget(c) }} - {{ form_label(c) }} -
+ {{ form_widget(c) }} + {{ form_label(c) }} {% endfor %}
-
- -
{% endfor %} {% endif %} {% endif %} {% if form.single_checkboxes is defined %} + {% set btnSubmit = 1 %} {% for name, _o in form.single_checkboxes %} -
-
+
+
{{ 'activity_filter.By'|trans }}
+
{{ form_widget(form.single_checkboxes[name]) }}
-
- -
{% endfor %} {% endif %} + + {% if btnSubmit == 1 %} +
+ +
+ {% endif %}
{% for k,v in otherParameters %}