mirror of
https://github.com/pmoreno-rodriguez/grav-theme-future2021.git
synced 2025-06-07 20:08:54 +00:00
Autoformatted some twigs
This commit is contained in:
parent
3667a1526b
commit
3318a38408
6 changed files with 108 additions and 95 deletions
|
@ -4,36 +4,35 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block input %}
|
||||
{% 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 %}
|
||||
{% set id = field.id|default(field.name) ~ '-' ~ key %}
|
||||
|
||||
{# input attribute structures #}
|
||||
{% block input_attributes %}
|
||||
id="{{ id|e }}"
|
||||
{% if field.classes is defined %}class="{{ field.classes }}" {% endif %}
|
||||
{% if field.style is defined %}style="{{ field.style|e }}" {% endif %}
|
||||
{% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}
|
||||
{% if field.autofocus in ['on', 'true', 1] %}autofocus="autofocus"{% endif %}
|
||||
{% if field.novalidate in ['on', 'true', 1] %}novalidate="novalidate"{% endif %}
|
||||
{% if required %}required="required"{% endif %}
|
||||
{% if field.tabindex %}tabindex="{{ field.tabindex }}"{% endif %}
|
||||
{% endblock %}
|
||||
/>
|
||||
<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>
|
||||
|
||||
<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 #}
|
||||
{% block input_attributes %}
|
||||
id="{{ id|e }}"
|
||||
{% if field.classes is defined %}class="{{ field.classes }}" {% endif %}
|
||||
{% if field.style is defined %}style="{{ field.style|e }}" {% endif %}
|
||||
{% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}
|
||||
{% if field.autofocus in ['on', 'true', 1] %}autofocus="autofocus"{% endif %}
|
||||
{% if field.novalidate in ['on', 'true', 1] %}novalidate="novalidate"{% endif %}
|
||||
{% if required %}required="required"{% endif %}
|
||||
{% if field.tabindex %}tabindex="{{ field.tabindex }}"{% endif %}
|
||||
{% endblock %}
|
||||
/>
|
||||
<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 %}
|
||||
|
|
|
@ -1,24 +1,31 @@
|
|||
{% macro nav_loop(page) %}
|
||||
{% import _self as macros %}
|
||||
{% import _self as macros %}
|
||||
{% for p in page.children.visible %}
|
||||
{% set current_page = (p.active or p.activeChild) ? 'active' : '' %}
|
||||
{% if p.children.visible.count > 0 %}
|
||||
<li class="{{ current_page }}">
|
||||
<a>
|
||||
{% if p.header.icon %}<i class="fa fa-{{ p.header.icon }}"></i>{% endif %}
|
||||
<span>{{ p.menu }}{% if p.routable ?? false %} <i class="fa fa-angle-down"></i>{% endif %}</span>
|
||||
</a>
|
||||
<ul>
|
||||
{{ macros.nav_loop(p) }}
|
||||
</ul>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="{{ current_page }}">
|
||||
<a href="{{ p.url }}">
|
||||
{% if p.header.icon %}<i class="fa fa-{{ p.header.icon }}"></i>{% endif %}
|
||||
<span>{{ p.menu }}</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endmacro %}
|
||||
{% set current_page = (p.active or p.activeChild) ? 'active' : '' %}
|
||||
{% if p.children.visible.count > 0 %}
|
||||
<li class="{{ current_page }}">
|
||||
<a>
|
||||
{% if p.header.icon %}
|
||||
<i class="fa fa-{{ p.header.icon }}"></i>
|
||||
{% endif %}
|
||||
<span>{{ p.menu }}
|
||||
{% if p.routable ?? false %} <i class="fa fa-angle-down"></i>
|
||||
{% endif %}
|
||||
</span>
|
||||
</a>
|
||||
<ul>
|
||||
{{ macros.nav_loop(p) }}
|
||||
</ul>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="{{ current_page }}">
|
||||
<a href="{{ p.url }}">
|
||||
{% if p.header.icon %}
|
||||
<i class="fa fa-{{ p.header.icon }}"></i>
|
||||
{% endif %}
|
||||
<span>{{ p.menu }}</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endmacro %}
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
<section id="banner">
|
||||
<div class="content">
|
||||
<header>
|
||||
<h2>{{ page.title}}</h2>
|
||||
{% if page.header.subtitle %}
|
||||
<p>{{ page.header.subtitle }}</p>
|
||||
{% endif %}
|
||||
</header>
|
||||
<div class="content">
|
||||
<header>
|
||||
<h2>{{ page.title}}</h2>
|
||||
{% if page.header.subtitle %}
|
||||
<p>{{ page.header.subtitle }}</p>
|
||||
{% endif %}
|
||||
</header>
|
||||
|
||||
{{page.content|raw}}
|
||||
|
||||
<ul class="actions">
|
||||
<li><a href="{{page.header.buttonurl}}" class="button">{{page.header.buttontext}}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
{% if page.header.image %}
|
||||
<span class="image object fit">
|
||||
{{page.media[page.header.image].loading('lazy').html('',page.title)|raw}}
|
||||
</span>
|
||||
{% else %}
|
||||
<span class="image object fit">
|
||||
{{page.media[page.header.primaryImage].loading('lazy').html('',page.title)|raw}}
|
||||
</span>
|
||||
{% endif %}
|
||||
{{page.content|raw}}
|
||||
|
||||
<ul class="actions">
|
||||
<li><a href="{{page.header.buttonurl}}" class="button">{{page.header.buttontext}}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
{% if page.header.image %}
|
||||
<span class="image object fit">
|
||||
{{page.media[page.header.image].loading('lazy').html('',page.title)|raw}}
|
||||
</span>
|
||||
{% else %}
|
||||
<span class="image object fit">
|
||||
{{page.media[page.header.primaryImage].loading('lazy').html('',page.title)|raw}}
|
||||
</span>
|
||||
{% endif %}
|
||||
</section>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<section id="contact">
|
||||
<p>{{ page.content|raw }}</p>
|
||||
{% include "forms/form.html.twig" with { form: forms('contact-form')} %}
|
||||
<p>{{ page.content|raw }}</p>
|
||||
{% include "forms/form.html.twig" with { form: forms('contact-form')} %}
|
||||
</section>
|
||||
<br>
|
||||
|
|
|
@ -1,30 +1,37 @@
|
|||
{% set columns = page.header.layout == 'standard' ? 'col-4 col-6-medium col-12-small' : 'col-6 col-12-small' %}
|
||||
|
||||
<section id="features">
|
||||
<header>
|
||||
<header>
|
||||
<h2>{{ page.title }}</h2>
|
||||
{% if page.header.subtitle %}
|
||||
<p>{{ page.header.subtitle }}</p>
|
||||
<p>{{ page.header.subtitle }}</p>
|
||||
{% endif %}
|
||||
</header>
|
||||
{{ content|raw }}
|
||||
</header>
|
||||
{{ content|raw }}
|
||||
|
||||
<div class="row gtr-uniform">
|
||||
<div class="row gtr-uniform">
|
||||
{% for feature in page.header.features %}
|
||||
|
||||
<div class="{{columns}}">
|
||||
<div class="{{columns}}">
|
||||
<article class="box">
|
||||
{% if feature.image %}<span class="image fit"><img src="{{page.media[feature.image].url}}" alt="{{feature.title}}" /></span>{% endif %}
|
||||
<header>
|
||||
{% if feature.title %}<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>
|
||||
{% if feature.image %}
|
||||
<span class="image fit"><img src="{{page.media[feature.image].url}}" alt="{{feature.title}}"/></span>
|
||||
{% endif %}
|
||||
<header>
|
||||
{% if feature.title %}
|
||||
<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>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
<br>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<ul class="icons">
|
||||
{% include 'partials/social.html.twig' %}
|
||||
{% include 'partials/social.html.twig' %}
|
||||
</ul>
|
||||
<p class="copyright">© {{ "now"|date("Y") }} {{ site.author.name }}. {{config.theme.footer.copyright_text|raw}}.</p>
|
||||
|
|
Loading…
Add table
Reference in a new issue