summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/align/components/annotations/annotation.form.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-10-20 19:25:35 +0200
committerJules Laplace <julescarbon@gmail.com>2020-10-20 19:25:35 +0200
commit1600ab3446f533a6824512d616131c7d02a037c7 (patch)
treeb0a3a5cf08d58583e82f9170f72201398e99cdb9 /animism-align/frontend/app/views/align/components/annotations/annotation.form.js
parent597356b755b2453d17bc7e13e6d7f7f3d966bf6b (diff)
add footnote type and text plate type. keep track of footnotes when accumulating paragraphs.
Diffstat (limited to 'animism-align/frontend/app/views/align/components/annotations/annotation.form.js')
-rw-r--r--animism-align/frontend/app/views/align/components/annotations/annotation.form.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/animism-align/frontend/app/views/align/components/annotations/annotation.form.js b/animism-align/frontend/app/views/align/components/annotations/annotation.form.js
index 8ca3c3f..92b5a5f 100644
--- a/animism-align/frontend/app/views/align/components/annotations/annotation.form.js
+++ b/animism-align/frontend/app/views/align/components/annotations/annotation.form.js
@@ -14,6 +14,8 @@ import { annotationFormLookup } from './annotationForms'
const ANNOTATION_TYPES = [
'sentence', 'section_heading', 'heading_text', 'pullquote_credit', 'paragraph_end',
+ 'footnote',
+ 'text_plate',
'video',
'image',
'gallery', 'carousel', 'grid', 'vitrine',
@@ -21,6 +23,10 @@ const ANNOTATION_TYPES = [
'curtain', 'intro', 'schedule',
].map(name => ({ name, label: capitalize(name.replace('_', ' ')) }))
+const annotationTextTypes = new Set([
+ 'sentence', 'section_heading', 'heading_text', 'pullquote_credit', 'footnote', 'text_plate',
+])
+
class AnnotationForm extends Component {
constructor(props){
super(props)
@@ -129,10 +135,7 @@ class AnnotationForm extends Component {
}}
>
{this.renderButtons()}
- {annotation.type === 'sentence' && this.renderTextarea()}
- {annotation.type === 'section_heading' && this.renderTextarea()}
- {annotation.type === 'heading_text' && this.renderTextarea()}
- {annotation.type === 'pullquote_credit' && this.renderTextarea()}
+ {annotationTextTypes.has(annotation.type) && this.renderTextarea()}
{(annotation.type in annotationFormLookup) && this.renderElementForm()}
</div>
)