add forms

This commit is contained in:
Kevin Tessier 2019-04-09 18:05:36 +02:00
parent 4346f85d56
commit 5bcef4263e
17 changed files with 281 additions and 46 deletions

View File

@ -3,6 +3,23 @@ extends@: default
form: form:
fields: fields:
tabs: tabs:
fields:
content:
fields:
header.buttons:
name: galerie
type: list
style: vertical
label: Galerie
fields:
.text:
type: text
label: Descriptions
.header.a_file:
type: filepicker
folder: '@self'
preview_images: true
label: Select a file
fields: fields:
advanced: advanced:
fields: fields:
@ -12,4 +29,4 @@ form:
fields: fields:
header.body_classes: header.body_classes:
markdown: true markdown: true
description: 'Available classes in Quark Theme (space separated):<br />`header-fixed`, `header-animated`, `header-dark`, `header-transparent`, `sticky-footer`' description: 'Available classes in Quark Theme (space separated):<br />`header-fixed`, `header-animated`, `header-dark`, `header-transparent`, `sticky-footer`'

View File

@ -0,0 +1,92 @@
extends@: default
child_type: item
rules:
slug:
pattern: "[a-z][a-z0-9_\-]+"
min: 2
max: 80
form:
fields:
tabs:
type: tabs
active: 1
fields:
advanced:
fields:
overrides:
fields:
header.child_type:
default: item
blog:
type: tab
title: Blog Config
fields:
content_title:
type: spacer
title: Content Definition
header.content.items:
type: textarea
yaml: true
label: Items
default: '@self.children'
validate:
type: yaml
header.content.limit:
type: text
label: Max Item Count
default: 5
validate:
required: true
type: int
min: 1
header.content.order.by:
type: select
label: Order By
default: date
options:
folder: Folder
title: Title
date: Date
default: Default
header.content.order.dir:
type: select
label: Order
default: desc
options:
asc: Ascending
desc: Descending
header.content.pagination:
type: toggle
label: Pagination
highlight: 1
default: 1
options:
1: PLUGIN_ADMIN.ENABLED
0: PLUGIN_ADMIN.DISABLED
validate:
type: bool
header.content.url_taxonomy_filters:
type: toggle
label: URL Taxonomy Filters
highlight: 1
default: 1
options:
1: PLUGIN_ADMIN.ENABLED
0: PLUGIN_ADMIN.DISABLED
validate:
type: bool
import@:
type: partials/blog-bits
context: blueprints://pages

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -54,9 +54,9 @@ function slide() {
} }
function links() { function links() {
href="/organisez-vos-evenements" var $a = $('li a[href="/organisez-vos-evenements"],li a[href="/qui-sommes-nous"] ');
var $a = $('li a[href="/organisez-vos-evenements"]');
var $map = $('a#carte'); var $map = $('a#carte');
$a.on('click', function(e) { $a.on('click', function(e) {
e.preventDefault(); e.preventDefault();
}) })
@ -65,12 +65,11 @@ function links() {
e.preventDefault(); e.preventDefault();
}) })
} }
jQuery(document).ready(function($){ jQuery(document).ready(function($){
links(); links();
slide(); slide();
filteritem(); filteritem();
map(); // map();
}); });

View File

