Skip to content

Commit

Permalink
Merge pull request #100 from slub/bugfix/more-templates
Browse files Browse the repository at this point in the history
add more slub templates
  • Loading branch information
beatrycze-volk authored Dec 19, 2024
2 parents d479dfe + e44540a commit 3e6669e
Show file tree
Hide file tree
Showing 3 changed files with 431 additions and 0 deletions.
182 changes: 182 additions & 0 deletions Resources/Private/Plugins/Kitodo/Partials/ListView/Results.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
<f:comment>
<!--
* (c) Kitodo. Key to digital objects e.V. <[email protected]>
*
* This file is part of the Kitodo and TYPO3 projects.
*
* @license GNU General Public License version 3 or later.
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
-->
</f:comment>
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
xmlns:kitodo="http://typo3.org/ns/Kitodo/Dlf/ViewHelpers"
data-namespace-typo3-fluid="true">

<f:variable name="currentPage" value="{pagination.currentPageNumber - 1}" />
<f:variable name="pageOffset" value="{settings.list.paginate.itemsPerPage * currentPage}" />
<ol class="tx-dlf-abstracts">
<f:for each="{paginator.paginatedItems}" as="document" iteration="docIterator">
<f:variable name="docTitle" value="{f:if(condition:'{document.title}', then:'{document.title}', else:'{document.metsOrderlabel}')}" />
<li value="{settings.list.paginate.itemsPerPage * pageOffset + docIterator.index}">
<f:link.page
pageUid="{settings.targetPidPageView}"
additionalParams="{tx_dlf:{page:'{document.page}', double:'0', id:'{document.uid}', pagegrid:'0'}}"
class=""
title="{docTitle}">
<f:comment>
slub_digitalcollections uses the :empty CSS selector to check for missing thumbnail.
The HTML comments make sure there is no whitespace in that case.
</f:comment>
<div class="tx-dlf-listview-thumbnail"><!--
--><f:if condition="{document.thumbnail}">
<img src="{document.thumbnail}" loading="lazy" alt="Vorschaubild von {docTitle}" />
</f:if><!--
--></div>
<dl>
<dt class="tx-dlf-title"><f:translate key='LLL:EXT:dlf/Resources/Private/Language/locallang_metadata.xlf:metadata.title' /></dt>
<dd class="tx-dlf-title">{docTitle}</dd>
<f:if condition="{document.metadata}">
<f:for each="{listedMetadata}" as="metadata">
<f:if condition="{document.metadata.{metadata.indexName}.0} && {metadata.indexName} != 'type' && {metadata.indexName} != 'title'">
<dt class="tx-dlf-metadata-{metadata.indexName}">{metadata.label}</dt>
<f:for each="{document.metadata.{metadata.indexName}}" as="metadataentry">
<dd class="tx-dlf-metadata-{metadata.indexName}">{metadataentry}</dd>
</f:for>
</f:if>
</f:for>
<f:if condition="{document.structure} == 'year'">
<dt class="tx-dlf-metadata-year"><f:translate key='LLL:EXT:dlf/Resources/Private/Language/locallang_metadata.xlf:metadata.year' /></dt>
<dd class="tx-dlf-metadata-year">{document.metsOrderlabel} </dd>
</f:if>
</f:if>
<dt class="tx-dlf-type"><f:translate key='LLL:EXT:dlf/Resources/Private/Language/locallang_metadata.xlf:metadata.type' /></dt>
<dd class="tx-dlf-type">
<f:translate key="LLL:EXT:dlf/Resources/Private/Language/locallang_structure.xlf:structure.{document.structure}" default="{document.structure}"/>
</dd>
</dl>
</f:link.page>

<f:render partial="Basket/AddToBasket" arguments="{result: document}" />

