Skip to content

Commit

Permalink
Added cross page navigation for measures.
Browse files Browse the repository at this point in the history
  • Loading branch information
haogatyp committed Apr 27, 2023
1 parent 5926b38 commit c4e2d9f
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
action="main"
pageUid="{settings.targetPid}"
additionalParams="{f:if(condition:'{child.id}', then:'{\'tx_dlf[id]\':child.id, \'tx_dlf[page]\':child.page}', else: '{\'tx_dlf[page]\':child.page}')}"
argumentsToBeExcludedFromQueryString="{0: 'tx_dlf[measure]'}"
addQueryString="1"
title="{f:if(condition:'{child.title}', then: '{child.title}', else: '{child.type}')}">
<f:render partial="TableOfContents/Title" arguments="{child: child}"/>
Expand Down
86 changes: 77 additions & 9 deletions Resources/Private/Plugins/Kitodo/Templates/Navigation/Main.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@
<f:if condition="{viewData.requestData.double}">
<f:then>
<div class="tx-dlf-navigation-double">
<f:link.action addQueryString="1" additionalParams="{'tx_dlf[double]':'0'}">
<f:link.action addQueryString="1" additionalParams="{'tx_dlf[double]':'0'}"
argumentsToBeExcludedFromQueryString="{0: 'tx_dlf[measure]'}">
<f:translate key="doublePageOn"/>
</f:link.action>
</div>
<div class="tx-dlf-navigation-double+">
<f:if condition="{viewData.requestData.double} && ({viewData.requestData.page} < {numPages})">
<f:then>
<f:link.action addQueryString="1" additionalParams="{'tx_dlf[page]':'{viewData.requestData.page + 1}'}">
<f:link.action addQueryString="1" additionalParams="{'tx_dlf[page]':'{viewData.requestData.page + 1}'}"
argumentsToBeExcludedFromQueryString="{0: 'tx_dlf[measure]'}">
<f:translate key="doublePage+1"/>
</f:link.action>
</f:then>
Expand All @@ -45,7 +47,8 @@
</div>
</f:then>
<f:else>
<f:link.action addQueryString="1" additionalParams="{'tx_dlf[double]':'1'}">
<f:link.action addQueryString="1" additionalParams="{'tx_dlf[double]':'1'}"
argumentsToBeExcludedFromQueryString="{0: 'tx_dlf[measure]'}">
<f:translate key="doublePageOn"/>
</f:link.action>
</f:else>
Expand All @@ -66,7 +69,8 @@
<span class="first">
<f:if condition="{viewData.requestData.page} > 1">
<f:then>
<f:link.action addQueryString="1" additionalParams="{'tx_dlf[page]':'1'}" class="first" >
<f:link.action addQueryString="1" additionalParams="{'tx_dlf[page]':'1'}" class="first"
argumentsToBeExcludedFromQueryString="{0: 'tx_dlf[measure]'}">
<f:translate key="firstPage"/>
</f:link.action>
</f:then>
Expand All @@ -83,7 +87,8 @@
<span class="rwnd">
<f:if condition="{viewData.requestData.page} > {pageSteps}">
<f:then>
<f:link.action addQueryString="1" additionalParams="{'tx_dlf[page]':'{viewData.requestData.page - pageSteps}'}">
<f:link.action addQueryString="1" additionalParams="{'tx_dlf[page]':'{viewData.requestData.page - pageSteps}'}"
argumentsToBeExcludedFromQueryString="{0: 'tx_dlf[measure]'}">
<f:translate key="backXPages" arguments="{0: '{pageSteps}'}"/>
</f:link.action>
</f:then>
Expand All @@ -100,7 +105,8 @@
<span class="prev">
<f:if condition="{viewData.requestData.page} > {viewData.requestData.double + 1}">
<f:then>
<f:link.action addQueryString="1" additionalParams="{'tx_dlf[page]':'{viewData.requestData.page - 1 - viewData.requestData.double}'}">
<f:link.action addQueryString="1" additionalParams="{'tx_dlf[page]':'{viewData.requestData.page - 1 - viewData.requestData.double}'}"
argumentsToBeExcludedFromQueryString="{0: 'tx_dlf[measure]'}">
<f:translate key="prevPage"/>
</f:link.action>
</f:then>
Expand Down Expand Up @@ -143,7 +149,8 @@
<span class="next">
<f:if condition="{viewData.requestData.page + viewData.requestData.double} < {numPages}">
<f:then>
<f:link.action addQueryString="1" additionalParams="{'tx_dlf[page]':'{viewData.requestData.page + 1 + viewData.requestData.double}'}">
<f:link.action addQueryString="1" additionalParams="{'tx_dlf[page]':'{viewData.requestData.page + 1 + viewData.requestData.double}'}"
argumentsToBeExcludedFromQueryString="{0: 'tx_dlf[measure]'}">
<f:translate key="nextPage"/>
</f:link.action>
</f:then>
Expand All @@ -160,7 +167,8 @@
<span class="fwd">
<f:if condition="{viewData.requestData.page} <= {numPages - pageSteps}">
<f:then>
<f:link.action addQueryString="1" additionalParams="{'tx_dlf[page]':'{viewData.requestData.page + pageSteps}'}">
<f:link.action addQueryString="1" additionalParams="{'tx_dlf[page]':'{viewData.requestData.page + pageSteps}'}"
argumentsToBeExcludedFromQueryString="{0: 'tx_dlf[measure]'}">
<f:translate key="forwardXPages" arguments="{0: '{pageSteps}'}"/>
</f:link.action>
</f:then>
Expand All @@ -177,7 +185,8 @@
<span class="last">
<f:if condition="{viewData.requestData.page} < {numPages - viewData.requestData.double}">
<f:then>
<f:link.action addQueryString="1" additionalParams="{'tx_dlf[page]':'{numPages - viewData.requestData.double}'}">
<f:link.action addQueryString="1" additionalParams="{'tx_dlf[page]':'{numPages - viewData.requestData.double}'}"
argumentsToBeExcludedFromQueryString="{0: 'tx_dlf[measure]'}">
<f:translate key="lastPage"/>
</f:link.action>
</f:then>
Expand Down Expand Up @@ -226,4 +235,63 @@
</a>
</li>
</f:section>

