From d8c6a530740db4750bca2bf5cc3144544c32b612 Mon Sep 17 00:00:00 2001 From: jiroghianni Date: Mon, 20 Nov 2023 17:43:43 +0100 Subject: [PATCH] :art: [#1795] Removed tag and made some file-upload styles conforming to design --- .../templates/components/Button/Button.html | 4 +-- .../templates/components/Form/FileInput.html | 13 ++++++++-- .../components/templatetags/button_tags.py | 2 -- .../scss/components/File/File.scss | 6 +++++ .../scss/components/Form/FileInput.scss | 25 ++++++++++++++++--- .../templates/pages/cases/status_inner.html | 12 ++++----- 6 files changed, 47 insertions(+), 15 deletions(-) diff --git a/src/open_inwoner/components/templates/components/Button/Button.html b/src/open_inwoner/components/templates/components/Button/Button.html index 724b41d08e..6dd222e4de 100644 --- a/src/open_inwoner/components/templates/components/Button/Button.html +++ b/src/open_inwoner/components/templates/components/Button/Button.html @@ -21,7 +21,7 @@ {% endif %} {% else %} - <{{ tag }} + {% endif %} diff --git a/src/open_inwoner/components/templates/components/Form/FileInput.html b/src/open_inwoner/components/templates/components/Form/FileInput.html index 5e0e7b2e94..238d2513f4 100644 --- a/src/open_inwoner/components/templates/components/Form/FileInput.html +++ b/src/open_inwoner/components/templates/components/Form/FileInput.html @@ -4,8 +4,17 @@
{% render_card direction="vertical" %} {% icon icon="upload" icon_position="before" outlined=True %} - - {% button primary=True tag='label' text=text|default:_('Sleep of selecteer bestand') extra_attributes='for='|add:field.auto_id %} +
+ + +
+ {% endrender_card %} {% if field.help_text %}

{{ field.help_text }}

{% endif %} diff --git a/src/open_inwoner/components/templatetags/button_tags.py b/src/open_inwoner/components/templatetags/button_tags.py index a70a9d69c2..a467ec36ba 100644 --- a/src/open_inwoner/components/templatetags/button_tags.py +++ b/src/open_inwoner/components/templatetags/button_tags.py @@ -58,7 +58,6 @@ def button(text, **kwargs): - icon: string | the icon that you want to display. - icon_position: enum[before, after] | where the icon should be positioned to the text. - icon_outlined: bool | if the outlined icons should be used. - - tag: string | The tag to use (if not a link, defaults to button) - text_icon: string | An additional icon to show before the (current value) text. - type: string | the type of button that should be used. - title: string | The HTML title attribute if different than the text. @@ -130,5 +129,4 @@ def get_classes(): kwargs["classes"] = get_classes() kwargs["text"] = text - kwargs["tag"] = kwargs.get("tag", "button") return {**kwargs} diff --git a/src/open_inwoner/scss/components/File/File.scss b/src/open_inwoner/scss/components/File/File.scss index 30ede33090..cc0df89390 100644 --- a/src/open_inwoner/scss/components/File/File.scss +++ b/src/open_inwoner/scss/components/File/File.scss @@ -20,7 +20,13 @@ box-sizing: border-box; } + &__file .link:hover { + color: var(--font-color-body); + text-decoration: none; + } + &__file .p { + max-width: var(--mobile-xs-width); width: 100%; white-space: nowrap; overflow: hidden; diff --git a/src/open_inwoner/scss/components/Form/FileInput.scss b/src/open_inwoner/scss/components/Form/FileInput.scss index 0118882380..ad6b4dc79d 100644 --- a/src/open_inwoner/scss/components/Form/FileInput.scss +++ b/src/open_inwoner/scss/components/Form/FileInput.scss @@ -1,7 +1,14 @@ .file-input { - .card:first-child { - text-align: center; - position: relative; + .card { + &:first-child { + text-align: center; + position: relative; + } + + .label .input-button > .button { + padding-bottom: var(--spacing-medium); + position: static; + } } &--drag-active .card:first-child { @@ -24,9 +31,21 @@ } &__input { + left: 0; position: absolute; opacity: 0; pointer-events: none; + width: 100%; + height: var(--row-height-giant); + } + + .input-button { + display: inline-block; + + &--selected { + //display: none; TODO: toggle this with JS + cursor: pointer; + } } > .p { diff --git a/src/open_inwoner/templates/pages/cases/status_inner.html b/src/open_inwoner/templates/pages/cases/status_inner.html index 7106c8fff4..6dcc0acbd0 100644 --- a/src/open_inwoner/templates/pages/cases/status_inner.html +++ b/src/open_inwoner/templates/pages/cases/status_inner.html @@ -81,12 +81,6 @@

{{ case.end_statusty {% endif %} - {# Documents. #} - {% if case.documents %} -

{% trans 'Documenten' %}

- {% case_document_list case.documents %} - {% endif %} - {% if case.internal_upload_enabled %}

{% trans "Document uploaden" %}

@@ -119,6 +113,12 @@

{% trans "Document toevoegen" %}

{% endbutton_row %} {% endif %} + {# Documents. #} + {% if case.documents %} +

{% trans 'Documenten' %}

+ {% case_document_list case.documents %} + {% endif %} + {# Contact moment form #} {% if case.contact_form_enabled %}