Skip to content

Commit

Permalink
Design improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
IkramMaalej committed Feb 4, 2022
1 parent 3ca4461 commit 82943ad
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 25 deletions.
23 changes: 23 additions & 0 deletions Kitodo/src/main/java/org/kitodo/production/forms/CalendarForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -914,4 +914,27 @@ public void checkDuplicatedTitles() throws ProcessGenerationException, DataExcep
PrimeFaces.current().executeScript("PF('createProcessesConfirmDialog').show();");
}
}

/**
* Get first issue that's appear on the selected Date.
* @return issue
*/
public Issue getFirstMatchIssue() {
if (selectedDate != null) {
return getCalendarSheet().get(selectedDate.getDayOfMonth() - 1).get(selectedDate.getMonthValue() - 1).getIssues()
.parallelStream()
.filter(issue -> issue.isMatch(selectedDate))
.findFirst().orElse(null);
}
return null;
}

/**
* add Metadata to all Issues that's appear on the selected Date.
*/
public void addMetadataToAllMatchIssues() {
if (getFirstMatchIssue() != null) {
addMetadata(getFirstMatchIssue());
}
}
}
2 changes: 2 additions & 0 deletions Kitodo/src/main/resources/messages/messages_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ 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.currentValue=Aktueller Wert
calendar.metadata.firstAppearance=von
calendar.metadata.lastAppearance=bis
Expand Down
2 changes: 2 additions & 0 deletions Kitodo/src/main/resources/messages/messages_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ 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.currentValue=Current value
calendar.metadata.firstAppearance=from
calendar.metadata.lastAppearance=up to
Expand Down
6 changes: 0 additions & 6 deletions Kitodo/src/main/webapp/WEB-INF/resources/css/kitodo.css
Original file line number Diff line number Diff line change
Expand Up @@ -1648,8 +1648,6 @@ h3#headerText.calendar-heading {
border-bottom: solid var(--default-border-width) var(--cloudy-gray);
}



#calendarDayDialog .metadata-first-appearance,
#calendarDayDialog .metadata-last-appearance {
display: inline-block;
Expand All @@ -1663,10 +1661,6 @@ h3#headerText.calendar-heading {
vertical-align: top;
}

#calendarDayDialog .ui-inputtextarea{
height: 50px;
}

