Skip to content
This repository was archived by the owner on Nov 21, 2023. It is now read-only.

Commit 3e04269

Browse files
committed
Add carousel configuration
1 parent 8a82adc commit 3e04269

File tree

11 files changed

+197
-28
lines changed

11 files changed

+197
-28
lines changed

admin/app.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,12 @@ div > div[id*="blocks-field-"] > div:last-child:not(:empty) {
189189
/* TOGGLE FIELD */
190190
[class*=-ControlContainer]:has(> div > [class*=-ToggleContainer]) {
191191
display: flex;
192+
flex-wrap: wrap;
192193
white-space: nowrap;
193194
}
194195
div:has(> [class*=-ToggleContainer]) {
195196
padding-top: 5px;
197+
width: auto
196198
}
197199

198200

@@ -299,6 +301,21 @@ div[id^=documents-field] {
299301
width: 49%;
300302
}
301303

304+
/* CAROUSEL */
305+
[id^=params-field] [class*=-ControlContainer] {
306+
clear: none;
307+
float: left;
308+
margin-right: 2%;
309+
width: 32%;
310+
}
311+
[id^=params-field] [class*=-ControlContainer]:nth-child(3n+1) {
312+
clear: left;
313+
}
314+
[id^=params-field] [class*=-ControlContainer]:nth-child(3n) {
315+
margin-right: 0;
316+
}
317+
318+
302319
/* Keyfeatures */
303320
[id^=keyfeatures-field] {
304321
background-color: var(--lightgrey) !important;

admin/app/blocks/testimonials.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { heading } from '../fields/heading.js'
22
import { quote } from '../fields/quote.js'
33
import { author } from '../fields/author.js'
4+
import { layout } from '../fields/layout.js'
5+
import { carousel } from '../fields/carousel.js'
46
import { background } from '../fields/background.js'
57
import {t} from "../i18n/translater.js";
68

@@ -28,6 +30,8 @@ export const block_testimonials = {
2830
author
2931
]
3032
},
33+
layout,
34+
carousel,
3135
background
3236
]
3337
}

