Skip to content

Commit

Permalink
feat: add notes to paragraph block
Browse files Browse the repository at this point in the history
  • Loading branch information
arthaud-proust committed Nov 30, 2023
1 parent af0cce9 commit 8612bcf
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 7 deletions.
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
]
};
22 changes: 22 additions & 0 deletions admin/app/fields/notes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
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,
fields: [
{
label: t.fields.notes.fields.id.label,
hint: t.fields.notes.fields.id.hint,
name: 'id',
widget: 'number'
},
{ label: t.fields.notes.fields.text.label, name: 'text', widget: 'text' }
]
};
14 changes: 14 additions & 0 deletions admin/app/i18n/en/fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,20 @@ 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: 'Link the note to a word by adding "[n]" after it, with n the number of the note. Eg: "SEO[1]" in the text, and in notes: 1: "Search engine optimisation".',
fields: {
id: {
label: 'Id',
hint: 'Identifier of the note. Eg: "1" to link the note with [1] in the paragraph.'
},
text: {
label: 'Text'
}
}
},
offer: 'Offer',
offset: {
label: 'Offset',
Expand Down
14 changes: 14 additions & 0 deletions admin/app/i18n/fr/fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,20 @@ 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: 'Liez la note à un mot en le suffixant de "[n]", avec n le numéro de la note. Ex: "SEO[1]" dans le texte, et dans les notes: 1: "Search engine optimisation".',
fields: {
id: {
label: 'Id',
hint: 'Identifiant de la note. Ex: "1" pour lier la note au [1] dans le paragraphe.'
},
text: {
label: 'Texte'
}
}
},
offer: 'Offre',
offset: {
label: 'Alignement',
Expand Down

0 comments on commit 8612bcf

Please sign in to comment.