Skip to content

Commit

Permalink
Code improvement 2
Browse files Browse the repository at this point in the history
  • Loading branch information
IkramMaalej committed Feb 1, 2022
1 parent c88ef1f commit b5e8d3a
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public Issue addIssue() {
* metadata to add
*/
public void addMetadata(CountableMetadata countableMetadata) {
metadata.add(countableMetadata);
metadata.add(0, countableMetadata);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public static List<MetadataViewInterface> getAddableMetadata(Process completeEdi
*/
public static String getMetadataTranslation(List<ProcessDetail> metadataList, String metadataKey) {
for (ProcessDetail selectItem : metadataList) {
if (selectItem.getLabel().equals(metadataKey)) {
if (selectItem.getMetadataID().equals(metadataKey)) {
return selectItem.getLabel();
}
}
Expand Down
2 changes: 1 addition & 1 deletion Kitodo/src/main/resources/messages/errors_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ docketMissing=Die Konfigurationsdatei zur Laufzettelgenerierung existiert nicht
docketNotFound=Die angegebene Datei konnte nicht gefunden werden.
docketTitleDuplicated=Der Laufzettel mit den gleichen Titel existiert schon.
docTypeNotFound=docType ''{0}'' wurde nicht im selektierten Regelsatz gefunden
duplicatedTitles=Es wurden duplizierte Titel gefunden
duplicatedTitles=Es wurden dublette Ausgabe-Bezeichnungen gefunden. Dies erzeugt gegebenenfalls dublette Vorgangstitel!
emptySourceFolder=Der Quellordner zur Bildgenerierung ist leer
errorDataIncomplete=Unvollst\u00E4ndige Daten\:
errorDatabaseReading=Fehler beim Datenbanklesen von ''{0}'' with ID {1}.
Expand Down
2 changes: 1 addition & 1 deletion Kitodo/src/main/resources/messages/errors_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ docketMissing=the configuration file for docket creation is missing
docketNotFound=The specified file could not be found.
docketTitleDuplicated=The docket with the same title exists already.
docTypeNotFound=docType ''{0}'' could not be found in selected ruleset
duplicatedTitles=Duplicated titles found
duplicatedTitles=Duplicate issue designations were found. This may produce duplicate process titles!
emptySourceFolder=The source folder is empty
errorDataIncomplete=Incomplete data\:
errorDatabaseReading=Error on reading database for ''{0}'' with ID {1}.
Expand Down
7 changes: 4 additions & 3 deletions Kitodo/src/main/resources/messages/messages_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,10 @@ calendar.issue.add=Ausgabe hinzuf\u00FCgen
calendar.issue.delete=Ausgabe l\u00F6schen
calendar.issue.delete.query=Wollen Sie die Augabe l\u00F6schen?
calendar.jumpToDay=Zu Tag springen
calendar.metadata.add=Metadatum hinzuf\u00FCgen
calendar.metadata.global.add=Metadatum zu allen erschienen Ausgaben hinzuf\u00FCgen
calendar.metadata.issue.add=Metadatum zu allen erschienen Ausgaben ab dieser hinzuf\u00FCgen
calendar.metadata.global.add=Metadatum allen Ausgaben hinzuf\u00FCgen
calendar.metadata.issue.add=Metadatum hinzuf\u00FCgen
calendar.metadata.global.add.tooltip=Metadatum zu allen erschienen Ausgaben hinzuf\u00FCgen
calendar.metadata.issue.add.tooltip=Metadatum zu allen erschienen Ausgaben ab dieser hinzuf\u00FCgen
calendar.metadata.currentValue=Aktueller Wert
calendar.metadata.firstAppearance=von
calendar.metadata.lastAppearance=bis
Expand Down
7 changes: 4 additions & 3 deletions Kitodo/src/main/resources/messages/messages_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,10 @@ calendar.issue.add=Add issue
calendar.issue.delete=Delete issue
calendar.issue.delete.query=Do you want to delete the issue?
calendar.jumpToDay=Jump to day
calendar.metadata.add=Add metadata
calendar.metadata.global.add=Add metadata to all appeared issues
calendar.metadata.issue.add=Add metadata to all appeared issues from this one onwards
calendar.metadata.global.add=Add metadata to all issues
calendar.metadata.issue.add=Add metadata
calendar.metadata.global.add.tooltip=Add metadata to all appeared issues
calendar.metadata.issue.add.tooltip=Add metadata to all appeared issues from this one onwards
calendar.metadata.currentValue=Current value
calendar.metadata.firstAppearance=from
calendar.metadata.lastAppearance=up to
Expand Down
23 changes: 22 additions & 1 deletion Kitodo/src/main/webapp/WEB-INF/resources/css/kitodo.css
Original file line number Diff line number Diff line change
Expand Up @@ -1604,6 +1604,17 @@ h3#headerText.calendar-heading {
color: var(--carbon-blue);
}

#calendarDayDialog {
width: 80% !important;
height: 80% !important;
overflow-y: hidden ;
}

#calendarDayDialog_content {
height: 100% !important;
overflow-y: hidden ;
}

#calendarDayDialog .ui-dialog-content,
#calendarDayDialog form,
#calendarDayDialog form > .ui-panelgrid,
Expand All @@ -1613,20 +1624,30 @@ h3#headerText.calendar-heading {

#calendarDayDialog form {
height: calc(100% - 100px);
overflow-y: scroll;
overflow-y: auto;
}

#calendarDayDialog .dialogButtonWrapper {
bottom: var(--default-full-size);
display: inline-block;
height: 60px;
position: absolute;
width: calc(100% - var(--default-double-size));
}

