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

Commit e0692f7

Browse files
feat: add services
1 parent 7beeb4e commit e0692f7

File tree

12 files changed

+98
-7
lines changed

12 files changed

+98
-7
lines changed

admin/app.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,3 +463,6 @@ 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+
}

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: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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 { title } from '../fields/title.js'
7+
import { t } from '../i18n/translater.js'
8+
9+
const services = {
10+
name: 'services',
11+
label: t.content.services.label,
12+
label_singular: t.content.services.label_singular,
13+
folder: 'content/services',
14+
create: true,
15+
description: t.content.services.description,
16+
17+
editor: { preview: false },
18+
i18n: true,
19+
20+
nested: { depth: 2 },
21+
filter: { field: 'isIndex', value: false },
22+
23+
slug: '{{slug}}',
24+
sortable_fields: ['title'],
25+
summary: '{{title}}',
26+
27+
fields: [
28+
isNotIndex,
29+
draft,
30+
title,
31+
description,
32+
body,
33+
featured_image
34+
]
35+
}
36+
37+
export default services

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+
}

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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ 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+
},
8994
tags: {
9095
label: "Tags",
9196
label_singular: "Tag",

admin/app/i18n/en/fields.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ export const fields = {
277277
},
278278
reference: "Reference",
279279
section: "Type of section",
280+
services: "Services",
280281
show_color: {
281282
label: "Display colors on gauge?",
282283
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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ 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+
},
8994
tags: {
9095
label: "Tags",
9196
label_singular: "Tag",

admin/app/i18n/fr/fields.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ export const fields = {
276276
realestates_categories: "Type de bien",
277277
reference: "Référence",
278278
section: "Type de section",
279+
services: "Services",
279280
show_color: {
280281
label: "Afficher des couleurs sur les jauges ?",
281282
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)