Skip to content

Commit

Permalink
feat: add notes to paragraph and editorial block
Browse files Browse the repository at this point in the history
  • Loading branch information
arthaud-proust committed Dec 10, 2023
1 parent a678156 commit a2c441a
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 12 deletions.
20 changes: 15 additions & 5 deletions admin/app/blocks/editorial.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { background } from '../fields/background.js';
import { cta } from '../fields/cta.js';
import { direction } from '../fields/direction.js';
import { image } from '../fields/image.js';
import { notes } from '../fields/notes.js';
import { surtitle } from '../fields/surtitle.js';
import { title } from '../fields/title.js';
import { text_markdown } from '../fields/text-markdown.js';
import { cta } from '../fields/cta.js';
import { image } from '../fields/image.js';
import { background } from '../fields/background.js';
import { title } from '../fields/title.js';
import { t } from '../i18n/translater.js';

export const block_editorial = {
Expand All @@ -15,5 +16,14 @@ export const block_editorial = {
i18n: true,
collapsed: false,
summary: '{{title}}',
fields: [direction, surtitle, title, text_markdown, cta, image, background]
fields: [
direction,
surtitle,
title,
text_markdown,
notes,
cta,
image,
background
]
};
25 changes: 18 additions & 7 deletions admin/app/blocks/paragraph.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { surtitle } from '../fields/surtitle.js';
import { title } from '../fields/title.js';
import { text_markdown } from '../fields/text-markdown.js';
import { grid } from '../fields/grid.js';
import { offset } from '../fields/offset.js';
import { align } from '../fields/align.js';
import { cta } from '../fields/cta.js';
import { background } from '../fields/background.js';
import { cta } from '../fields/cta.js';
import { grid } from '../fields/grid.js';
import { notes } from '../fields/notes.js';
import { offset } from '../fields/offset.js';
import { surtitle } from '../fields/surtitle.js';
import { text_markdown } from '../fields/text-markdown.js';
import { title } from '../fields/title.js';
import { t } from '../i18n/translater.js';

export const block_paragraph = {
Expand All @@ -16,5 +17,15 @@ export const block_paragraph = {
i18n: true,
collapsed: false,
summary: '{{title}}',
fields: [surtitle, title, text_markdown, grid, offset, align, cta, background]
fields: [
surtitle,
title,
text_markdown,
notes,
grid,
offset,
align,
cta,
background
]
};
21 changes: 21 additions & 0 deletions admin/app/fields/notes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { t } from '../i18n/translater.js';

export const notes = {
name: 'notes',
label: t.fields.notes.label,
label_singular: t.fields.notes.label_singular,
hint: t.fields.notes.hint,
widget: 'list',
collapsed: true,
minimize_collapsed: true,
required: false,
i18n: true,
summary: '',
fields: [
{
label: t.fields.notes.field.label,
name: 'text',
widget: 'text'
}
]
};
8 changes: 8 additions & 0 deletions admin/app/i18n/en/fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,14 @@ export const fields = {
hint: 'Name of the icon, doc : https://fonts.google.com/icons?icon.set=Material+Icons'
},
name: 'Name',
notes: {
label: 'Notes',
label_singular: 'Note',
hint: 'Add a note, then link a word to the note by writing "[\\*]" after it. Notes and "[\\*]" are linked by their order.',
field: {
label: 'Text'
}
},
offer: 'Offer',
offset: {
label: 'Offset',
Expand Down
8 changes: 8 additions & 0 deletions admin/app/i18n/fr/fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,14 @@ export const fields = {
hint: 'Le nom de l’icon, doc : https://fonts.google.com/icons?icon.set=Material+Icons'
},
name: 'Nom',
notes: {
label: 'Notes',
label_singular: 'Note',
hint: 'Ajoutez une note, puis liez-la à un mot en ajoutant "[\\*]" juste après. Les notes et "[\\*]" sont liés par leur ordre.',
field: {
label: 'Texte'
}
},
offer: 'Offre',
offset: {
label: 'Alignement',
Expand Down

0 comments on commit a2c441a

Please sign in to comment.