Skip to content

Commit

Permalink
Some changes
Browse files Browse the repository at this point in the history
Adds translation, removes unused variables and fixes some minor issues
Antoniafriedrich committed Oct 21, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 7112add commit 2b88614
Showing 5 changed files with 25 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -921,3 +921,6 @@ pdf.errorbox.button.info=Mehr Informationen
pdf.errorbox.button.download=Herunterladen
pdf.errorbox.conformity.level=Konformit\u00E4tstufe
pdf.errorbox.unknown.error=Keine weiteren Informationen!
pdf.errorbox.clause="Paragraph"
pdf.errorbox.test="Test"
pdf.errorbox.specification="Spezifikation"
Original file line number Diff line number Diff line change
@@ -873,3 +873,6 @@ pdf.errorbox.button.info=Learn More
pdf.errorbox.button.download=Download
pdf.errorbox.conformity.level=Conformity level
pdf.errorbox.unknown.error=No further information!
pdf.errorbox.clause="Clause"
pdf.errorbox.test="Test"
pdf.errorbox.specification="Specification"
2 changes: 1 addition & 1 deletion mir-module/src/main/resources/config/mir/mycore.properties
Original file line number Diff line number Diff line change
@@ -733,7 +733,7 @@ MCR.Object.Static.Content.Generator.mir-history.Transformer=mir-history
MCR.URIResolver.xslImports.mirworkflow=metadata/mir-workflow.xsl
MIR.Workflow.Menu=false
MIR.Workflow.Box=false
MIR.EnablePdfaValidationInWorkflow=false
MIR.Workflow.PDFValidation=false
##############################################################################
# new Metadata Layout #
##############################################################################
34 changes: 16 additions & 18 deletions mir-module/src/main/resources/xsl/metadata/mir-pdf-errorbox.xsl
Original file line number Diff line number Diff line change
@@ -6,18 +6,16 @@
xmlns:xalan="http://xml.apache.org/xalan"
version="1.0" exclude-result-prefixes="i18n mcrxsl">

<xsl:param name="WebApplicationBaseURL"/>
<xsl:param name="ServletsBaseURL" />
<xsl:param name="HttpSession"/>
<xsl:param name="ServletsBaseURL"/>

<xsl:template match="mycoreobject" mode="displayPdfError">

<xsl:template match="mycoreobject" mode="displayPdfError">
<xsl:variable name="errorMessages">
<xsl:apply-templates select="structure/derobjects/derobject" mode="displayPdfError"/>
</xsl:variable>

<xsl:choose>
<xsl:when test="contains($errorMessages,'Clause')">
<xsl:when test="contains($errorMessages,i18n:translate('pdf.errorbox.clause'))">
<div class="container pdf-validation mb-3 px-0" id="accordion">
<div class="card-header bg-danger text-white">
<div class="list-group list-group-root well p-3">
@@ -34,7 +32,8 @@
</div>
</div>
</xsl:when>
<xsl:when test="string-length(normalize-space($errorMessages)) > 0 and not(contains($errorMessages,'Clause'))">
<xsl:when
test="string-length(normalize-space($errorMessages)) > 0">
<div class="card-header bg-success text-white mb-3">
<div class="list-group list-group-root well p-3">
<p class="h5">
@@ -55,8 +54,6 @@
<xsl:if test="not(normalize-space($result))">
<xsl:apply-templates select="$result/derivate/file" mode="displayPdfError"/>
</xsl:if>
<xsl:variable name="derivbase" select="concat($ServletsBaseURL,'MCRFileNodeServlet/',$result/derivate/@id,'/')" />
<xsl:variable name="derivdir" select="concat($derivbase,$HttpSession)" />
</xsl:template>

