From 4e2121e9160b627415a31f628fa3f00711138375 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 2 Nov 2020 16:38:13 +0100 Subject: images can include images from galleries. command to duplicate annotations --- .../components/annotations/annotation.form.css | 4 +++ .../components/annotations/annotation.index.css | 12 ++++--- .../annotationForms/annotationForm.gallery.js | 38 +++------------------- .../annotationForms/annotationForm.image.js | 27 ++++++++++----- .../annotationForms/annotationForm.utility.js | 10 ++---- .../annotationForms/annotationForm.video.js | 10 ++---- .../annotationTypes/annotationTypes.image.js | 7 ++-- 7 files changed, 42 insertions(+), 66 deletions(-) (limited to 'animism-align/frontend/app/views/align/components/annotations') diff --git a/animism-align/frontend/app/views/align/components/annotations/annotation.form.css b/animism-align/frontend/app/views/align/components/annotations/annotation.form.css index cea5830..fa663c7 100644 --- a/animism-align/frontend/app/views/align/components/annotations/annotation.form.css +++ b/animism-align/frontend/app/views/align/components/annotations/annotation.form.css @@ -33,6 +33,10 @@ .annotationForm div.textarea { margin-bottom: 0.5rem; } +.annotationForm img { + max-width: 100%; + max-height: 6rem; +} .annotationForm .options label span:first-child { display: inline-block; diff --git a/animism-align/frontend/app/views/align/components/annotations/annotation.index.css b/animism-align/frontend/app/views/align/components/annotations/annotation.index.css index af44212..5f5fda7 100644 --- a/animism-align/frontend/app/views/align/components/annotations/annotation.index.css +++ b/animism-align/frontend/app/views/align/components/annotations/annotation.index.css @@ -6,7 +6,7 @@ .annotationIndex .annotation { position: absolute; left: 5px; - max-width: 400px; + max-width: 300px; padding: 0.25rem 0.375rem; box-shadow: 0px 0px 3px rgba(0,0,0,1.0); border: 1px solid transparent; @@ -23,7 +23,7 @@ background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.4)); } .annotationIndex .annotation.media { - min-width: 300px; + width: 300px; left: calc(405px + 0.5rem); } .annotation.sentence.even { @@ -41,14 +41,15 @@ .annotation.paragraph_end { background-color: #003; border-top: 1px solid #888; - width: 100%; + width: 300px; padding: 1px; } .annotationIndex .annotation.utility { - left: calc(405px + 0.5rem); + left: calc(505px + 0.5rem); + width: 200px; } .annotationIndex .annotation.footnote { - left: calc(405px + 0.5rem); + left: calc(605px + 0.5rem); width: 200px; } .annotationIndex .annotation.text_plate { @@ -58,6 +59,7 @@ background-image: linear-gradient(rgba(255,255,255,1.0), rgba(255,255,255,1.0)); width: 8rem; padding: 0; + overflow: hidden; } .annotation.curtain span { position: absolute; diff --git a/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.gallery.js b/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.gallery.js index c43d8d5..55bdd86 100644 --- a/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.gallery.js +++ b/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.gallery.js @@ -3,17 +3,11 @@ import React, { Component } from 'react' import { CURTAIN_COLOR_SELECT_OPTIONS } from 'app/constants' import { TextInput, Select, Checkbox, LabelDescription } from 'app/common' import { AnnotationFormFullscreen } from './annotationForm.utility' +import { makeMediaItems, makeGalleryItems } from 'app/utils/annotation.utils' export const AnnotationFormGallery = ({ annotation, media, handleSettingsSelect, handleSettingsChange }) => { if (!media.lookup) return
- const { lookup, order } = media - const image_list_items = order.filter(id => lookup[id].type === 'gallery').map(id => { - const image = lookup[id] - return { - name: image.id, - label: image.author + ' - ' + image.title - } - }) + const image_list_items = makeMediaItems(media, ['gallery']) return (
- {item && ( + {gallery_items && ( - + + {gallery_items && ( + { if (!media.lookup) return
- const { lookup, order } = media - const video_list_items = order.filter(id => lookup[id].type === 'video').map(id => { - const video = lookup[id] - return { - name: video.id, - label: video.author + ' - ' + video.title - } - }) + const video_list_items = makeMediaItems(media, ['video']) return (