diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-07-24 22:32:23 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-07-24 22:32:23 +0200 |
| commit | eee3193ecf604eaed30505128b2a1f7bb875d44a (patch) | |
| tree | 602ab4a22dba52aaa8fc23789684c95abcb6b151 /animism-align/frontend/app | |
| parent | f2d612de04da968a74efe94d0b448b465869d6e0 (diff) | |
displaying roman numerals in traanscript again
Diffstat (limited to 'animism-align/frontend/app')
4 files changed, 15 insertions, 4 deletions
diff --git a/animism-align/frontend/app/views/paragraph/components/paragraph.list.js b/animism-align/frontend/app/views/paragraph/components/paragraph.list.js index ae92f78..e1e7970 100644 --- a/animism-align/frontend/app/views/paragraph/components/paragraph.list.js +++ b/animism-align/frontend/app/views/paragraph/components/paragraph.list.js @@ -66,6 +66,7 @@ class ParagraphList extends Component { const { order: annotationOrder, lookup: annotationLookup } = this.props.annotation const { lookup: paragraphLookup } = this.props.paragraph let currentParagraph = {} + let sectionCount = 0 const paragraphs = [] // loop over the annotations in time order annotationOrder.forEach((annotation_id, i) => { @@ -83,7 +84,7 @@ class ParagraphList extends Component { return } // if this annotation is from a different paragraph, make a new paragraph - if (annotation.paragraph_id !== currentParagraph.id) { + if (annotation.type === 'header' || annotation.paragraph_id !== currentParagraph.id) { const paragraph_type = getParagraphType(annotation, paragraph) currentParagraph = { id: annotation.paragraph_id || ('index_' + i), @@ -92,6 +93,10 @@ class ParagraphList extends Component { end_ts: 0, annotations: [], } + if (annotation.type === 'header') { + currentParagraph.sectionIndex = sectionCount++ + currentParagraph.id = 'section_' + currentParagraph.sectionIndex + } paragraphs.push(currentParagraph) } // if this annotation is a paragraph_end, set the end timestamp @@ -142,6 +147,9 @@ class ParagraphList extends Component { } const getParagraphType = (annotation, paragraph) => { + if (annotation.type === 'header') { + return annotation.type + } if (!paragraph) { return annotation.type } diff --git a/animism-align/frontend/app/views/paragraph/components/paragraphTypes/paragraphTypes.text.js b/animism-align/frontend/app/views/paragraph/components/paragraphTypes/paragraphTypes.text.js index c2ebcd7..be5818a 100644 --- a/animism-align/frontend/app/views/paragraph/components/paragraphTypes/paragraphTypes.text.js +++ b/animism-align/frontend/app/views/paragraph/components/paragraphTypes/paragraphTypes.text.js @@ -1,5 +1,7 @@ import React, { Component } from 'react' +import { ROMAN_NUMERALS } from 'app/constants' + export const Paragraph = ({ paragraph, currentParagraph, currentAnnotation, onAnnotationClick, onDoubleClick }) => { let className = paragraph.type if (className !== 'paragraph') className += ' paragraph' @@ -29,7 +31,7 @@ export const ParagraphHeader = ({ paragraph, currentParagraph, currentAnnotation className={className} onDoubleClick={e => onDoubleClick(e, paragraph)} > - {text} + <span>{ROMAN_NUMERALS[paragraph.sectionIndex]}{'. '}{text}</span> </div> ) } diff --git a/animism-align/frontend/app/views/viewer/transcript/components/elementTypes.text.js b/animism-align/frontend/app/views/viewer/transcript/components/elementTypes.text.js index ebc0103..be5818a 100644 --- a/animism-align/frontend/app/views/viewer/transcript/components/elementTypes.text.js +++ b/animism-align/frontend/app/views/viewer/transcript/components/elementTypes.text.js @@ -1,5 +1,7 @@ import React, { Component } from 'react' +import { ROMAN_NUMERALS } from 'app/constants' + export const Paragraph = ({ paragraph, currentParagraph, currentAnnotation, onAnnotationClick, onDoubleClick }) => { let className = paragraph.type if (className !== 'paragraph') className += ' paragraph' @@ -29,7 +31,7 @@ export const ParagraphHeader = ({ paragraph, currentParagraph, currentAnnotation className={className} onDoubleClick={e => onDoubleClick(e, paragraph)} > - <span>{text}</span> + <span>{ROMAN_NUMERALS[paragraph.sectionIndex]}{'. '}{text}</span> </div> ) } diff --git a/animism-align/frontend/app/views/viewer/transcript/transcript.css b/animism-align/frontend/app/views/viewer/transcript/transcript.css index 984221a..45942c6 100644 --- a/animism-align/frontend/app/views/viewer/transcript/transcript.css +++ b/animism-align/frontend/app/views/viewer/transcript/transcript.css @@ -32,7 +32,6 @@ bottom: 0; left: 0; height: 3rem; - border-top: 1px solid white; width: 100%; background: black; color: white; |
