-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
6,434 additions
and
120 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
{# Sub-block for 'text' field such as 'text', 'textarea', or 'html' #} | ||
{% block text_field %} | ||
<div {% if key is not empty %}data-bolt-field="{{ key }}"{% endif %}> | ||
{%- autoescape false -%} | ||
{# If 'allowtwig' is true for this field, we'll need to parse it as Twig here. #} | ||
{% if allowtwig|default(false) %}{{ include(template_from_string(value)) }}{% else %}{{ value }}{% endif -%} | ||
{%- endautoescape -%} | ||
</div> | ||
{% endblock %} | ||
|
||
{# Sub-block for Markdown fields #} | ||
{% block markdown_field %} | ||
<div {% if key is not empty %}data-bolt-field="{{ key }}"{% endif %}> | ||
{# If 'allowtwig' is true for this field, we'll need to parse it as Twig here. #} | ||
{% if allowtwig|default(false) %}{{ include(template_from_string(value))|markdown }}{% else %}{{ value|markdown }}{% endif -%} | ||
</div> | ||
{% endblock %} | ||
|
||
{# Sub-block for 'imagelist' fields #} | ||
{% block imagelist_field %} | ||
<div class="bolt-imagelist"> | ||
{% for image in images %} | ||
<div class="bolt-imageholder"> | ||
{{ popup(image.filename, 200, 0) }} | ||
</div> | ||
{% endfor %} | ||
</div> | ||
{% endblock %} | ||
|
||
{# Block for "basic" fields like HTML, Markdown, Textarea and Text #} | ||
{% block common_fields %} | ||
|
||
{# HTML, Textarea, Text fields #} | ||
{% if fieldtype in ['html', 'textarea', 'text'] %} | ||
{{ block('text_field') }} | ||
{% endif %} | ||
|
||
{# Markdown fields #} | ||
{% if fieldtype == 'markdown' %} | ||
{{ block('markdown_field') }} | ||
{% endif %} | ||
|
||
{# Image fields #} | ||
{% if fieldtype == "image" and value.file|default is not empty %} | ||
{{ popup(value, 1200, 0) }} | ||
{% endif %} | ||
|
||
{# Video fields #} | ||
{% if fieldtype == "video" and value.responsive|default is not empty %} | ||
<div class="flex-video {{ value.ratio|default(1) > 1.5 ? 'widescreen' }}"> | ||
{{ value.responsive }} | ||
</div> | ||
{% endif %} | ||
|
||
{% endblock %} | ||
|
||
{# Block for other field types, like Geo, Select, Checkbox and others. #} | ||
{% block extended_fields %} | ||
|
||
{# Geolocation field #} | ||
{% if fieldtype == "geolocation" and value.latitude|default is not empty %} | ||
<img src="http://maps.googleapis.com/maps/api/staticmap?center={{ value.latitude }},{{ value.longitude }}&zoom=14&size=617x300&sensor=false&markers={{ value.latitude }},{{ value.longitude }}"> | ||
{% endif %} | ||
|
||
{# Special case for 'select' fields: if it's a multiple select, the value is an array. #} | ||
{% if fieldtype == "select" and value is not empty %} | ||
<p><strong>{{ key }}: </strong> | ||
{{ value|join(", ") }} | ||
</p> | ||
{% endif %} | ||
|
||
{# Checkbox fields #} | ||
{% if fieldtype == "checkbox" %} | ||
<p>Checkbox {{ key }}: {{ value ? "checked" : "not checked" }}</p> | ||
{% endif %} | ||
|
||
{# Imagelist fields #} | ||
{% if fieldtype == "imagelist" and value is not empty %} | ||
{{ block('imagelist_field') }} | ||
{% endif %} | ||
|
||
{# No special case defined for this type of field. We just output them, if it's | ||
a simple scalar, and 'dump' them otherwise. #} | ||
{% if fieldtype in [ 'filelist', 'datetime', 'date', 'integer', 'float' ] and value is not empty %} | ||
<p><strong>{{ key }}: </strong> | ||
{% if value is iterable %} | ||
{{ dump(value) }} | ||
{% else %} | ||
{{ value }} | ||
{% endif %} | ||
</p> | ||
{% endif %} | ||
|
||
{% endblock %} |
Oops, something went wrong.