Skip to content

Commit

Permalink
Apply PR 5639 and 5640
Browse files Browse the repository at this point in the history
  • Loading branch information
henning-gerhardt committed Mar 25, 2024
1 parent d460d41 commit 5925838
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,9 @@ private Element issueToXml(Document xml, Set<Pair<Integer, String>> afterDeclara
blockNode.setAttribute(ATTRIBUTE_VARIANT, Integer.toString(index + 1));
}
Element issueNode = xml.createElement(ELEMENT_APPEARED);
issueNode.setAttribute(ATTRIBUTE_ISSUE_HEADING, issue.getHeading());
if (!StringUtils.isBlank(issue.getHeading())) {
issueNode.setAttribute(ATTRIBUTE_ISSUE_HEADING, issue.getHeading());
}
issueNode.setAttribute(ATTRIBUTE_DATE, issue.getDate().toString());
addMetadataToIssue(xml, issue, issueNode);
Pair<Integer, String> afterDeclaration = Pair.of(index, issue.getHeading());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.Set;
import java.util.TreeSet;

import org.apache.commons.lang3.StringUtils;
import org.kitodo.production.helper.DateUtils;

/**
Expand Down Expand Up @@ -100,7 +101,7 @@ private static String titleToString(Block block, boolean subsequentBlock) {
appendDate(result, block.getLastAppearance());
result.append(" regelmäßig ");

result.append(iterateOverIssues(block, result));
iterateOverIssues(block, result);
return result.toString();
}

Expand All @@ -124,8 +125,10 @@ private static String iterateOverIssues(Block block, StringBuilder result) {
}
}
}
result.append(" als ");
result.append(issue.getHeading());
if (!StringUtils.isBlank(issue.getHeading())) {
result.append(" als ");
result.append(issue.getHeading());
}
if (issueIndex < currentIssuesSize - 2) {
result.append(", ");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
showHeader="false"
dynamic="true"
modal="true">
<h:form id="uploadFileForm">
<h:form id="uploadFileForm" enctype="multipart/form-data">
<p:panelGrid columns="1" layout="grid">
<h3>#{msgs['calendar.upload']}</h3>
<h:panelGroup layout="block"
Expand All @@ -37,6 +37,7 @@
styleClass="dialogButtonWrapper">
<p:commandButton id="upload"
action="#{CalendarForm.upload}"
ajax="false"
oncomplete="PF('uploadFileDialog').hide()"
value="#{msgs['calendar.upload.submit']}"
icon="fa fa-upload"
Expand Down
6 changes: 1 addition & 5 deletions Kitodo/src/main/webapp/pages/calendarEdit.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,19 @@
iconPos="right"
styleClass="secondary"/>

<!-- TODO disabled for now, because file is not transferred in uploadFileDialog.xhtml -->
<p:commandButton value="#{msgs['calendar.upload']}"
onclick="PF('uploadFileDialog').show()"
icon="fa fa-upload fa-lg"
iconPos="right"
type="button"
rendered="false"
styleClass="secondary"/>

<p:commandButton value="#{msgs.fileDownload}"
icon="fa fa-download fa-lg"
iconPos="right"
type="button"
ajax="false"
rendered="false"
onclick="setConfirmUnload(false);"
styleClass="secondary">
<!-- TODO disabled for now, because method is never called -->
<p:fileDownload value="#{CalendarForm.download()}"/>
</p:commandButton>

Expand Down

0 comments on commit 5925838

Please sign in to comment.