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

Commit 063f928

Browse files
authored
Merge pull request #9 from Hugolify/add-expertises-offices
Add expertises offices
2 parents d15b64d + 0c71ded commit 063f928

26 files changed

+245
-51
lines changed

admin/app.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,4 +264,13 @@ aside [href="#/collections/casestudies"] span::before {
264264
}
265265
aside [href="#/collections/publications"] span::before {
266266
content: '\F4A3';
267+
}
268+
aside [href="#/collections/publications_categories"] span::before {
269+
content: '\F1A4';
270+
}
271+
aside [href="#/collections/expertises"] span::before {
272+
content: '\F585';
273+
}
274+
aside [href="#/collections/offices"] span::before {
275+
content: '\F1DD';
267276
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { heading } from '../fields/heading.js'
2+
import { expertises } from '../fields/expertises-items.js'
3+
import { show_more } from '../fields/show-more.js'
4+
import { background } from '../fields/background.js'
5+
import {t} from "../i18n/translater.js";
6+
7+
export const block_selectedexpertises = {
8+
name: 'selected-expertises',
9+
label: t.blocks.selectedexpertises,
10+
widget: 'object',
11+
required: false,
12+
i18n: true,
13+
collapsed: false,
14+
summary: '{{heading.title}}',
15+
fields: [
16+
heading,
17+
{ name: 'section', default: 'expertises', widget: 'hidden' },
18+
expertises,
19+
show_more,
20+
background
21+
]
22+
}

admin/app/blocks/selected-offices.js

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

admin/app/content/casestudies.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ import {t} from "../i18n/translater.js";
1010

1111
const casestudies = {
1212
name: 'casestudies',
13+
folder: 'content/casestudies',
1314
label: t.content.casestudies.label,
1415
label_singular: t.content.casestudies.label_singular,
15-
folder: 'content/casestudies',
16+
description: t.content.casestudies.description,
17+
1618
create: true,
17-
1819
editor: { preview: false },
19-
2020
i18n: true,
2121

2222
slug: '{{slug}}',

admin/app/content/categories.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ import {t} from "../i18n/translater.js";
44

55
const categories = {
66
name: 'categories',
7+
folder: 'content/categories',
78
label: t.content.categories.label,
89
label_singular: t.content.categories.label_singular,
9-
folder: 'content/categories',
10-
create: true,
1110
description: t.content.categories.description,
12-
11+
12+
create: true,
1313
editor: { preview: false },
14-
1514
i18n: true,
1615

1716
slug: '{{slug}}',

admin/app/content/expertises.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { isNotIndex } from '../fields/is-not-index.js'
2+
import { draft } from '../fields/draft.js'
3+
import { title } from '../fields/title.js'
4+
import { description } from '../fields/description.js'
5+
import { body } from '../fields/body.js'
6+
import { featured_image } from '../fields/featured-image.js'
7+
import {t} from "../i18n/translater.js";
8+
9+
const expertises = {
10+
name: 'expertises',
11+
folder: 'content/expertises',
12+
label: t.content.expertises.label,
13+
label_singular: t.content.expertises.label_singular,
14+
description: t.content.expertises.description,
15+
16+
create: true,
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 expertises

admin/app/content/indexes.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@ import {t} from "../i18n/translater.js";
77

88
const indexes = {
99
name: 'indexes',
10+
folder: 'content',
1011
label: t.content.indexes.label,
1112
label_singular: t.content.indexes.label_singular,
12-
folder: 'content',
13-
create: false,
1413
description: t.content.indexes.description,
15-
14+
15+
create: false,
1616
editor: { preview: false },
17-
1817
i18n: true,
1918

2019
nested: { depth: 3 },

admin/app/content/offices.js

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

admin/app/content/pages.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ import {t} from "../i18n/translater.js";
1010

1111
const pages = {
1212
name: 'pages',
13+
folder: 'content',
1314
label: t.content.pages.label,
1415
label_singular: t.content.pages.label_singular,
15-
folder: 'content',
16+
description: t.content.pages.description,
17+
1618
create: true,
17-
1819
editor: { preview: false },
19-
2020
i18n: true,
2121

2222
slug: '{{slug}}',

admin/app/content/persons.js

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

1010
const persons = {
1111
name: 'persons',
12+
folder: 'content/persons',
1213
label: t.content.persons.label,
1314
label_singular: t.content.persons.label_singular,
14-
folder: 'content/persons',
15-
create: true,
1615
description: t.content.persons.description,
17-
16+
17+
create: true,
1818
editor: { preview: false },
19-
2019
i18n: true,
2120

2221
nested: { depth: 2 },
22+
filter: { field: 'isIndex', value: false },
2323

2424
slug: '{{slug}}',
25-
path: '{{slug}}/_index',
26-
27-
filter: { field: 'isIndex', value: false },
25+
26+
sortable_fields: ['title'],
27+
summary: '{{title}}',
2828

2929
fields: [
3030
isNotIndex,

admin/app/content/posts.js

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

1313
const posts = {
1414
name: 'posts',
15+
folder: 'content/posts',
1516
label: t.content.posts.label,
1617
label_singular: t.content.posts.label_singular,
17-
folder: 'content/posts',
18+
description: t.content.posts.description,
19+
1820
create: true,
19-
2021
editor: { preview: false },
21-
2222
i18n: true,
2323

2424
path: '{{year}}/{{month}}/{{slug}}',

admin/app/content/projects.js

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

1414
const projects = {
1515
name: 'projects',
16+
folder: 'content/projects',
1617
label: t.content.projects.label,
1718
label_singular: t.content.projects.label_singular,
18-
folder: 'content/projects',
19-
create: true,
19+
description: t.content.projects.description,
2020

21+
create: true,
2122
editor: { preview: false },
22-
2323
i18n: true,
2424

2525
slug: '{{slug}}',

admin/app/content/projects_tags.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ import {t} from "../i18n/translater.js";
44

55
const projects_tags = {
66
name: 'projects_tags',
7+
folder: 'content/projects_tags',
78
label: t.content.projects_tags.label,
89
label_singular: t.content.projects_tags.label_singular,
9-
folder: 'content/projects_tags',
10-
create: true,
1110
description: t.content.projects_tags.description,
12-
11+
12+
create: true,
1313
editor: { preview: false },
14-
1514
i18n: true,
1615

1716
slug: '{{slug}}',

admin/app/content/projects_types.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ import {t} from "../i18n/translater.js";
44

55
const projects_types = {
66
name: 'projects_types',
7+
folder: 'content/projects_types',
78
label: t.content.projects_types.label,
89
label_singular: t.content.projects_types.label_singular,
9-
folder: 'content/projects_types',
10-
create: true,
1110
description: t.content.projects_types.description,
12-
11+
12+
create: true,
1313
editor: { preview: false },
14-
1514
i18n: true,
1615

1716
slug: '{{slug}}',

admin/app/content/publications.js

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

1313
const publications = {
1414
name: 'publications',
15+
folder: 'content/publications',
1516
label: t.content.publications.label,
1617
label_singular: t.content.publications.label_singular,
17-
folder: 'content/publications',
18+
description: t.content.publications.description,
19+
1820
create: true,
19-
2021
editor: { preview: false },
21-
2222
i18n: true,
2323

2424
path: '{{year}}/{{month}}/{{slug}}',
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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 publications_categories = {
6+
name: 'publications_categories',
7+
folder: 'content/publications_categories',
8+
label: t.content.categories.label,
9+
label_singular: t.content.publications_categories.label_singular,
10+
description: t.content.publications_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+
export default publications_categories

admin/app/content/tags.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ import {t} from "../i18n/translater.js";
44

55
const tags = {
66
name: 'tags',
7+
folder: 'content/tags',
78
label: t.content.tags.label,
89
label_singular: t.content.tags.label_singular,
9-
folder: 'content/tags',
10-
create: true,
1110
description: t.content.tags.description,
12-
11+
12+
create: true,
1313
editor: { preview: false },
14-
1514
i18n: true,
1615

1716
slug: '{{slug}}',

admin/app/fields/expertises-items.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export const expertises = {
2+
name: 'items',
3+
label: t.fields.expertises_items,
4+
widget: 'relation',
5+
collection: 'expertises',
6+
search_fields: ['title'],
7+
value_field: '{{filename}}',
8+
display_fields: ['title'],
9+
multiple: true,
10+
required: false,
11+
i18n: 'duplicate'
12+
}

0 commit comments

Comments
 (0)