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

Commit c9f0cb2

Browse files
authored
Merge pull request #16 from Hugolify/feature/services
Ajout des services dans le cms
2 parents 7beeb4e + 94c3026 commit c9f0cb2

15 files changed

+181
-7
lines changed

admin/app.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,3 +463,9 @@ aside [href="#/collections/realestates_sellers"] span::before {
463463
aside [href="#/collections/realestates_categories"] span::before {
464464
content: '\F1A4';
465465
}
466+
aside [href="#/collections/services"] span::before {
467+
content: '\F4D6';
468+
}
469+
aside [href="#/collections/services_categories"] span::before {
470+
content: '\F1A4';
471+
}

admin/app/blocks/selected-services.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { background } from "../fields/background.js";
2+
import { heading } from "../fields/heading.js";
3+
import { services } from "../fields/services.js";
4+
import { show_more } from "../fields/show-more.js";
5+
import { t } from "../i18n/translater.js";
6+
7+
export const block_selectedservices = {
8+
name: "selected-services",
9+
label: t.blocks.selectedservices,
10+
widget: "object",
11+
required: false,
12+
i18n: true,
13+
collapsed: false,
14+
summary: "{{heading.title}}",
15+
fields: [
16+
heading,
17+
{ name: "section", default: "services", widget: "hidden" },
18+
services,
19+
show_more,
20+
background,
21+
],
22+
};

admin/app/content/services.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { body } from '../fields/body.js'
2+
import { description } from '../fields/description.js'
3+
import { draft } from '../fields/draft.js'
4+
import { featured_image } from '../fields/featured-image.js'
5+
import { isNotIndex } from '../fields/is-not-index.js'
6+
import { services_categories } from '../fields/services_categories.js'
7+
import { services_persons } from '../fields/services_persons.js'
8+
import { title } from '../fields/title.js'
9+
import { t } from '../i18n/translater.js'
10+
11+
const services = {
12+
name: 'services',
13+
label: t.content.services.label,
14+
label_singular: t.content.services.label_singular,
15+
folder: 'content/services',
16+
create: true,
17+
description: t.content.services.description,
18+
19+
editor: { preview: false },
20+
i18n: true,
21+
22+
nested: { depth: 2 },
23+
filter: { field: 'isIndex', value: false },
24+
25+
slug: '{{slug}}',
26+
sortable_fields: ['title'],
27+
summary: '{{title}}',
28+
29+
fields: [
30+
isNotIndex,
31+
draft,
32+
title,
33+
services_categories,
34+
services_persons,
35+
description,
36+
body,
37+
featured_image
38+
]
39+
}
40+
41+
export default services
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { isNotIndex } from '../fields/is-not-index.js';
2+
import { title } from '../fields/title.js';
3+
import { t } from "../i18n/translater.js";
4+
5+
const services_categories = {
6+
name: 'services_categories',
7+
folder: 'content/services_categories',
8+
label: t.content.services_categories.label,
9+
label_singular: t.content.services_categories.label_singular,
10+
description: t.content.services_categories.description,
11+
12+
create: true,
13+
editor: { preview: false },
14+
i18n: true,
15+
16+
slug: '{{slug}}',
17+
path: '{{slug}}/_index',
18+
19+
nested: { depth: 2 },
20+
filter: { field: 'isIndex', value: false },
21+
22+
fields: [
23+
isNotIndex,
24+
title
25+
]
26+
27+
}
28+
29+
export default services_categories

admin/app/fields/services.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { t } from "../i18n/translater.js";
2+
3+
export const services = {
4+
name: 'items',
5+
label: t.fields.services,
6+
widget: 'relation',
7+
collection: 'services',
8+
multiple: true,
9+
search_fields: ['title'],
10+
value_field: '{{slug}}',
11+
display_fields: ['title'],
12+
required: false
13+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { t } from "../i18n/translater.js";
2+
3+
export const services_categories = {
4+
name: 'services_categories',
5+
label: t.fields.services_categories,
6+
widget: 'relation',
7+
collection: 'services_categories',
8+
search_fields: ['title'],
9+
value_field: 'title',
10+
display_fields: ['title'],
11+
required: false
12+
}

admin/app/fields/services_persons.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { t } from "../i18n/translater.js";
2+
3+
export const services_persons = {
4+
name: 'services_persons',
5+
label: t.fields.services_persons.label,
6+
hint: t.fields.services_persons.hint,
7+
widget: 'relation',
8+
collection: 'persons',
9+
search_fields: ['title'],
10+
value_field: '{{filename}}',
11+
display_fields: ['title'],
12+
multiple: true,
13+
required: false,
14+
i18n: 'duplicate'
15+
}

admin/app/i18n/en/blocks.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ export const blocks = {
134134
selectedprojects: "Projects selection",
135135
selectedpublications: "Publications selection",
136136
selectedrealestates: "Real estates selection",
137+
selectedservices: "Services selection",
137138
testimonials: {
138139
label: "Testimonials",
139140
fields: {

admin/app/i18n/en/content.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,16 @@ export const content = {
8686
label_singular: "Type",
8787
description: "All real estate types"
8888
},
89+
services: {
90+
label: "Services",
91+
label_singular: "Service",
92+
description: "All services",
93+
},
94+
services_categories: {
95+
label: "Categories of services",
96+
label_singular: "Category of services",
97+
description: "All categories of services",
98+
},
8999
tags: {
90100
label: "Tags",
91101
label_singular: "Tag",

admin/app/i18n/en/fields.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,12 @@ export const fields = {
277277
},
278278
reference: "Reference",
279279
section: "Type of section",
280+
services: "Services",
281+
services_categories: "Category of service",
282+
services_persons: {
283+
label: "Responsible persons?",
284+
hint: "Several persons possible"
285+
},
280286
show_color: {
281287
label: "Display colors on gauge?",
282288
hint: "Color in red, yellow or green in function of value (if gauge checked)"

admin/app/i18n/fr/blocks.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ export const blocks = {
134134
selectedprojects: "Sélection de projets",
135135
selectedpublications: "Sélection de parutions",
136136
selectedrealestates: "Sélection d’annonces immobilières",
137+
selectedservices: "Sélection de services",
137138
testimonials: {
138139
label: "Témoignages",
139140
fields: {

admin/app/i18n/fr/content.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,16 @@ export const content = {
8686
label_singular: "Type",
8787
description: "Tous les types d’annonce"
8888
},
89+
services: {
90+
label: "Services",
91+
label_singular: "Service",
92+
description: "Tous les services",
93+
},
94+
services_categories: {
95+
label: "Catégories de services",
96+
label_singular: "Catégorie de services",
97+
description: "Toutes les catégories de services",
98+
},
8999
tags: {
90100
label: "Tags",
91101
label_singular: "Tag",

admin/app/i18n/fr/fields.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,12 @@ export const fields = {
276276
realestates_categories: "Type de bien",
277277
reference: "Référence",
278278
section: "Type de section",
279+
services: "Services",
280+
services_categories: "Catégorie de service",
281+
services_persons: {
282+
label: "Personnes responsables ?",
283+
hint: "Plusieurs personnes possible"
284+
},
279285
show_color: {
280286
label: "Afficher des couleurs sur les jauges ?",
281287
hint: "Colore en rouge, jaune ou vert en fonction de la valeur (si jauge coché)"
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
export { block_alert } from "../blocks/alert.js"
2+
export { block_chart } from "../blocks/chart.js"
23
export { block_cta } from "../blocks/cta.js"
3-
export { block_informations } from "../blocks/informations.js"
4-
export { block_pushes } from "../blocks/pushes.js"
54
export { block_datas } from "../blocks/datas.js"
6-
export { block_map } from "../blocks/map.js"
7-
export { block_quote } from "../blocks/quote.js"
8-
export { block_latest } from "../blocks/latest.js"
95
export { block_editorial } from "../blocks/editorial.js"
106
export { block_embed } from "../blocks/embed.js"
117
export { block_faq } from "../blocks/faq.js"
128
export { block_figure } from "../blocks/figure.js"
139
export { block_form } from "../blocks/form.js"
1410
export { block_gallery } from "../blocks/gallery.js"
15-
export { block_chart } from "../blocks/chart.js"
1611
export { block_images } from "../blocks/images.js"
12+
export { block_informations } from "../blocks/informations.js"
1713
export { block_instagram } from "../blocks/instagram.js"
14+
export { block_latest } from "../blocks/latest.js"
15+
export { block_map } from "../blocks/map.js"
1816
export { block_newsletter } from "../blocks/newsletter.js"
1917
export { block_paragraph } from "../blocks/paragraph.js"
18+
export { block_pushes } from "../blocks/pushes.js"
19+
export { block_quote } from "../blocks/quote.js"
2020
// export { block_selectedcasestudies } from "../blocks/selected-casestudies.js"
2121
// export { block_selectedexpertises } from "../blocks/selected-expertises.js"
2222
export { block_selectedpages } from "../blocks/selected-pages.js"
@@ -26,5 +26,6 @@ export { block_selectedposts } from "../blocks/selected-posts.js"
2626
export { block_selectedprojects } from "../blocks/selected-projects.js"
2727
// export { block_selectedpublications } from "../blocks/selected-publications.js"
2828
// export { block_selectedrealestates } from "../blocks/selected-realestates.js"
29+
// export { block_selectedservices } from "../blocks/selected-services.js"
2930
export { block_testimonials } from "../blocks/testimonials.js"
30-
export { block_title } from "../blocks/title.js"
31+
export { block_title } from "../blocks/title.js"

admin/app/settings/available-sections.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ export const availableSections = [
66
// 'places',
77
// 'publications',
88
// 'realestates'
9+
// 'services',
910
]

0 commit comments

Comments
 (0)