From f3f86dd53d7d8599471366e94ba6919718b88b78 Mon Sep 17 00:00:00 2001 From: Markus Weigelt Date: Thu, 7 Dec 2023 17:44:49 +0100 Subject: [PATCH] Improve the project folder use view and add configuration below, add configuration of displaying media view instead of preview in preview tooltip --- .../kitodo/data/database/beans/Project.java | 27 ++- ...V2_127__Add_preview_tooltip_to_project.sql | 4 + .../kitodo/production/forms/ProjectForm.java | 18 ++ .../forms/dataeditor/GalleryPanel.java | 7 + .../resources/messages/messages_de.properties | 4 +- .../resources/messages/messages_en.properties | 4 +- .../webapp/WEB-INF/resources/css/kitodo.css | 9 - .../partials/media-list-overlay.xhtml | 20 +- .../projectEdit/projectEditMets.xhtml | 196 ++++++++++-------- 9 files changed, 187 insertions(+), 102 deletions(-) diff --git a/Kitodo-DataManagement/src/main/java/org/kitodo/data/database/beans/Project.java b/Kitodo-DataManagement/src/main/java/org/kitodo/data/database/beans/Project.java index 8fec5d8d479..1c7b880fc5b 100644 --- a/Kitodo-DataManagement/src/main/java/org/kitodo/data/database/beans/Project.java +++ b/Kitodo-DataManagement/src/main/java/org/kitodo/data/database/beans/Project.java @@ -133,6 +133,12 @@ public class Project extends BaseIndexedBean implements Comparable { @Column(name = "preview_tooltip") private Boolean previewTooltip = false; + /** + * Field to define the status if the media view should be displayed preview tooltip. + */ + @Column(name = "preview_tooltip_media_view") + private Boolean previewTooltipMediaView = false; + /** * Folder with media to use for the audio preview. */ @@ -535,10 +541,29 @@ public boolean isPreviewTooltip() { return previewTooltip; } + /** + * Set the status if the media view should be displayed preview tooltip. + * + * @param previewTooltipMediaView True if is active + */ + public void setPreviewTooltipMediaView(boolean previewTooltipMediaView) { + this.previewTooltipMediaView = previewTooltipMediaView; + } + + /** + * Get the status if the media view should be displayed preview tooltip. + * + * @return True if is active + */ + public boolean isPreviewTooltipMediaView() { + return previewTooltipMediaView; + } + /** * Set the status of the preview tooltip. * - * @param previewTooltip True if is active + * @param previewTooltip + * True if is active */ public void setPreviewTooltip(boolean previewTooltip) { this.previewTooltip = previewTooltip; diff --git a/Kitodo-DataManagement/src/main/resources/db/V2_127__Add_preview_tooltip_to_project.sql b/Kitodo-DataManagement/src/main/resources/db/V2_127__Add_preview_tooltip_to_project.sql index c48c711bc7d..8a5fa7308ae 100644 --- a/Kitodo-DataManagement/src/main/resources/db/V2_127__Add_preview_tooltip_to_project.sql +++ b/Kitodo-DataManagement/src/main/resources/db/V2_127__Add_preview_tooltip_to_project.sql @@ -12,3 +12,7 @@ -- -- Migration: Add column for state of preview tooltip to project table. ALTER TABLE project ADD preview_tooltip TINYINT(1) NOT NULL DEFAULT 0; + +-- +-- Migration: Add column for state if the media view should be displayed preview tooltip to project table. +ALTER TABLE project ADD preview_tooltip_media_view TINYINT(1) NOT NULL DEFAULT 0; diff --git a/Kitodo/src/main/java/org/kitodo/production/forms/ProjectForm.java b/Kitodo/src/main/java/org/kitodo/production/forms/ProjectForm.java index ea7ec82d579..82d3c326e64 100644 --- a/Kitodo/src/main/java/org/kitodo/production/forms/ProjectForm.java +++ b/Kitodo/src/main/java/org/kitodo/production/forms/ProjectForm.java @@ -753,6 +753,24 @@ public void setPreviewTooltip(boolean previewTooltip) { project.setPreviewTooltip(previewTooltip); } + /** + * Get the status if the media view should be displayed preview tooltip. + * + * @return True if is active + */ + public boolean isPreviewTooltipMediaView() { + return project.isPreviewTooltipMediaView(); + } + + /** + * Set the status if the media view should be displayed preview tooltip. + * + * @param previewTooltipMediaView True if is active + */ + public void setPreviewTooltipMediaView(boolean previewTooltipMediaView) { + project.setPreviewTooltipMediaView(previewTooltipMediaView); + } + /** * Returns the folder to use for audio preview. * diff --git a/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/GalleryPanel.java b/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/GalleryPanel.java index 3f363b7f455..f06924b5cbc 100644 --- a/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/GalleryPanel.java +++ b/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/GalleryPanel.java @@ -243,6 +243,13 @@ public boolean isPreviewTooltip() { return dataEditor.getProcess().getProject().isPreviewTooltip(); } + /** + * Check if the media view for preview tooltip is activated in project. + */ + public boolean isPreviewTooltipMediaView() { + return dataEditor.getProcess().getProject().isPreviewTooltipMediaView(); + } + private boolean dragStripeIndexMatches(String dragId) { Matcher dragStripeImageMatcher = DRAG_STRIPE_IMAGE.matcher(dragId); Matcher dragUnstructuredMediaMatcher = DRAG_UNSTRUCTURED_MEDIA.matcher(dragId); diff --git a/Kitodo/src/main/resources/messages/messages_de.properties b/Kitodo/src/main/resources/messages/messages_de.properties index 9f50b2a9971..56127187f11 100644 --- a/Kitodo/src/main/resources/messages/messages_de.properties +++ b/Kitodo/src/main/resources/messages/messages_de.properties @@ -476,7 +476,6 @@ folderUse.generatorSource.disabled=Generieren von Inhalten deaktiviert folderUse.mediaView=F\u00FCr die Medienansicht verwenden folderUse.mediaView.disabled=Medienansicht deaktiviert folderUse.preview=Als Vorschau verwenden -folderUse.previewTooltip=Tooltip anstelle des Overlays in der Vorschau anzeigen folderUse.preview.disabled=Vorschau deaktiviert folderUse.videoPreview=Als Vorschau f\u00fcr Videos verwenden folderUse.videoPreview.disabled=Vorschau f\u00fcr Videos deaktiviert @@ -1127,6 +1126,9 @@ title=Titel titleRecordLink=Titelsatzverkn\u00FCpfung to=bis tooltip=Nr. {0} +tooltip.headline=Tooltip +tooltip.enable=Tooltip anstelle des Overlays in der Vorschau anzeigen +tooltip.mediaView=Zeige die Medienansicht anstelle der Vorschau hits=Treffer tsl=TSL typ=Typ diff --git a/Kitodo/src/main/resources/messages/messages_en.properties b/Kitodo/src/main/resources/messages/messages_en.properties index 049f9cc6243..032c3bb4034 100644 --- a/Kitodo/src/main/resources/messages/messages_en.properties +++ b/Kitodo/src/main/resources/messages/messages_en.properties @@ -477,7 +477,6 @@ folderUse.generatorSource.disabled=Content generation disabled folderUse.mediaView=Use for the media view folderUse.mediaView.disabled=Media view disabled folderUse.preview=Use as preview -folderUse.previewTooltip=Show a tooltip instead of the overlay in preview folderUse.preview.disabled=Preview disabled folderUse.videoPreview=Use as preview for videos folderUse.videoPreview.disabled=Preview for videos disabled @@ -1128,6 +1127,9 @@ title=Title titleRecordLink=Title record link to=to tooltip=No. {0} +tooltip.headline=Tooltip +tooltip.enable=Show tooltip instead of the overlay in preview +tooltip.mediaView=Show media view in tooltip instead of preview hits=Hits tsl=TSL typ=Type diff --git a/Kitodo/src/main/webapp/WEB-INF/resources/css/kitodo.css b/Kitodo/src/main/webapp/WEB-INF/resources/css/kitodo.css index 0129621a7fd..cf8a254a92c 100644 --- a/Kitodo/src/main/webapp/WEB-INF/resources/css/kitodo.css +++ b/Kitodo/src/main/webapp/WEB-INF/resources/css/kitodo.css @@ -3878,15 +3878,6 @@ footer { padding: .75em 1.5em; } -.la-folder-use { - padding-left: 16px; -} - -.so-folder-use { - margin: 0 15px 1.3em 15px; - width: calc(100% - 64px); -} - .import-table-section-title, .ui-panelgrid-cell > .import-table-section-title { font-weight: bold; diff --git a/Kitodo/src/main/webapp/WEB-INF/templates/includes/metadataEditor/partials/media-list-overlay.xhtml b/Kitodo/src/main/webapp/WEB-INF/templates/includes/metadataEditor/partials/media-list-overlay.xhtml index c55a9e82251..586d136d248 100644 --- a/Kitodo/src/main/webapp/WEB-INF/templates/includes/metadataEditor/partials/media-list-overlay.xhtml +++ b/Kitodo/src/main/webapp/WEB-INF/templates/includes/metadataEditor/partials/media-list-overlay.xhtml @@ -12,14 +12,15 @@ --> + value="#{DataEditorForm.galleryPanel.isPreviewTooltip() and ( + not DataEditorForm.galleryPanel.isPreviewTooltipMediaView() and mediaProvider.hasPreviewVariant(media) and fn:startsWith(media.previewMimeType, 'image') ) or ( + DataEditorForm.galleryPanel.isPreviewTooltipMediaView() and mediaProvider.hasMediaViewVariant(media) and fn:startsWith(media.mediaViewMimeType, 'image') ) }"/> @@ -43,8 +44,8 @@ - + + + + + + + + #{msgs.image} #{media.shortId}, #{msgs.page} #{media.orderlabel} diff --git a/Kitodo/src/main/webapp/WEB-INF/templates/includes/projectEdit/projectEditMets.xhtml b/Kitodo/src/main/webapp/WEB-INF/templates/includes/projectEdit/projectEditMets.xhtml index 5c7f731d0ae..0540addd497 100644 --- a/Kitodo/src/main/webapp/WEB-INF/templates/includes/projectEdit/projectEditMets.xhtml +++ b/Kitodo/src/main/webapp/WEB-INF/templates/includes/projectEdit/projectEditMets.xhtml @@ -161,94 +161,118 @@ - -
- -
+
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- - - - - - - +
- - - - - - - + + +

#{msgs['tooltip.headline']}

+
+ + + + + + + + + + + + +
- - - - - - -