Skip to content

Commit

Permalink
Add metadata editor setting to show physical page number below thumbn…
Browse files Browse the repository at this point in the history
…ails.
  • Loading branch information
thomaslow committed Sep 30, 2024
1 parent eded39f commit 9740e2b
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ public class User extends BaseBean {
@Column(name = "paginate_from_first_page_by_default")
private boolean paginateFromFirstPageByDefault;

@Column(name = "show_physical_page_number_below_thumbnail")
private boolean showPhysicalPageNumberBelowThumbnail;

/**
* Constructor for User Entity.
*/
Expand Down Expand Up @@ -151,6 +154,7 @@ public User(User user) {
this.showPaginationByDefault = user.showPaginationByDefault;
this.paginateFromFirstPageByDefault = user.paginateFromFirstPageByDefault;
this.defaultGalleryViewMode = user.defaultGalleryViewMode;
this.showPhysicalPageNumberBelowThumbnail = user.showPhysicalPageNumberBelowThumbnail;

if (user.roles != null) {
this.roles = user.roles;
Expand Down Expand Up @@ -514,6 +518,24 @@ public void setPaginateFromFirstPageByDefault(boolean paginateFromFirstPageByDef
this.paginateFromFirstPageByDefault = paginateFromFirstPageByDefault;
}

/**
* Get showPhysicalPageNumberBelowThumbnail.
*
* @return value of showPhysicalPageNumberBelowThumbnail
*/
public boolean isShowPhysicalPageNumberBelowThumbnail() {
return showPhysicalPageNumberBelowThumbnail;
}

/**
* Set showPhysicalPageNumberBelowThumbnail.
*
* @param showPhysicalPageNumberBelowThumbnail as boolean
*/
public void setShowPhysicalPageNumberBelowThumbnail(boolean showPhysicalPageNumberBelowThumbnail) {
this.showPhysicalPageNumberBelowThumbnail = showPhysicalPageNumberBelowThumbnail;
}

/**
* Removes a user from the environment. Since the
* user ID may still be referenced somewhere, the user is not hard deleted from
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--
-- (c) Kitodo. Key to digital objects e. V. <[email protected]>
--
-- This file is part of the Kitodo project.
--
-- It is licensed under GNU General Public License version 3 or later.
--
-- For the full copyright and license information, please read the
-- GPL3-License.txt file that was distributed with this source code.
--

-- Add column "show_physical_page_number_below_thumbnail" to "user" table
ALTER TABLE user ADD show_physical_page_number_below_thumbnail TINYINT(1) DEFAULT 0;
1 change: 1 addition & 0 deletions Kitodo/src/main/resources/messages/messages_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,7 @@ userEdit.metadataEditorSettings.defaultGalleryView = Standardansicht Galerie
userEdit.metadataEditorSettings.paginateFromFirstPageByDefault = Standardm\u00E4ssig ab erster markierten Seite paginieren
userEdit.metadataEditorSettings.showCommentsByDefault = Kommentare standardm\u00E4ssig einblenden
userEdit.metadataEditorSettings.showPaginationByDefault = Paginierung standardm\u00E4ssig einblenden
userEdit.metadataEditorSettings.showPhysicalPageNumberBelowThumbnail = Physische Seitennummer unter Thumbnails anzeigen
userInstruction=Bedienungshinweise
userInstructionText=Sie finden Bedienungshinweise f\u00FCr Kitodo.Production 3.x in der
userList=Benutzerliste
Expand Down
1 change: 1 addition & 0 deletions Kitodo/src/main/resources/messages/messages_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1181,6 +1181,7 @@ userEdit.metadataEditorSettings.defaultGalleryView = Default gallery view
userEdit.metadataEditorSettings.paginateFromFirstPageByDefault = By default paginate from first selected page
userEdit.metadataEditorSettings.showCommentsByDefault = Show comments by default
userEdit.metadataEditorSettings.showPaginationByDefault = Show pagination by default
userEdit.metadataEditorSettings.showPhysicalPageNumberBelowThumbnail = Show physical page number below thumbnails
userInstruction=User instructions
userInstructionText=You will find instructions for Kitodo.Production 3.x in the
userList=User list
Expand Down
2 changes: 2 additions & 0 deletions Kitodo/src/main/resources/messages/messages_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,8 @@ userEdit.metadataEditorSettings.defaultGalleryView = Vista predetermina de la ga
userEdit.metadataEditorSettings.paginateFromFirstPageByDefault = Paginación predeterminada desde la primera página seleccionada
userEdit.metadataEditorSettings.showCommentsByDefault = Mostrar comentarios predeterminados
userEdit.metadataEditorSettings.showPaginationByDefault = Mostrar páginación predeterminada
# please check google translation below and remove comment if translation is acceptable
userEdit.metadataEditorSettings.showPhysicalPageNumberBelowThumbnail = Mostrar el número de página física debajo de la miniatura
userInstruction=Instrucciones de uso
userInstructionText=Encontrará instrucciones para Kitodo.Production 3.x en el
userList=Lista de usuarios
Expand Down
49 changes: 27 additions & 22 deletions Kitodo/src/main/webapp/WEB-INF/resources/css/kitodo.css
Original file line number Diff line number Diff line change
Expand Up @@ -3392,27 +3392,9 @@ Column content

.thumbnail-parent {
display: block;
height: 104px;
width: 75px;
position: relative;
}

.thumbnail-parent.media-type-video {
width: 185px;
height: auto;
}

.thumbnail-parent.media-type-audio {
width: 120px;
height: auto;
}

#imagePreviewForm\:thumbnailStripe .thumbnail-parent.media-type-audio,
#imagePreviewForm\:thumbnailStripe .thumbnail-parent.media-type-video {
width: 90px;
height: auto;
}

.thumbnail-parent audio,
.thumbnail-parent video {
width: 100%;
Expand All @@ -3421,6 +3403,8 @@ Column content

.thumbnail-parent video {
height: auto;
vertical-align: bottom;
box-sizing: border-box;
}

.thumbnail {
Expand Down Expand Up @@ -3468,13 +3452,27 @@ Column content
border-style: solid;
}



.thumbnail-container {
display: inline-block;
height: 100%;
position: relative;
width: 100%;
height: 104px;
width: 75px;
}

.thumbnail-container.media-type-video {
width: 185px;
height: auto;
}

.thumbnail-container.media-type-audio {
width: 120px;
height: auto;
}

#imagePreviewForm\:thumbnailStripe .thumbnail-container.media-type-audio,
#imagePreviewForm\:thumbnailStripe .thumbnail-container.media-type-video {
width: 90px;
height: auto;
}

.thumbnail-container > .ui-widget-content {
Expand Down Expand Up @@ -3580,6 +3578,13 @@ Column content
opacity: .7;
}

.thumbnail-parent .thumbnail-banner {
word-break: break-word;
color: var(--pure-white);
font-size: smaller;
text-align: center;
}

#imagePreviewForm {
height: 100%;
overflow: hidden;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
xmlns:p="http://primefaces.org/ui"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">

<p:outputPanel styleClass="thumbnail-parent #{fn:startsWith(media.previewMimeType, 'video') ? 'media-type-video' : ''}#{fn:startsWith(media.previewMimeType, 'audio') ? 'media-type-audio' : ''}" >
<p:outputPanel styleClass="thumbnail-parent" >
<c:choose>
<c:when test="#{uiParamStripeIndex eq '0' || uiParamStripeIndex eq 0}">
<c:set var="thumbnailStyleClass"
Expand All @@ -33,7 +33,7 @@
</c:choose>
<p:outputPanel
styleClass="thumbnail #{DataEditorForm.consecutivePagesSelected() ? '' : 'discontinuous'} #{thumbnailStyleClass}"/>
<p:outputPanel styleClass="thumbnail-container"
<p:outputPanel styleClass="thumbnail-container #{fn:startsWith(media.previewMimeType, 'video') ? 'media-type-video' : ''}#{fn:startsWith(media.previewMimeType, 'audio') ? 'media-type-audio' : ''}"
a:data-order="#{media.order}"
a:data-stripe="#{uiParamStripeIndex}"
a:data-logicalTreeNodeId="#{media.logicalTreeNodeId}">
Expand Down Expand Up @@ -95,6 +95,20 @@
<ui:include src="media-list-content.xhtml"/>

</p:outputPanel>

<ui:fragment rendered="#{LoginForm.loggedUser.isShowPhysicalPageNumberBelowThumbnail()}">
<p:outputPanel class="thumbnail-banner">
<h:outputText rendered="#{media.type eq 'VIDEO'}">
#{msgs.video} #{media.shortId}
</h:outputText>
<h:outputText rendered="#{media.type eq 'AUDIO'}">
#{msgs.audio} #{media.shortId}
</h:outputText>
<h:outputText rendered="#{media.type eq 'IMAGE'}">
#{msgs.image} #{media.shortId}
</h:outputText>
</p:outputPanel>
</ui:fragment>
</p:outputPanel>

</ui:composition>
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,15 @@
value="#{UserForm.userObject.paginateFromFirstPageByDefault}"
onchange="toggleSave()"/>
</div>
<div>
<p:outputLabel for="showPhysicalPageNumberBelowThumbnail"
value="#{msgs['userEdit.metadataEditorSettings.showPhysicalPageNumberBelowThumbnail']}"/>
<p:selectBooleanCheckbox id="showPhysicalPageNumberBelowThumbnail"
styleClass="switch input"
disabled="#{isViewMode}"
value="#{UserForm.userObject.showPhysicalPageNumberBelowThumbnail}"
onchange="toggleSave()"/>
</div>
</p:row>
</p:panelGrid>
</ui:composition>

0 comments on commit 9740e2b

Please sign in to comment.