<xsl:template match="file" mode="displayPdfError">
@@ -76,7 +73,7 @@
<div id="{$derivate}{$uniqueFileId}" class="font-weight-bold d-flex list-group list-group-root">
<a onclick="$('#{$derivate}{$uniqueFileId}cbButton').toggleClass('fa-chevron-right fa-chevron-down');"
data-toggle="collapse" href="#collapse{$derivate}{$uniqueFileId}"
class="text-left d-flex flex-md-row flex-grow-1 list-group-item align-items-center">
class="text-left d-flex flex-md-row flex-grow-1 list-group-item align-items-center">
<i id="{$derivate}{$uniqueFileId}cbButton" class="fa fa-chevron-right ml-auto mr-1"/>
<span class="flex-grow-1 font-weight-bold text-break">
<xsl:value-of select="$name"/>
@@ -97,7 +94,8 @@
</span>
</p>
<xsl:variable name="downloadLink">
<xsl:value-of select="concat($ServletsBaseURL,'MCRFileNodeServlet/',$derivate,'/',mcrxsl:encodeURIPath(@name))"/>
<xsl:value-of
select="concat($ServletsBaseURL,'MCRFileNodeServlet/',$derivate,'/',mcrxsl:encodeURIPath(@name))"/>
</xsl:variable>


@@ -114,19 +112,19 @@
<li class="list-group-item d-flex flex-column flex-xl-row flex-grow-1 text-break">
<p class="flex-grow col-lg-8 col-md-9 align-self-center">
<span class="text-muted pdf-term">
Specification:
<xsl:value-of select="concat(i18n:translate('pdf.errorbox.specification'),': ')"/>
</span>
<span class="pdf-value">
<xsl:value-of select="concat(' ', @specification, ' ')"/>
</span>
<span class="text-muted pdf-term">
Clause:
<xsl:value-of select="concat(i18n:translate('pdf.errorbox.clause'),': ')"/>
</span>
<span class="pdf-value">
<xsl:value-of select="concat(' ', @clause, ' ')"/>
</span>
<span class="text-muted pdf-term">
Test:
<xsl:value-of select="concat(i18n:translate('pdf.errorbox.test'),': ')"/>
</span>
<span class="pdf-value">
<xsl:value-of select="concat(' ', @testNumber, ' ')"/>
@@ -149,20 +147,20 @@
</xsl:template>

<xsl:template name="pdfError.getFilename">
<xsl:param name="filePath" />
<xsl:variable name="rest-of" select="substring-after($filePath, '/')" />
<xsl:param name="filePath"/>
<xsl:variable name="rest-of" select="substring-after($filePath, '/')"/>
<xsl:choose>
<xsl:when test="contains($rest-of, '/')">
<xsl:call-template name="pdfError.getFilename">
<xsl:with-param name="filePath" select="$rest-of" />
<xsl:with-param name="filePath" select="$rest-of"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:if test="normalize-space($rest-of)">
<xsl:value-of select="$rest-of" />
<xsl:value-of select="$rest-of"/>
</xsl:if>
<xsl:if test="not(normalize-space($rest-of))">
<xsl:value-of select="$filePath" />
<xsl:value-of select="$filePath"/>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
4 changes: 2 additions & 2 deletions mir-module/src/main/resources/xsl/metadata/mir-workflow.xsl
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
<xsl:param name="CurrentUser"/>

<xsl:param name="MIR.Workflow.Debug" select="'false'"/>
<xsl:param name="MIR.EnablePdfaValidationInWorkflow" select="'false'"/>
<xsl:param name="MIR.Workflow.PDFValidation" select="'false'"/>
<xsl:key use="@id" name="rights" match="/mycoreobject/rights/right"/>
<xsl:variable name="id" select="/mycoreobject/@ID"/>

@@ -129,7 +129,7 @@
</xsl:message>
</xsl:if>

<xsl:if test="normalize-space($MIR.EnablePdfaValidationInWorkflow)='true'">
<xsl:if test="normalize-space($MIR.Workflow.PDFValidation)='true'">
<xsl:apply-templates select="." mode="displayPdfError"/>
</xsl:if>
</xsl:template>

0 comments on commit 2b88614

Please sign in to comment.