@ -36,6 +36,14 @@
} }
} }
} }
.title{
position: absolute;
right: 50px;
width: 33%;
background: white;
padding: 40px;
top: 200px;
}
} }
.cat{ .cat{
@ -110,7 +118,7 @@
} }
} }
.content{ .content, .content_s{
width: 40%; width: 40%;
margin: 0px 20px 20px auto; margin: 0px 20px 20px auto;
p{ p{
@ -118,6 +126,10 @@
} }
} }
.content_s{
margin: auto!important;
}
#default{ #default{
.content{ .content{
& > p{ & > p{
@ -169,6 +181,11 @@
border-top: 1px solid black; border-top: 1px solid black;
margin-bottom: 20px; margin-bottom: 20px;
margin-top: 20px; margin-top: 20px;
& > img{
width: 33%;
float: left;
margin: 20px 10px 0px 0px;
}
h3{ h3{
margin-top: 20px; margin-top: 20px;
} }

View File

@ -13,17 +13,11 @@
<div class="content"> <div class="content">
<h2>{{page.title}}</h2> <h2>{{page.title}}</h2>
{{content}} {{content}}
{% for item in page.collection %}
<div class="sub-content">
<h3>{{item.title}}</h3>
{{item.content}}
</div>
{% endfor %}
</div> </div>
{% block sidebar %} {% block sidebar %}
{% include 'partials/sidebar.html.twig' %} {% include 'partials/sidebar.html.twig' %}
{% endblock %} {% endblock %}
</section> </section>
{% endblock %} {% endblock %}

View File

@ -4,11 +4,15 @@
{% block content %} {% block content %}
<div class="gal"> <div class="gal">
{% if image %} {% for feature in page.header.buttons %}
{% for images in image %} {% set gal = feature.header.a_file %}
{{ images }} <div class="content_gal">
<div class="title">
<h2>{{ feature.text }}</h2>
</div>
<img src="user/pages/01.home/{{gal}}" alt="">
</div>
{% endfor %} {% endfor %}
{% endif %}
</div> </div>
<div class="content"> <div class="content">

View File

@ -1,7 +1,7 @@
{% set collection = page.collection() %} {% set collection = page.collection() %}
{% set image = page.media.images|first %} {% set image = page.media.images|first %}
{% for item in page.collection if page.template == "footer" %} {% for item in collection if page.template == "footer" %}
{{item.title}} {{item.title}}
{% endfor %} {% endfor %}
<section id="footer" class="section blog-listing"> <section id="footer" class="section blog-listing">

View File

@ -0,0 +1,43 @@
{% macro render_field(form, fields, scope) %}
{% for index, field in fields %}
{% set input = attribute(field, "input@") %}
{% if input is null or input == true %}
{% if form.value(scope ~ field.name) %}
{% block field %}
<div>
{% block field_label %}
<strong>{{ field.name|t|e }}</strong>:
{% endblock %}
{% block field_value %}
{% if field.type == 'checkboxes' %}
<ul>
{% set use_keys = field.use is defined and field.use == 'keys' %}
{% for key,value in form.value(scope ~ field.name) %}
{% set index = (use_keys ? key : value) %}
<li>{{ field.options[index]|e }}</li>
{% endfor %}
</ul>
{% elseif field.type == 'checkbox' %}
{{ (form.value(scope ~ field.name) == 1) ? "PLUGIN_FORM.YES"|t|e : "PLUGIN_FORM.NO"|t|e }}
{% elseif field.type == 'select' %}
{{ field.options[form.value(scope ~ field.name)]|e }}
{% else %}
{{ string(form.value(scope ~ field.name))|nl2br }}
{% endif %}
{% endblock %}
</div>
{% endblock %}
{% endif %}
{% else %}
{% if field.fields %}
{% set new_scope = field.nest_id ? scope ~ field.name ~ '.' : scope %}
{{ _self.render_field(form, field.fields, new_scope) }}
{% endif %}
{% endif %}
{% endfor %}
{% endmacro %}
{{ _self.render_field(form, form.fields, '') }}

View File

@ -1,17 +0,0 @@
{%- macro render_field(form, fields, scope) %}
{%- for index, field in fields %}
{%- set input = attribute(field, "input@") %}
{%- if input is null or input == true %}
{%- set value = form.value(scope ~ (field.name ?? index)) %}
{{- scope ~ (field.name ?? index) }}: {{ string(value is iterable ? value|json_encode : value|escape('yaml')) ~ "\r\n" }}
{%- else %}
{%- if field.fields %}
{%- set new_scope = field.nest_id ? scope ~ field.name ~ '.' : scope -%}
{{- _self.render_field(form, field.fields, new_scope) }}
{%- endif %}
{%- endif %}
{%- endfor %}
{%- endmacro %}
{%- autoescape false %}
{{- _self.render_field(form, form.fields, '') ~ "\r\n" }}
{%- endautoescape %}

View File

@ -1 +0,0 @@
{% extends "forms/default/data.txt.twig" %}

View File

@ -0,0 +1,37 @@
{% extends 'partials/base.html.twig' %}
{% set blog = page.find(header_var('blog_url')|defined(theme_var('blog-page'))) %}
{% set show_breadcrumbs = header_var('show_breadcrumbs', [page, blog])|defined(true) %}
{% set show_sidebar = header_var('show_sidebar', [page, blog])|defined(true) %}
{% set show_pagination = header_var('show_pagination', [page, blog])|defined(true) %}
{% set hero_image_name = page.header.hero_image %}
{% block hero %}
{% if hero_image_name %}
{% set hero_image = page.media[hero_image_name] %}
{% set content %}
<h1>{{ page.title }}</h1>
<h2>{{ page.header.subtitle }}</h2>
{% include 'partials/blog/date.html.twig' %}
{% include 'partials/blog/taxonomy.html.twig' %}
{% endset %}
{% include 'partials/hero.html.twig' with {id: 'blog-hero'} %}
{% endif %}
{% endblock %}
{% block body %}
{% if show_breadcrumbs and config.plugins.breadcrumbs.enabled %}
{% include 'partials/breadcrumbs.html.twig' %}
{% endif %}
{% embed 'partials/layout.html.twig' %}
{% block item %}
{% include 'partials/blog-item.html.twig' %}
{% endblock %}
{% endembed %}
{% for child in page.collection %}
{{child.content}}
{% endfor %}
{% endblock %}

View File

@ -5,8 +5,8 @@
{{ image.html }} {{ image.html }}
</div> </div>
{% endif %} {% endif %}
{% if not hero_image_name %} {% if not hero_image_name and not show_sidebar %}
<div class="content"> <div class="content_s">
{% include 'partials/blog/title.html.twig' with {title_level: 'h2'} %} {% include 'partials/blog/title.html.twig' with {title_level: 'h2'} %}
{% if page.header.subtitle %} {% if page.header.subtitle %}
<h3 >{{ page.header.subtitle }}</h3> <h3 >{{ page.header.subtitle }}</h3>
@ -14,3 +14,12 @@
{{ page.content|raw }} {{ page.content|raw }}
</div> </div>
{% endif %} {% endif %}
{% if not hero_image_name and show_sidebar %}
<div class="content">
{% include 'partials/blog/title.html.twig' with {title_level: 'h2'} %}
{% if page.header.subtitle %}
<h3 >{{ page.header.subtitle }}</h3>
{% endif %}
{{ page.content|raw }}
</div>
{% endif %}

View File

@ -14,7 +14,7 @@
<div class="card-title"> <div class="card-title">
{% include 'partials/blog/title.html.twig' with {title_level: 'h5'} %} {% include 'partials/blog/title.html.twig' with {title_level: 'h5'} %}
{% include 'partials/blog/date.html.twig' %} {% include 'partials/blog/date.html.twig' %}
</div> </div>
<div class="card-summary"> <div class="card-summary">
<a href="{{ page.url }}"> <a href="{{ page.url }}">
{% if page.summary != page.content %} {% if page.summary != page.content %}

View File

@ -0,0 +1,35 @@
{% extends 'partials/base.html.twig' %}
{% set collection = page.collection() %}
{% set image = page.media.images|first %}
{% block body %}
<section id="item" class="section blog-listing">
<div class="bandeau">
{% if image %}
{{image.html}}
{% endif %}
</div>
<div class="content">
<h2>{{page.title}}</h2>
{{content}}
{% for item in page.collection %}
<div class="sub-content">
{% set child_image = item.media.images|first %}
{% if image %}
{{child_image.html}}
{% endif %}
<h3>{{item.title}}</h3>
{{item.content}}
</div>
{% endfor %}
</div>
{% block sidebar %}
{% include 'partials/sidebar.html.twig' %}
{% endblock %}
</section>
{% endblock %}