From 68001714f0485e36c8816b577a0d723faa103a51 Mon Sep 17 00:00:00 2001 From: Jean-Marie PLACE Date: Tue, 12 Apr 2022 18:07:49 +0200 Subject: [PATCH] add folding on logo editor --- app/static/css/scodoc.css | 52 +++++++++++- app/templates/config_logos.html | 142 ++++++++++++++++---------------- 2 files changed, 118 insertions(+), 76 deletions(-) diff --git a/app/static/css/scodoc.css b/app/static/css/scodoc.css index 9811b304..ba00717a 100644 --- a/app/static/css/scodoc.css +++ b/app/static/css/scodoc.css @@ -987,9 +987,34 @@ span.wtf-field ul.errors li { font-weight: bold; } -.configuration_logo div.img {} +.configuration_logo summary { + display: list-item !important; +} -.configuration_logo div.img-container { +.configuration_logo h1 { + display: inline-block; +} + +.configuration_logo h2 { + display: inline-block; +} + +.configuration_logo h3 { + display: inline-block; +} + +.configuration_logo details > *:not(summary) { + margin-left: 32px; +} + +.configuration_logo .content { + display : grid; + grid-template-columns: auto auto 1fr; +} + +.configuration_logo .image_logo { + vertical-align: top; + grid-column: 1/2; width: 256px; } @@ -997,8 +1022,27 @@ span.wtf-field ul.errors li { max-width: 100%; } -.configuration_logo div.img-data { - vertical-align: top; +.configuration_logo .infos_logo { + grid-column: 2/3; +} + +.configuration_logo .actions_logo { + grid-column: 3/5; + display:grid; + grid-template-columns: auto auto; + grid-column-gap: 10px; + align-self: start; + grid-row-gap: 10px; +} + +.configuration_logo .actions_logo .action_label { + grid-column: 1/2; + grid-template-columns: auto auto; +} + +.configuration_logo .actions_logo .action_button { + grid-column: 2/3; + align-self: start; } .configuration_logo logo-edit titre { diff --git a/app/templates/config_logos.html b/app/templates/config_logos.html index f4bd543c..a4974ca7 100644 --- a/app/templates/config_logos.html +++ b/app/templates/config_logos.html @@ -20,73 +20,70 @@ {% endmacro %} {% macro render_add_logo(add_logo_form) %} -
-

Ajouter un logo

- {{ add_logo_form.hidden_tag() }} - {{ render_field(add_logo_form.name) }} - {{ render_field(add_logo_form.upload) }} - {{ render_field(add_logo_form.do_insert, False, onSubmit="submit_form") }} -
+
+ +

Ajouter un logo

+
+
+ {{ render_field(add_logo_form.name) }} + {{ render_field(add_logo_form.upload) }} + {{ render_field(add_logo_form.do_insert, False, onSubmit="submit_form") }} +
+
{% endmacro %} {% macro render_logo(dept_form, logo_form) %} -
- {{ logo_form.hidden_tag() }} - {% if logo_form.titre %} - - -
-

{{ logo_form.titre }}

-
-
{{ logo_form.description or "" }}
- - - {% else %} - - - -

Logo personalisé: {{ logo_form.logo_id.data }}

-
- {{ logo_form.description or "" }} - - - {% endif %} - - -
+
+ {{ logo_form.hidden_tag() }} + + {% if logo_form.titre %} + + {% if logo_form.description %} +
{{ logo_form.description }}
+ {% endif %} + {% else %} + + {% if logo_form.description %} +
{{ logo_form.description }}
+ {% endif %} + {% endif %} +
+
+ - - -

{{ logo_form.logo.logoname }} (Format: {{ logo_form.logo.suffix }})

- Taille: {{ logo_form.logo.size }} px - {% if logo_form.logo.mm %}   /   {{ logo_form.logo.mm }} mm {% endif %}
- Aspect ratio: {{ logo_form.logo.aspect_ratio }}
- Usage: {{ logo_form.logo.get_usage() }} - - -

Modifier l'image

- {{ render_field(logo_form.upload, False, onchange="submit_form()") }} - {% if logo_form.can_delete %} -

Supprimer l'image

- {{ render_field(logo_form.do_delete, False, onSubmit="submit_form()") }} - {% endif %} - - -
+ + +
+ {% endmacro %} {% macro render_logos(dept_form) %} - {% for logo_entry in dept_form.logos.entries %} {% set logo_form = logo_entry.form %} {{ render_logo(dept_form, logo_form) }} {% else %} -

-

Aucun logo défini en propre à ce département

+

{% endfor %} -
{% endmacro %} {% block app_content %} @@ -100,25 +97,26 @@