<f:if condition="{document.children} || {document.searchResults}">
<button class="tx-dlf-morevolumes" title="{f:translate(key='listview.moredetails.toggle')}"><f:translate key='listview.moredetails.toggle' /></button>
</f:if>
<f:if condition="{document.children}">
<ol class="tx-dlf-volume">
<f:for each="{document.children}" as="child" iteration="childIterator">
<f:if condition="{document.structure} == 'ephemera' || {document.structure} == 'newspaper'">
<f:then>
<f:comment>Special output for Newspaper / Ephemera</f:comment>
<li value="{childIterator.cycle}" class="years">
<f:link.page
pageUid="{settings.targetPidPageView}"
additionalParams="{tx_dlf:{page:'1', double:'0', id:'{child.uid}', pagegrid:'0'}}"
class=""
title="{f:if(condition:'{child.metsOrderlabel}', then:'{child.metsOrderlabel}', else:'[{document.title}]')}">
{child.metsOrderlabel}
</f:link.page>
</li>
</f:then>
<f:else>
<li value="{childIterator.cycle}" class="pageresult">
<f:link.page
pageUid="{settings.targetPidPageView}"
additionalParams="{tx_dlf:{page:'1', double:'0', id:'{child.uid}', pagegrid:'0'}}"
class=""
title="{f:if(condition:'{child.title}', then:'{child.title}', else:'[{document.title}]')}">
<div class="tx-dlf-listview-thumbnail"><!--
--><f:if condition="{child.thumbnail}">
<img src="{child.thumbnail}" loading="lazy" alt="Vorschaubild von {f:if(condition:'{child.title}', then:'{child.title}', else:'[{document.title}]')}" />
</f:if><!--
--></div>
<dl>
<dt class="tx-dlf-title"><f:translate key='LLL:EXT:dlf/Resources/Private/Language/locallang_metadata.xlf:metadata.title' /></dt>
<dd class="tx-dlf-title">{f:if(condition:'{child.title}', then:'{child.title}', else:'[{document.title}]')}</dd>
<f:for each="{listedMetadata}" as="metadata">
<f:if condition="{child.metadata.{metadata.indexName}.0} && {metadata.indexName} != 'type' && {metadata.indexName} != 'title'">
<dt class="tx-dlf-metadata-{metadata.indexName}">
{metadata.label}
</dt>
<f:for each="{child.metadata.{metadata.indexName}}" as="metadataentry">
<dd class="tx-dlf-metadata-{metadata.indexName}">
{metadataentry}
</dd>
</f:for>
</f:if>
</f:for>
<dt class="tx-dlf-type"><f:translate key='LLL:EXT:dlf/Resources/Private/Language/locallang_metadata.xlf:metadata.type' /></dt>
<dd class="tx-dlf-type">
<f:translate key='LLL:EXT:dlf/Resources/Private/Language/locallang_structure.xlf:structure.{child.structure}' />
</dd>
</dl>
</f:link.page>

<f:render partial="Basket/AddToBasket" arguments="{result: child}" />

</li>
</f:else>
</f:if>
</f:for>
</ol>
</f:if>