<f:section name="render.measureBack">
<f:if condition="{numMeasures} > 0">
<f:then>
<div class="measureBacks" style="top: 100px;">
<span class="prev">
<f:if condition="{currentMeasure} > 1}">
<f:then>
<f:variable name="prevMeasure" value="{currentMeasure - 1}" />
<f:link.action addQueryString="1" additionalParams="{'tx_dlf[measure]':'{currentMeasure - 1}', 'tx_dlf[page]':'{measurePages.{prevMeasure}}'}">
<f:translate key="prevMeasure"/>
</f:link.action>
</f:then>
<f:else>
<span title="{f:translate(key: 'prevPage')}">
<f:translate key="prevMeasure"/>
</span>
</f:else>
</f:if>
</span>
</div>
</f:then>
</f:if>
</f:section>

<f:section name="render.measureForward">
<f:if condition="{numMeasures} > 0">
<f:then>
<div class="measureFwds" style="top: 200px;">
<span class="next">
<f:if condition="{currentMeasure} < {numMeasures}">
<f:then>
<f:if condition="{currentMeasure} > 0">
<f:then>
<f:variable name="nextMeasure" value="{currentMeasure + 1}" />
<f:link.action addQueryString="1" additionalParams="{'tx_dlf[measure]':'{currentMeasure + 1}', 'tx_dlf[page]':'{measurePages.{nextMeasure}}'}">
<f:translate key="nextMeasure"/>
</f:link.action>
</f:then>
<f:else>
<f:link.action
addQueryString="1" additionalParams="{'tx_dlf[measure]':'1', 'tx_dlf[page]':'{measurePages.1}'}">
<f:translate key="nextMeasure"/>
</f:link.action>
</f:else>
</f:if>
</f:then>
<f:else>
<span title="{f:translate(key: 'nextMeasure')}">
<f:translate key="nextMeasure"/>
</span>
</f:else>
</f:if>
</span>
</div>
</f:then>
</f:if>
</f:section>

</html>

0 comments on commit c4e2d9f

Please sign in to comment.