Skip to content

Commit

Permalink
Add persons relations
Browse files Browse the repository at this point in the history
  • Loading branch information
sebousan committed Dec 6, 2023
1 parent 5564c7f commit 0ce5be0
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 0 deletions.
26 changes: 26 additions & 0 deletions admin/app/content/persons_statutes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { isNotIndex } from '../fields/is-not-index.js';
import { title } from '../fields/title.js';
import { weight } from '../fields/weight.js';
import { t } from '../i18n/translater.js';

const persons_statutes = {
name: 'persons_statutes',
folder: 'content/persons_statutes',
label: t.content.persons_statutes.label,
label_singular: t.content.persons_statutes.label_singular,
description: t.content.persons_statutes.description,

create: true,
editor: { preview: false },
i18n: true,

slug: '{{slug}}',
path: '{{slug}}/_index',

nested: { depth: 2 },
filter: { field: 'isIndex', value: false },

fields: [isNotIndex, title, weight]
};

export default persons_statutes;
14 changes: 14 additions & 0 deletions admin/app/fields/persons_expertises.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { t } from '../i18n/translater.js';

export const persons_expertises = {
name: 'persons_expertises',
label: t.fields.persons_expertises,
widget: 'relation',
collection: 'expertises',
search_fields: ['title'],
value_field: '{{filename}}',
display_fields: ['title'],
multiple: true,
required: false,
i18n: 'duplicate'
};
14 changes: 14 additions & 0 deletions admin/app/fields/persons_places.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { t } from '../i18n/translater.js';

export const persons_places = {
name: 'persons_places',
label: t.fields.persons_places,
widget: 'relation',
collection: 'places',
search_fields: ['title'],
value_field: '{{filename}}',
display_fields: ['title'],
multiple: true,
required: false,
i18n: 'duplicate'
};
14 changes: 14 additions & 0 deletions admin/app/fields/persons_statutes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { t } from '../i18n/translater.js';

export const persons_statutes = {
name: 'persons_statutes',
label: t.fields.persons_statutes,
widget: 'relation',
collection: 'persons_statutes',
search_fields: ['title'],
value_field: 'title',
display_fields: ['title'],
multiple: false,
required: true,
i18n: 'duplicate'
};

0 comments on commit 0ce5be0

Please sign in to comment.