<f:if condition="{document.searchResults}">
<ol class="tx-dlf-volume">
<f:for each="{document.searchResults}" as="result" iteration="resultIterator">
<li value="{resultIterator.cycle}" class="pageresult">
<f:link.page
pageUid="{settings.targetPidPageView}"
additionalParams="{tx_dlf:{page:'{result.page}', double:'0', id:'{document.uid}', pagegrid:'0', highlight_word: '{result.highlight_word}'}}"
class=""
title="{f:if(condition:'{result.title}', then:'{result.title}', else:'[{document.title}]')}, Seite {result.page}">
<div class="tx-dlf-listview-thumbnail"><!--
--><f:if condition="{result.thumbnail}">
<img src="{result.thumbnail}" loading="lazy" alt="Vorschaubild von {f:if(condition:'{result.title}', then:'{result.title}', else:'[{document.title}]')}" />
</f:if><!--
--></div>
<dl>
<f:if condition="{result.title}">
<f:then>
<dt class="tx-dlf-title"><f:translate key='LLL:EXT:dlf/Resources/Private/Language/locallang_metadata.xlf:metadata.title' /></dt>
<dd class="tx-dlf-title">{result.title}</dd>
</f:then>
</f:if>
<f:if condition="{result.structure} != 'page'">
<dt class="tx-dlf-type"><f:translate key='LLL:EXT:dlf/Resources/Private/Language/locallang_metadata.xlf:metadata.type' /></dt>
<dd class="tx-dlf-type">
<f:translate key='LLL:EXT:dlf/Resources/Private/Language/locallang_structure.xlf:structure.{result.structure}' />
</dd>
</f:if>
<dt class="tx-dlf-page"><f:translate key='LLL:EXT:dlf/Resources/Private/Language/locallang_structure.xlf:structure.page' /></dt>
<dd class="tx-dlf-page">{result.page}</dd>
<f:for each="{listedMetadata}" as="metadata">
<f:if condition="{result.metadata.{metadata.indexName}.0} && {metadata.indexName} != 'type' && {metadata.indexName} != 'title'">
<dt class="tx-dlf-metadata-{metadata.indexName}">{metadata.label}</dt>
<f:for each="{result.metadata.{metadata.indexName}}" as="metadataentry">
<dd class="tx-dlf-metadata-{metadata.indexName}">
{metadataentry}
</dd>
</f:for>
</f:if>
</f:for>
</dl>
<div class="tx-dlf-listview-preview">
<f:if condition="{result.snippet}">
<p class="textsnippet">[...] <f:format.raw>{result.snippet}</f:format.raw> [...]</p>
</f:if>
</div>
</f:link.page>

<f:render partial="Basket/AddToBasket" arguments="{result: {uid:document.uid, page: result.page}}" />

</li>
</f:for>
</ol>
</f:if>
</li>
</f:for>
</ol>
<f:render partial="Lists/Pagination" arguments="{_all}" />

</html>
60 changes: 60 additions & 0 deletions Resources/Private/Plugins/Kitodo/Templates/Collection/List.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<f:comment>
<!--
* (c) Kitodo. Key to digital objects e.V. <[email protected]>
*
* This file is part of the Kitodo and TYPO3 projects.
*
* @license GNU General Public License version 3 or later.
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
-->
</f:comment>
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
data-namespace-typo3-fluid="true">

<div class="tx-dlf-collection">
<ul class="tx-dlf-collection-list">
<f:for each="{collections}" as="item">
<li class="tx-dlf-collection-item">
<f:if condition="{item.collection.thumbnail}">
<div class="tx-dlf-collection-thumbnail">
<f:link.action action="show"
arguments="{collection : item.collection}"
pageUid="{pageUid}">
<f:image image="{item.collection.thumbnail}" alt="{f:translate(key: 'thumbnail')} {item.collection.label}" title="{item.collection.label}" maxWidth="250" />
</f:link.action>
</div>
</f:if>
<div class="tx-dlf-collection-meta-information">
<h4>
<f:link.action action="show"
arguments="{collection : item.collection}"
pageUid="{pageUid}">
{item.collection.label}
</f:link.action>
</h4>

<p class="tx-dlf-collection-counts">
({item.info.titles -> f:count()}
<f:translate key="{f:if(condition:'{item.info.titles -> f:count()} > 1', then: 'titles', else: 'title')}" />
/
{item.info.volumes -> f:count()}
<f:translate key="{f:if(condition:'{item.info.volumes -> f:count()} > 1', then: 'volumes', else: 'volume')}" />)
</p>

<f:if condition="{settings.targetFeed}">
<f:link.page
pageUid="{settings.targetFeed}"
additionalParams="{'tx_dlf_feeds[collection]': item.collection.uid}"
target="_blank">
<f:image src="EXT:dlf/Resources/Public/Icons/txdlffeeds.png"
title="{f:translate(key:' item.collection.feed.title')}"
alt="{f:translate(key:' item.collection.feed.alt')}" />
</f:link.page>
</f:if>

</div>
</li>
</f:for>
</ul>
</div>
Loading

0 comments on commit 3e6669e

Please sign in to comment.