#calendarDayDialog .metadata-value-label {
vertical-align: top;
margin-left: var(--default-half-size);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<p:commandButton action="#{CalendarForm.addIssue(block)}"
value="#{msgs['calendar.issue.add']}"
icon="fa fa-plus"
styleClass="secondary"
styleClass="callto"
iconPos="right"
title="#{msgs['calendar.issue.add']}"
update="editForm:calendarTabView:calendarDetailsLayout"/>
Expand All @@ -101,7 +101,6 @@
<p:column headerText="#{msgs['name']}" width="200" >
<p:inputText value="#{issue.heading}"
id="issueName"
required="true"
styleClass="input-with-button" >
<p:ajax event="blur" listener="#{block.checkIssuesWithSameHeading()}"
update="editForm:calendarTabView:calendarDetailsLayout"/>
Expand All @@ -113,7 +112,6 @@
<p:column headerText="#{msgs['calendar.day.1']}"
width="30">
<p:selectBooleanCheckbox value="#{issue.monday}"
disabled="#{issue.heading eq ''}"
title="#{msgs['calendar.day.1']}">
<p:ajax event="change"
update="editForm:calendarTabView:calendarDetailsLayout"/>
Expand All @@ -122,7 +120,6 @@
<p:column headerText="#{msgs['calendar.day.2']}"
width="30">
<p:selectBooleanCheckbox value="#{issue.tuesday}"
disabled="#{issue.heading eq ''}"
title="#{msgs['calendar.day.2']}">
<p:ajax event="change"
update="editForm:calendarTabView:calendarDetailsLayout"/>
Expand All @@ -131,7 +128,6 @@
<p:column headerText="#{msgs['calendar.day.3']}"
width="30">
<p:selectBooleanCheckbox value="#{issue.wednesday}"
disabled="#{issue.heading eq ''}"
title="#{msgs['calendar.day.3']}">
<p:ajax event="change"
update="editForm:calendarTabView:calendarDetailsLayout"/>
Expand All @@ -140,7 +136,6 @@
<p:column headerText="#{msgs['calendar.day.4']}"
width="30">
<p:selectBooleanCheckbox value="#{issue.thursday}"
disabled="#{issue.heading eq ''}"
title="#{msgs['calendar.day.4']}">
<p:ajax event="change"
update="editForm:calendarTabView:calendarDetailsLayout"/>
Expand All @@ -149,7 +144,6 @@
<p:column headerText="#{msgs['calendar.day.5']}"
width="30">
<p:selectBooleanCheckbox value="#{issue.friday}"
disabled="#{issue.heading eq ''}"
title="#{msgs['calendar.day.5']}">
<p:ajax event="change"
update="editForm:calendarTabView:calendarDetailsLayout"/>
Expand All @@ -158,7 +152,6 @@
<p:column headerText="#{msgs['calendar.day.6']}"
width="30">
<p:selectBooleanCheckbox value="#{issue.saturday}"
disabled="#{issue.heading eq ''}"
title="#{msgs['calendar.day.6']}">
<p:ajax event="change"
update="editForm:calendarTabView:calendarDetailsLayout"/>
Expand All @@ -167,7 +160,6 @@
<p:column headerText="#{msgs['calendar.day.7']}"
width="30">
<p:selectBooleanCheckbox value="#{issue.sunday}"
disabled="#{issue.heading eq ''}"
title="#{msgs['calendar.day.7']}">
<p:ajax event="change"
update="editForm:calendarTabView:calendarDetailsLayout"/>
Expand Down Expand Up @@ -218,7 +210,7 @@
iconPos="right"
value="#{msgs['calendar.block.remove']}"
title="#{msgs['calendar.block.remove']}"
styleClass="remove-block"
styleClass="remove-block secondary"
style="display: inline-block"
update="editForm:calendarTabView:calendarDetailsLayout">
<p:confirm severity="alert"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,27 @@
modal="true">
<!--@elvariable id="date" type="java.time.LocalDate"-->
<ui:param name="date" value="#{CalendarForm.selectedDate}"/>
<h3>
#{msgs['calendar.day.'.concat(date.dayOfWeek.value)]}
#{date.toString()}
(#{msgs['calendar.block']} #{CalendarForm.course.indexOf(CalendarForm.getSelectedBlock())+1})
</h3>
<p:panelGrid columns="2" id="header" style="width: 95%">
<p:row style="display: inherit">
<h3>
#{msgs['calendar.day.'.concat(date.dayOfWeek.value)]}
#{date.toString()}
(#{msgs['calendar.block']} #{CalendarForm.course.indexOf(CalendarForm.getSelectedBlock())+1})
</h3>
</p:row>
<p:row>
<p:commandButton id="addMetadataGlobal"
action="#{CalendarForm.addMetadataToAllMatchIssues()}"
rendered="#{CalendarForm.getFirstMatchIssue() ne null}"
value="#{msgs['calendar.metadata.add']}"
title="#{msgs['calendar.metadata.global.add']}"
icon="fa fa-plus"
iconPos="right"
styleClass="callto right"
style="padding: 5px"
update="calendarDayForm"/>
</p:row>
</p:panelGrid>
<h:form id="calendarDayForm">
<h:panelGroup layout="block"
styleClass="dialogFieldWrapper">
Expand All @@ -49,13 +65,12 @@
icon="#{issue.isMatch(date) ? 'fa fa-trash' : 'fa fa-plus'}"
iconPos="right"
styleClass="secondary"
update="editForm:calendarTabView:calendarDetailsLayout
calendarDayForm"/>
update="editForm:calendarTabView:calendarDetailsLayout header calendarDayForm"/>
<!-- Add metadata-->
<p:commandButton id="addMetadata"
action="#{CalendarForm.addMetadata(issue)}"
value="#{msgs['calendar.metadata.add']}"
title="#{msgs['calendar.metadata.add']}"
title="#{msgs['calendar.metadata.issue.add']}"
icon="fa fa-plus"
iconPos="right"
rendered="#{issue.isMatch(date)}"
Expand Down Expand Up @@ -111,7 +126,7 @@
<p:inputTextarea value="#{metadata.startValue}"
rendered="#{metadata.metadataDetail.input eq 'inputTextarea'}"
styleClass="input"
style="width: 60%; height: 55px"
style="width: 60%;"
title="#{msgs['calendar.metadata.startValue']}">
<p:ajax event="blur" update="calendarDayForm"/>
</p:inputTextarea>
Expand Down

0 comments on commit 82943ad

Please sign in to comment.