Skip to content

Commit

Permalink
🎨 [#1795] Removed tag and made some file-upload styles conforming to …
Browse files Browse the repository at this point in the history
…design
  • Loading branch information
jiromaykin committed Nov 20, 2023
1 parent 851e69d commit d8c6a53
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{% endif %}
</a>
{% else %}
<{{ tag }}
<button
class="{{ classes }}"
type="{{type}}"
name="{{ name }}"
Expand All @@ -42,5 +42,5 @@
{% else %}
{% if not hide_text %}{{text}}{% endif %}
{% endif %}
</{{ tag }}>
</button>
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@
<div class="form__control file-input">
{% render_card direction="vertical" %}
{% icon icon="upload" icon_position="before" outlined=True %}
<input class="file-input__input" id="{{ field.auto_id }}" name="file" type="file">
{% button primary=True tag='label' text=text|default:_('Sleep of selecteer bestand') extra_attributes='for='|add:field.auto_id %}
<div class="inputfile-group">
<input class="file-input__input" id="{{ field.auto_id }}" name="file" type="file">
<label class="label" for="{{ field.auto_id }}">
<span class="input-button input-button--emptied"><span class="button button--primary" href="#document-upload" aria-label="_('Sleep of selecteer bestand')">{% trans 'Sleep of selecteer bestand' %}</span></span>
<span class="input-button input-button--selected"><span class="button button--textless button--icon button--transparent" href="#document-upload" aria-label="_('Selecteer bestand')">
{% icon icon="control_point" icon_position="before" primary=True outlined=True %}
{% trans 'Selecteer bestand' %}
</span></span>
</label>
</div>

{% endrender_card %}

{% if field.help_text %}<p class="p p--muted p--small">{{ field.help_text }}</p>{% endif %}
Expand Down
2 changes: 0 additions & 2 deletions src/open_inwoner/components/templatetags/button_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -130,5 +129,4 @@ def get_classes():

kwargs["classes"] = get_classes()
kwargs["text"] = text
kwargs["tag"] = kwargs.get("tag", "button")
return {**kwargs}
6 changes: 6 additions & 0 deletions src/open_inwoner/scss/components/File/File.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
25 changes: 22 additions & 3 deletions src/open_inwoner/scss/components/Form/FileInput.scss
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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 {
Expand Down
12 changes: 6 additions & 6 deletions src/open_inwoner/templates/pages/cases/status_inner.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,6 @@ <h3 class="status-list__notification-h3"><span class="link">{{ case.end_statusty
</aside>
{% endif %}

{# Documents. #}
{% if case.documents %}
<h2 class="h2" id="documents">{% trans 'Documenten' %}</h2>
{% case_document_list case.documents %}
{% endif %}

{% if case.internal_upload_enabled %}
<h2 class="h2" id="documents-upload">{% trans "Document uploaden" %}</h2>

Expand Down Expand Up @@ -119,6 +113,12 @@ <h2 class="h2" id="documents-upload">{% trans "Document toevoegen" %}</h2>
{% endbutton_row %}
{% endif %}

{# Documents. #}
{% if case.documents %}
<h2 class="h2" id="documents">{% trans 'Documenten' %}</h2>
{% case_document_list case.documents %}
{% endif %}

{# Contact moment form #}
{% if case.contact_form_enabled %}
<section id="cases-contact-form" class="form_contact">
Expand Down

0 comments on commit d8c6a53

Please sign in to comment.