#calendarDayDialog .dialogFieldWrapper {
min-height: 100%;
margin-bottom: 0;
overflow-y: hidden;
}

#calendarDayDialogHeader {
width: 100%;
padding-left: var(--default-double-size);
padding-right: var(--default-double-size);
padding-bottom: var(--default-full-size);
}

#calendarDayDialog .issue-wrapper:not(:last-child) {
border-bottom: solid var(--default-border-width) var(--cloudy-gray);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,13 @@
<p:dialog id="calendarDayDialog"
widgetVar="calendarDayDialog"
resizable="false"
width="800"
height="480"
showHeader="false"
dynamic="true"
position="center center"
modal="true">
<!--@elvariable id="date" type="java.time.LocalDate"-->
<ui:param name="date" value="#{CalendarForm.selectedDate}"/>
<p:panelGrid columns="2" id="header" style="width: 95%">
<p:row style="display: inherit">
<h:panelGrid columns="2" id="calendarDayDialogHeader">
<p:row>
<h3>
#{msgs['calendar.day.'.concat(date.dayOfWeek.value)]}
#{date.toString()}
Expand All @@ -39,15 +36,15 @@
<p:commandButton id="addMetadataGlobal"
action="#{CalendarForm.addMetadataToAllMatchIssues()}"
rendered="#{CalendarForm.getFirstMatchIssue() ne null}"
value="#{msgs['calendar.metadata.add']}"
title="#{msgs['calendar.metadata.global.add']}"
value="#{msgs['calendar.metadata.global.add']}"
title="#{msgs['calendar.metadata.global.add.tooltip']}"
icon="fa fa-plus"
iconPos="right"
styleClass="callto right"
style="padding: 5px"
update="calendarDayForm"/>
</p:row>
</p:panelGrid>
</h:panelGrid>
<h:form id="calendarDayForm">
<h:panelGroup layout="block"
styleClass="dialogFieldWrapper">
Expand All @@ -65,12 +62,12 @@
icon="#{issue.isMatch(date) ? 'fa fa-trash' : 'fa fa-plus'}"
iconPos="right"
styleClass="secondary"
update="editForm:calendarTabView:calendarDetailsLayout header calendarDayForm"/>
update="editForm:calendarTabView:calendarDetailsLayout calendarDayDialogHeader calendarDayForm"/>
<!-- Add metadata-->
<p:commandButton id="addMetadata"
action="#{CalendarForm.addMetadata(issue)}"
value="#{msgs['calendar.metadata.add']}"
title="#{msgs['calendar.metadata.issue.add']}"
value="#{msgs['calendar.metadata.issue.add']}"
title="#{msgs['calendar.metadata.issue.add.tooltip']}"
icon="fa fa-plus"
iconPos="right"
rendered="#{issue.isMatch(date)}"
Expand Down Expand Up @@ -231,6 +228,8 @@
</p:repeat>
</p:panelGrid>
</h:panelGroup>
</h:form>
<p:panelGrid>
<h:panelGroup layout="block"
styleClass="dialogButtonWrapper">
<p:commandButton id="close"
Expand All @@ -241,6 +240,6 @@
iconPos="right"
styleClass="primary right"/>
</h:panelGroup>
</h:form>
</p:panelGrid>
</p:dialog>
</ui:composition>

0 comments on commit b5e8d3a

Please sign in to comment.