Skip to content

Commit f47e18c

Browse files
committed
Simple file uploads
1 parent 394fb53 commit f47e18c

5 files changed

+20
-14
lines changed

form-component.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,6 @@
7777
depends=include.depends
7878
checked=include.checked
7979
action=include.action
80-
class=include.class %}
80+
class=include.class
81+
data=include.data %}
8182
{% endif %}

form-field-attachments.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
attachments
77
{% if item.depends %}pat-depends{% endif %}">
88
<legend>{% include patterns/form-field-label-conditional.html %}</legend>
9-
{% include patterns/sortable-files.html %}
9+
{% include patterns/sortable-files.html
10+
data=include.data %}
1011
<div
1112
class="pat-button-bar">
1213
<label
@@ -17,6 +18,7 @@
1718
target: #attachment-list"
1819
{% endif %}
1920
class="
21+
pat-button
2022
{% include patterns/form-field-auto-save-classes %}
2123
file-upload-button">
2224
{% include patterns/i18n id="patterns.upload_files_imp" %}

form-field-location.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
<input
1818
name="location"
1919
type="text"
20-
value="{% if page.event_location %}{{ page.event_location }}{% else %}Frankfurt Star Alliance head office{% endif %}">
20+
value="{% if page.event_location %}{{ page.event_location }}{% else %}Head office, Amsterdam{% endif %}">
2121
<iframe
2222
id="{{ this_preview_id }}"
2323
width="100%"
2424
height="240"
25-
src="https://maps.google.com/maps?q={% if page.event_location %}{{ page.event_location }}{% else %}Frankfurt Star Alliance head office{% endif %}&t=&z=13&ie=UTF8&iwloc=&output=embed"
25+
src="https://maps.google.com/maps?q={% if page.event_location %}{{ page.event_location }}{% else %}Head office, Amsterdam{% endif %}&t=&z=13&ie=UTF8&iwloc=&output=embed"
2626
frameborder="0"
2727
scrolling="no"
2828
marginheight="0"
@@ -36,6 +36,6 @@
3636
<input
3737
name="location"
3838
type="text"
39-
value="{% if page.event_location %}{{ page.event_location }}{% else %}Frankfurt head office{% endif %}">
39+
value="{% if page.event_location %}{{ page.event_location }}{% else %}Amsterdam{% endif %}">
4040
{% endif %}
4141
</fieldset>

form.html

+6-3
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@
7272
depends=item.depends
7373
checked=item.checked
7474
action=item.action
75-
class=item.class %}
75+
class=item.class
76+
data=item.data %}
7677
{% endfor %}
7778
{% elsif include.src contains 'page.' %}
7879
{% for item in page[src] %}
@@ -94,7 +95,8 @@
9495
depends=item.depends
9596
checked=item.checked
9697
action=item.action
97-
class=item.class %}
98+
class=item.class
99+
data=item.data %}
98100
{% endfor %}
99101
{% else %}
100102
{% for item in site.data[src] %}
@@ -116,7 +118,8 @@
116118
depends=item.depends
117119
checked=item.checked
118120
action=item.action
119-
class=item.class %}
121+
class=item.class
122+
data=item.data %}
120123
{% endfor %}
121124
{% endif %}
122125
<!-- </slot> -->

sortable-files.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{%- if include.source -%}
2-
{%- assign this_source = include.source -%}
2+
{%- assign this_source = include.data -%}
33
{%- else -%}
4-
{%- assign this_source = 'page.attachments' -%}
4+
{%- assign this_source = page.attachments -%}
55
{%- endif -%}
66
<ol
77
id="{{ include.id }}"
@@ -12,7 +12,7 @@
1212
title-summary"
1313
data-pat-sortable="
1414
selector: .sortable-item">
15-
{% for item in this_source %}
15+
{% for attachment in this_source %}
1616
<li
1717
class="
1818
clone
@@ -26,14 +26,14 @@
2626
item-info">
2727
<h1
2828
class="title">
29-
{{ item.title }}
29+
{{ attachment.title | default: 'Title' }}
3030
</h1>
31-
{% if item.summary %}
31+
{% if attachment.summary %}
3232
<div
3333
class="
3434
pat-rich
3535
description">
36-
{{ item.summary }}
36+
{{ attachment.summary }}
3737
</div>
3838
{% endif %}
3939
</article>

0 commit comments

Comments
 (0)