add forms
This commit is contained in:
parent
4346f85d56
commit
5bcef4263e
@ -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:
|
||||||
|
92
user/themes/lecampus/blueprints/sublog.yaml
Normal file
92
user/themes/lecampus/blueprints/sublog.yaml
Normal 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
@ -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();
|
||||||
});
|
});
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -13,12 +13,6 @@
|
|||||||
<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 %}
|
||||||
|
@ -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">
|
||||||
|
@ -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">
|
||||||
|
43
user/themes/lecampus/templates/forms/default/data.html.twig
Normal file
43
user/themes/lecampus/templates/forms/default/data.html.twig
Normal 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, '') }}
|
@ -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 %}
|
|
@ -1 +0,0 @@
|
|||||||
{% extends "forms/default/data.txt.twig" %}
|
|
0
user/themes/lecampus/templates/galerie.html.twig
Normal file
0
user/themes/lecampus/templates/galerie.html.twig
Normal file
37
user/themes/lecampus/templates/mapsalle.html.twig
Normal file
37
user/themes/lecampus/templates/mapsalle.html.twig
Normal 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 %}
|
@ -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 %}
|
||||||
|
35
user/themes/lecampus/templates/sublog.html.twig
Normal file
35
user/themes/lecampus/templates/sublog.html.twig
Normal 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 %}
|
Loading…
x
Reference in New Issue
Block a user