admin/app/fields/breakpoints.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import {t} from "../i18n/translater.js";
2+
3+
export const breakpoints = {
4+
name: 'breakpoints',
5+
label: t.fields.carousel.fields.breakpoints.label,
6+
widget: 'select',
7+
options: [
8+
{ label: t.fields.carousel.fields.breakpoints.options.mobile, value: 640 },
9+
{ label: t.fields.carousel.fields.breakpoints.options.tablet, value: 768 },
10+
{ label: t.fields.carousel.fields.breakpoints.options.wide_tablet, value: 1024 },
11+
{ label: t.fields.carousel.fields.breakpoints.options.laptop, value: 1280 },
12+
{ label: t.fields.carousel.fields.breakpoints.options.desktop, value: 1440 }
13+
],
14+
default: 640,
15+
required: false,
16+
i18n: 'duplicate'
17+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import {t} from "../i18n/translater.js";
2+
3+
export const carousel_params = {
4+
name: 'params',
5+
label: t.fields.carousel.fields.params,
6+
widget: 'object',
7+
required: false,
8+
i18n: true,
9+
collapsed: false,
10+
fields: [
11+
{ name: 'focus', label: t.fields.carousel.fields.focus.label, hint: t.fields.carousel.fields.focus.hint, widget: 'boolean', options: [ 'slide', 'loop', 'fade' ], required: false, i18n: 'duplicate' },
12+
{ name: 'autoplay', label: t.fields.carousel.fields.autoplay, widget: 'boolean', required: false, i18n: 'duplicate' },
13+
{ name: 'arrows', label: t.fields.carousel.fields.arrows, widget: 'boolean', required: false, i18n: 'duplicate' },
14+
{ name: 'pagination', label: t.fields.carousel.fields.pagination, widget: 'boolean', default: true, required: false, i18n: 'duplicate' },
15+
{ name: 'type', label: t.fields.carousel.fields.type, widget: 'select', options: [ 'slide', 'loop', 'fade' ], required: false, i18n: 'duplicate' },
16+
{ name: 'perPage', label: t.fields.carousel.fields.perPage.label, hint: t.fields.carousel.fields.perPage.hint, widget: 'number', min: 1, required: false, i18n: 'duplicate' },
17+
{ name: 'padding', label: t.fields.carousel.fields.padding.label, hint: t.fields.carousel.fields.padding.hint, widget: 'number', min: 0, hint: 'Exprimé en rem', required: false, i18n: 'duplicate' },
18+
{ name: 'gap', label: t.fields.carousel.fields.gap.label, hint: t.fields.carousel.fields.gap.hint, widget: 'number', min: 0, hint: 'Exprimé en rem', required: false, i18n: 'duplicate' },
19+
]
20+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { breakpoints } from './breakpoints.js'
2+
import { carousel_params } from './carousel-params.js'
3+
import {t} from "../i18n/translater.js";
4+
5+
export const carousel_responsive = {
6+
name: 'responsive',
7+
label: t.fields.carousel.fields.responsive,
8+
widget: 'list',
9+
required: false,
10+
i18n: true,
11+
collapsed: true,
12+
fields: [
13+
breakpoints,
14+
carousel_params
15+
]
16+
}

admin/app/fields/carousel.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { carousel_params } from './carousel-params.js'
2+
import { carousel_responsive } from './carousel-responsive.js';
3+
import {t} from "../i18n/translater.js";
4+
5+
export const carousel = {
6+
name: 'carousel',
7+
label: t.fields.carousel.label,
8+
widget: 'object',
9+
required: false,
10+
i18n: true,
11+
collapsed: true,
12+
fields: [
13+
carousel_params,
14+
carousel_responsive
15+
]
16+
}

admin/app/fields/layout.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@ import {t} from "../i18n/translater.js";
22

33
export const layout = {
44
name: 'layout',
5-
label: t.fields.layout,
5+
label: t.fields.layout.label,
66
widget: 'select',
7-
options: ['blocks'],
8-
required: false,
7+
options: [
8+
{ label: t.fields.layout.options.carousel, value: 'carousel' },
9+
{ label: t.fields.layout.options.grid, value: 'grid' }
10+
],
11+
default: 'grid',
912
i18n: 'duplicate'
1013
}

admin/app/i18n/en/blocks.js

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export const blocks = {
44
label: "Content blocs",
55
label_singular: "Content bloc",
66
},
7+
carousel: "Carousel",
78
chart: "Chart (Pie, bar…)",
89
cta: "Call to action (Button)",
910
datas: {
@@ -102,18 +103,10 @@ export const blocks = {
102103
newsletter: {
103104
label: "Newsletter",
104105
fields: {
105-
platform: {
106-
label: "Platform",
107-
options: {
108-
sendinblue: "Brevo (ex Sendinblue)",
109-
mailchimp: "Mailchimp",
110-
}
111-
},
106+
form: "Form",
107+
url: "Form URL",
112108
hiddens: {
113-
label: "Hidden fields in form",
114-
fields: {
115-
name: 'Name'
116-
}
109+
label: "Hidden fields in form"
117110
}
118111
}
119112
},

admin/app/i18n/en/fields.js

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,44 @@ export const fields = {
2828
background_color: "Background color",
2929
blank: "Open in new page?",
3030
body: "Body",
31+
carousel: {
32+
label: "Carousel configuration",
33+
fields: {
34+
arrows: "Arrows",
35+
autoplay: "Autoplay",
36+
breakpoints: {
37+
label: "Breakpoints",
38+
hint: "Screen dimension (maximum)",
39+
options: {
40+
mobile: "Mobile",
41+
tablet: "Tablet",
42+
wide_tablet: "Wide tablet",
43+
laptop: "Laptop",
44+
desktop: "Desktop",
45+
}
46+
},
47+
focus: {
48+
label: "Focus",
49+
hint: "Le slide actif est-il au centre de l’écran ?"
50+
},
51+
gap: {
52+
label: "Padding",
53+
hint: "The gap between slides. In rem value."
54+
},
55+
padding: {
56+
label: "Padding",
57+
hint: "Padding left/right of the carousel. In rem value"
58+
},
59+
pagination: "Pagination",
60+
params: "Params",
61+
perPage: {
62+
label: "Per page",
63+
hint: "Number of slides to display"
64+
},
65+
responsive: "Responsive",
66+
type: "Type",
67+
}
68+
},
3169
casestudies: "Case studies",
3270
categories: "Categories",
3371
chart: {
@@ -155,7 +193,13 @@ export const fields = {
155193
label: "Key features",
156194
hint: "e.g.: Location, light…",
157195
},
158-
layout: "Layout",
196+
layout: {
197+
label: "Layout",
198+
options: {
199+
carousel: "Carousel",
200+
grid: "Grid"
201+
}
202+
},
159203
layout_blocks: "Layout",
160204
legend: "Legend",
161205
limit: {
@@ -176,6 +220,7 @@ export const fields = {
176220
label: "Icon",
177221
hint: "Name of the icon, doc : https://fonts.google.com/icons?icon.set=Material+Icons"
178222
},
223+
name: "Name",
179224
offer: "Offer",
180225
offset: {
181226
label: "Offset",

admin/app/i18n/fr/blocks.js

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export const blocks = {
44
label: "Blocs de contenu",
55
label_singular: "Bloc de contenu",
66
},
7+
carousel: "Carrousel",
78
chart: "Graphique (Camembert, barre…)",
89
cta: "Appel à l’action (Bouton)",
910
datas: {
@@ -102,18 +103,10 @@ export const blocks = {
102103
newsletter: {
103104
label: "Newsletter",
104105
fields: {
105-
platform: {
106-
label: "Plateforme",
107-
options: {
108-
sendinblue: "Brevo (ex Sendinblue)",
109-
mailchimp: "Mailchimp",
110-
}
111-
},
106+
form: "Formulaire",
107+
url: "URL du formulaire",
112108
hiddens: {
113-
label: "Champ caché du formulaire",
114-
fields: {
115-
name: 'Nom'
116-
}
109+
label: "Champ caché du formulaire"
117110
}
118111
}
119112
},

0 commit comments

Comments
 (0)