Autoformatted some twigs

This commit is contained in:
pikim 2023-01-20 00:03:51 +01:00
parent 3667a1526b
commit 3318a38408
6 changed files with 108 additions and 95 deletions

View file

@ -4,36 +4,35 @@
{% endblock %} {% endblock %}
{% block input %} {% block input %}
{% set id = field.id|default(field.name) ~ '-' ~ key %} {% set id = field.id|default(field.name) ~ '-' ~ key %}
<div class="{{ form_field_wrapper_classes ?: 'form-input-wrapper' }} {{ field.size }} {{ field.wrapper_classes }}">
<input
{# required attribute structures #}
name="{{ (scope ~ field.name)|fieldName }}"
value="{{ field.value ?? '1' }}"
type="checkbox"
{% if value == field.value ?? '1' %} checked="checked" {% endif %}
{# input attribute structures #} <div class="{{ form_field_wrapper_classes ?: 'form-input-wrapper' }} {{ field.size }} {{ field.wrapper_classes }}">
{% block input_attributes %} <input
id="{{ id|e }}" {# required attribute structures #}
{% if field.classes is defined %}class="{{ field.classes }}" {% endif %} name="{{ (scope ~ field.name)|fieldName }}"
{% if field.style is defined %}style="{{ field.style|e }}" {% endif %} value="{{ field.value ?? '1' }}"
{% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %} type="checkbox"
{% if field.autofocus in ['on', 'true', 1] %}autofocus="autofocus"{% endif %} {% if value == field.value ?? '1' %} checked="checked" {% endif %}
{% if field.novalidate in ['on', 'true', 1] %}novalidate="novalidate"{% endif %}
{% if required %}required="required"{% endif %} {# input attribute structures #}
{% if field.tabindex %}tabindex="{{ field.tabindex }}"{% endif %} {% block input_attributes %}
{% endblock %} id="{{ id|e }}"
/> {% if field.classes is defined %}class="{{ field.classes }}" {% endif %}
<label style="display:inline;" for="{{ id|e }}"> {% if field.style is defined %}style="{{ field.style|e }}" {% endif %}
{% if field.markdown %} {% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}
{{ field.label|t|markdown(false) }} {% if field.autofocus in ['on', 'true', 1] %}autofocus="autofocus"{% endif %}
{% else %} {% if field.novalidate in ['on', 'true', 1] %}novalidate="novalidate"{% endif %}
{{'FUTURE.PRIVACY'|t}} <a href="{{base_url}}/privacy">{{field.label}}</a> {% if required %}required="required"{% endif %}
{% endif %} {% if field.tabindex %}tabindex="{{ field.tabindex }}"{% endif %}
{{ field.validate.required in ['on', 'true', 1] ? '<span class="required">*</span>' }} {% endblock %}
</label> />
</div> <label style="display:inline;" for="{{ id|e }}">
{% if field.markdown %}
{{ field.label|t|markdown(false) }}
{% else %}
{{'FUTURE.PRIVACY'|t}} <a href="{{base_url}}/privacy">{{field.label}}</a>
{% endif %}
{{ field.validate.required in ['on', 'true', 1] ? '<span class="required">*</span>' }}
</label>
</div>
{% endblock %} {% endblock %}

View file

@ -1,24 +1,31 @@
{% macro nav_loop(page) %} {% macro nav_loop(page) %}
{% import _self as macros %} {% import _self as macros %}
{% for p in page.children.visible %} {% for p in page.children.visible %}
{% set current_page = (p.active or p.activeChild) ? 'active' : '' %} {% set current_page = (p.active or p.activeChild) ? 'active' : '' %}
{% if p.children.visible.count > 0 %} {% if p.children.visible.count > 0 %}
<li class="{{ current_page }}"> <li class="{{ current_page }}">
<a> <a>
{% if p.header.icon %}<i class="fa fa-{{ p.header.icon }}"></i>{% endif %} {% if p.header.icon %}
<span>{{ p.menu }}{% if p.routable ?? false %}&nbsp;<i class="fa fa-angle-down"></i>{% endif %}</span> <i class="fa fa-{{ p.header.icon }}"></i>
</a> {% endif %}
<ul> <span>{{ p.menu }}
{{ macros.nav_loop(p) }} {% if p.routable ?? false %}&nbsp;<i class="fa fa-angle-down"></i>
</ul> {% endif %}
</li> </span>
{% else %} </a>
<li class="{{ current_page }}"> <ul>
<a href="{{ p.url }}"> {{ macros.nav_loop(p) }}
{% if p.header.icon %}<i class="fa fa-{{ p.header.icon }}"></i>{% endif %} </ul>
<span>{{ p.menu }}</span> </li>
</a> {% else %}
</li> <li class="{{ current_page }}">
{% endif %} <a href="{{ p.url }}">
{% endfor %} {% if p.header.icon %}
{% endmacro %} <i class="fa fa-{{ p.header.icon }}"></i>
{% endif %}
<span>{{ p.menu }}</span>
</a>
</li>
{% endif %}
{% endfor %}
{% endmacro %}

View file

@ -1,25 +1,25 @@
<section id="banner"> <section id="banner">
<div class="content"> <div class="content">
<header> <header>
<h2>{{ page.title}}</h2> <h2>{{ page.title}}</h2>
{% if page.header.subtitle %} {% if page.header.subtitle %}
<p>{{ page.header.subtitle }}</p> <p>{{ page.header.subtitle }}</p>
{% endif %} {% endif %}
</header> </header>
{{page.content|raw}} {{page.content|raw}}
<ul class="actions"> <ul class="actions">
<li><a href="{{page.header.buttonurl}}" class="button">{{page.header.buttontext}}</a></li> <li><a href="{{page.header.buttonurl}}" class="button">{{page.header.buttontext}}</a></li>
</ul> </ul>
</div> </div>
{% if page.header.image %} {% if page.header.image %}
<span class="image object fit"> <span class="image object fit">
{{page.media[page.header.image].loading('lazy').html('',page.title)|raw}} {{page.media[page.header.image].loading('lazy').html('',page.title)|raw}}
</span> </span>
{% else %} {% else %}
<span class="image object fit"> <span class="image object fit">
{{page.media[page.header.primaryImage].loading('lazy').html('',page.title)|raw}} {{page.media[page.header.primaryImage].loading('lazy').html('',page.title)|raw}}
</span> </span>
{% endif %} {% endif %}
</section> </section>

View file

@ -1,5 +1,5 @@
<section id="contact"> <section id="contact">
<p>{{ page.content|raw }}</p> <p>{{ page.content|raw }}</p>
{% include "forms/form.html.twig" with { form: forms('contact-form')} %} {% include "forms/form.html.twig" with { form: forms('contact-form')} %}
</section> </section>
<br> <br>

View file

@ -1,30 +1,37 @@
{% set columns = page.header.layout == 'standard' ? 'col-4 col-6-medium col-12-small' : 'col-6 col-12-small' %} {% set columns = page.header.layout == 'standard' ? 'col-4 col-6-medium col-12-small' : 'col-6 col-12-small' %}
<section id="features"> <section id="features">
<header> <header>
<h2>{{ page.title }}</h2> <h2>{{ page.title }}</h2>
{% if page.header.subtitle %} {% if page.header.subtitle %}
<p>{{ page.header.subtitle }}</p> <p>{{ page.header.subtitle }}</p>
{% endif %} {% endif %}
</header> </header>
{{ content|raw }} {{ content|raw }}
<div class="row gtr-uniform"> <div class="row gtr-uniform">
{% for feature in page.header.features %} {% for feature in page.header.features %}
<div class="{{columns}}">
<div class="{{columns}}">
<article class="box"> <article class="box">
{% if feature.image %}<span class="image fit"><img src="{{page.media[feature.image].url}}" alt="{{feature.title}}" /></span>{% endif %} {% if feature.image %}
<header> <span class="image fit"><img src="{{page.media[feature.image].url}}" alt="{{feature.title}}"/></span>
{% if feature.title %}<h3>{{feature.title}}</h3>{% endif %} {% endif %}
{% if feature.text %}<p>{{feature.text|raw}}</p>{% endif %} <header>
{% if feature.buttonurl %}<p><a href="{{feature.buttonurl}}" class="button fit" target={% if feature.buttonurl_target %}"_blank"{% endif%}>{{feature.buttontext}}</a></p>{% endif %} {% if feature.title %}
</header> <h3>{{feature.title}}</h3>
{% endif %}
{% if feature.text %}
<p>{{feature.text|raw}}</p>
{% endif %}
{% if feature.buttonurl %}
<p>
<a href="{{feature.buttonurl}}" class="button fit" target={% if feature.buttonurl_target %} "_blank" {% endif%}>{{feature.buttontext}}</a>
</p>
{% endif %}
</header>
</article> </article>
</div> </div>
{% endfor %} {% endfor %}
</div> </div>
</section> </section>
<br> <br>

View file

@ -1,4 +1,4 @@
<ul class="icons"> <ul class="icons">
{% include 'partials/social.html.twig' %} {% include 'partials/social.html.twig' %}
</ul> </ul>
<p class="copyright">&copy; {{ "now"|date("Y") }} {{ site.author.name }}. {{config.theme.footer.copyright_text|raw}}.</p> <p class="copyright">&copy; {{ "now"|date("Y") }} {{ site.author.name }}. {{config.theme.footer.copyright_text|raw}}.</p>