-
Notifications
You must be signed in to change notification settings - Fork 0
/
form-field-image.html
46 lines (46 loc) · 1.87 KB
/
form-field-image.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{%- capture this_template_id -%}{{ include.label | slugify }}-item-template{%- endcapture -%}
{%- capture this_add_id -%}{{ include.label | slugify }}-add-item{%- endcapture -%}
{%- capture this_id -%}field-{{ include.label | remove: 'label_' | slugify }}{%- endcapture -%}
{%- capture this_accept -%}{{ include.accept | default: 'image/*'}}{%- endcapture -%}
<!-- <pat-form-field-image> -->
<fieldset
{% include patterns/form-field-id %}
{% include patterns/form-field-auto-save-attributes %}
class="
{{ include.class }}
group
pat-form-field-image
{% include patterns/form-field-auto-save-classes %}
{% if include.depends %}pat-depends{% endif %}"
{% if include.depends %}data-pat-depends="{{ include.depends }}; transition: slide" {% endif %}>
<legend>
{%- include patterns/form-field-label-conditional.html -%}
</legend>
{% if include.image %}
<figure
class="pat-image">
{% include patterns/picture.html
alternative-text=include.alternative-text
copyright=include.copyright
author=include.author
source=include.image %}
</figure>
{% include patterns/sortable-files-button-bar.html
remove=true
multiple=false
edit-panel=include.edit-panel
%}
{% else %}
{% include patterns/sortable-files-button-bar.html
remove=false
multiple=false
accept=this_accept
%}
{% endif %}
{% if item.help %}
{% include patterns/form-help.html
content=item.help more=item.help_more %}
{% endif %}
{% include patterns/form-has-changes.html %}
</fieldset>
<!-- </pat-form-field-image> -->