Skip to content

Commit

Permalink
Merge pull request #83 from slub/test
Browse files Browse the repository at this point in the history
Test
  • Loading branch information
dikastes authored Oct 15, 2024
2 parents fafa619 + 7785347 commit e982edc
Show file tree
Hide file tree
Showing 20 changed files with 632 additions and 208 deletions.
1 change: 1 addition & 0 deletions Classes/Controller/PersonController.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public function showAction(GndPerson $person)
pluck('published_subitems')->
flatten(1)->
pluck('prints_by_date')->
flatten(1)->
filter()->
count();

Expand Down
16 changes: 6 additions & 10 deletions Classes/Controller/PublishedItemController.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,27 +50,23 @@ public function showAction(PublishedItem $publishedItem)
( $a->getDateOfAction() == $b->getDateOfAction() ? 0 : 1 );
};
$publisherMikroItems = $publishedItem->getPublishedSubitems()->toArray();
$publisherActions = [];
// use collection
foreach ($publisherMikroItems as $publisherMikroItem) {
$publisherActions = array_merge(
$publisherActions,
$this->publisherActionRepository->findByPublishedsubitem($publisherMikroItem)->toArray()
);
}
usort($publisherActions, $sortByDate);

$document = $this->searchService->
reset()->
setIndex(self::TABLE_INDEX_NAME)->
setId($publishedItem->getMvdbId())->
search();
$hasPrints = $document->
get('published_subitems')->
pluck('prints_by_date')->
flatten(1)->
count();

$visualizationCall = $this->getJsCall($document, $this->publishers, $publishedItem->getMvdbId());
$publishers = $this->publisherRepository->findAll();
$this->view->assign('publishedItem', $publishedItem);
$this->view->assign('publisherMikroItems', $publisherMikroItems);
$this->view->assign('publisherActions', $publisherActions);
$this->view->assign('hasPrints', $hasPrints);
$this->view->assign('visualizationCall', $visualizationCall);
$this->view->assign('tableTarget', self::TABLE_TARGET);
$this->view->assign('graphTarget', self::GRAPH_TARGET);
Expand Down
1 change: 1 addition & 0 deletions Classes/Controller/WorkController.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public function showAction(GndWork $work)
pluck('published_subitems')->
flatten(1)->
pluck('prints_by_date')->
flatten(1)->
filter()->
count();
$publishedItems = $this->publishedItemRepository->findByContainedWorks($work->getUid());
Expand Down
5 changes: 3 additions & 2 deletions Configuration/TypoScript/setup.typoscript
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ page {
d3 = EXT:guv_sitepackage/Resources/Public/JavaScript/Dist/d3.min.js
}
includeJSFooter {
research = EXT:guv_sitepackage/Resources/Public/JavaScript/Dist/research.js
lastVisited = EXT:mpdb_presentation/Resources/Public/JavaScript/LastVisitedFe.js
translate = EXT:mpdb_presentation/Resources/Public/JavaScript/Translate.js
#research = EXT:guv_sitepackage/Resources/Public/JavaScript/Dist/research.js
#lastVisited = EXT:mpdb_presentation/Resources/Public/JavaScript/LastVisitedFe.js
visualizationController = EXT:mpdb_presentation/Resources/Public/JavaScript/VisualizationController.js
tableController = EXT:mpdb_presentation/Resources/Public/JavaScript/TableController.js
dashboardController = EXT:mpdb_presentation/Resources/Public/JavaScript/DashboardController.js
Expand Down
8 changes: 4 additions & 4 deletions Resources/Private/Language/de.locallang.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
<target>Ergänzende Titelinformationen</target>
</trans-unit>
<trans-unit id="mpdbresearch.printedIn">
<source>printed in</source>
<target>gedruckt in</target>
<source>related published items</source>
<target>zugehörige Verlagsartikel</target>
</trans-unit>
<trans-unit id="mpdbresearch.partialWorks">
<source>partial works</source>
Expand Down Expand Up @@ -153,8 +153,8 @@
<target>Keine Wirtschaftsdaten</target>
</trans-unit>
<trans-unit id="mpdbresearch.noEconomicDataParagraph">
<source>No economic data could be retrieved for several published items.</source>
<target>Für einige Verlagsartikel konnten keine Wirtschaftsdaten gefunden werden.</target>
<source>The evaluated sources did not contain any economic data.</source>
<target>Die ausgewerteten Quellen enthielten keine Wirtschaftsdaten.</target>
</trans-unit>
<trans-unit id="mpdbresearch.typeTooltip">
<source>The type of the published item indicates, whether it is a simple work print, a collection print, a version or something else.</source>
Expand Down
4 changes: 2 additions & 2 deletions Resources/Private/Language/locallang.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<source>supplementary title information</source>
</trans-unit>
<trans-unit id="mpdbresearch.printedIn">
<source>printed in</source>
<source>related published items</source>
</trans-unit>
<trans-unit id="mpdbresearch.partialWorks">
<source>partial works</source>
Expand All @@ -94,7 +94,7 @@
<source>No economic data</source>
</trans-unit>
<trans-unit id="mpdbresearch.noEconomicDataParagraph">
<source>No economic data could be retrieved for several published items.</source>
<source>The evaluated sources did not contain any economic data.</source>
</trans-unit>
<trans-unit id="mpdbresearch.containedWork">
<source>contained work</source>
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Partials/Index/IndexPicker.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<li>
<f:variable name="searchconfig">{mpdbpres:setConfig(config:searchconfig,key:'index',value:'')}</f:variable>
<f:link.action action="search" arguments="{config:searchconfig}">
X
<core:icon identifier="mpdb_presentation-x" />
</f:link.action>
</li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Partials/Index/PublisherPicker.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<li>
<f:variable name="searchconfig">{mpdbpres:setConfig(config:searchconfig,key:'publisher',value:'')}</f:variable>
<f:link.action action="search" arguments="{config:searchconfig}">
X
<core:icon identifier="mpdb_presentation-x" />
</f:link.action>
</li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Partials/Index/SearchSlot.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</f:form.button>
<f:variable name="searchconfig">{mpdbpres:setConfig(config:searchConfig,key:'searchTerm',value:'')}</f:variable>
<f:link.action action="search" arguments="{config:searchconfig}" class="button" id="reset-button">
X
<core:icon identifier="mpdb_presentation-xinv" size="large"/>
</f:link.action>
</div>
</div>
Expand Down
61 changes: 35 additions & 26 deletions Resources/Private/Templates/Person/Show.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,46 @@ <h1 class="current-item">{person.name}</h1>
</p>
</div>
</div>

<div class="graph-container">
<h3>
<f:translate key="mpdbresearch.worksBy" arguments="{0:person.name}" />
</h3>
<f:if condition="{person.works}">
<f:then>
<ul>
<f:for each="{person.works}" as="work">
<li>
<f:link.action action="show" arguments="{work:work.uid}" controller="Work">
{work.full_title}<f:if condition="{work.opus_no}">, op. {work.opus_no}</f:if>
</f:link.action>
<small>
<f:translate key="mpdbresearch.publishedBy" arguments="{0:work.publishers}" />
</small>
</li>
</f:for >
</ul>
</f:then>
<f:else>
<em>
<f:translate key="mpdbresearch.noWorksFound" arguments="{0:person.name}" />
</em>
</f:else>
</f:if>

<f:if condition="{hasPrints}">
<f:then>
<f:if condition="{hasPrints}>1">
<div class="{dashboardTarget}"></div>
</f:if>
<div id="{graphTarget}"></div>
<div id="{dashboardTarget}"></div>
<f:if condition="{hasPrints}>1">
<div class="{dashboardTarget}"></div>
</f:if>
<div id="{tableTarget}"> </div>
<f:if condition="{hasPrints}>1">
<div class="{dashboardTarget}"></div>
</f:if>
{visualizationCall->f:format.raw()}
</f:then>
<f:else>
Expand All @@ -117,31 +151,6 @@ <h3>

<f:format.htmlentitiesDecode>{personGraph}</f:format.htmlentitiesDecode>

<h3>
<f:translate key="mpdbresearch.worksBy" arguments="{0:person.name}" />
</h3>
<f:if condition="{person.works}">
<f:then>
<ul>
<f:for each="{person.works}" as="work">
<li>
<f:link.action action="show" arguments="{work:work.uid}" controller="Work">
{work.full_title}<f:if condition="{work.opus_no}">, op. {work.opus_no}</f:if>
</f:link.action>
<small>
<f:translate key="mpdbresearch.publishedBy" arguments="{0:work.publishers}" />
</small>
</li>
</f:for >
</ul>
</f:then>
<f:else>
<em>
<f:translate key="mpdbresearch.noWorksFound" arguments="{0:person.name}" />
</em>
</f:else>
</f:if>

</f:section>

<f:section name="wrap"/>
Expand Down
16 changes: 12 additions & 4 deletions Resources/Private/Templates/PublishedItem/Show.html
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,19 @@ <h2>
</div>
<div class="graph-container">
<p> {publishedItem.publicComment} </p>
<f:if condition="{publisherActions.0}">
<f:if condition="{hasPrints}">
<f:then>
<div id="{graphTarget}"></div>
<div id="{dashboardTarget}"></div>
<div id="{tableTarget}"> </div>
<f:if condition="{hasPrints}>1">
<div class="{dashboardTarget}"></div>
</f:if>
<div id="{graphTarget}"></div>
<f:if condition="{hasPrints}>1">
<div class="{dashboardTarget}"></div>
</f:if>
<div id="{tableTarget}"> </div>
<f:if condition="{hasPrints}>1">
<div class="{dashboardTarget}"></div>
</f:if>
{visualizationCall->f:format.raw()}
</f:then>
<f:else>
Expand Down
118 changes: 63 additions & 55 deletions Resources/Private/Templates/Work/Show.html
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,72 @@ <h1 class="current-item">
</div>
</div>
<div class="graph-container">
<f:if condition="{subWorks}">
<h3>
<f:translate key="mpdbresearch.partialWorks" />
</h3>
<ul>
<f:for each="{subWorks}" as="subWork">
<li>
<span class="title"> {subWork.subWork.fullTitle} </span>
<f:if condition="{subWork.subWork.opusNo}">
<small> op. {subWork.subWork.opusNo} </small>
</f:if>
<f:if condition="{subWork.subWork.indexNo}">
<small> {subWork.subWork.indexNo} </small>
</f:if>
<f:link.external uri="https://d-nb.info/{work.gndId}" target="_blank">
({subWork.subWork.gndId})
</f:link.external>
<f:if condition="{subWork.makros}">
<f:translate key="mpdbresearch.printedIn" />
<f:for each="{subWork.makros}" as="makro">
<f:link.action action="show" controller="PublisherMakroItem" arguments="{publisherMakroItem:makro}">
{makro.mvdbId}: {makro.title}
</f:link.action>
</f:for>
</f:if>
</li>
</f:for>
</ul>
</f:if>

<f:if condition="{work.published_items}">
<f:then>
<h3>
<f:translate key="mpdbresearch.printedIn" />
</h3>

<ul class="printed-in">
<f:for each="{work.published_items}" as="item">
<li>
<f:link.action action="show" controller="PublishedItem" arguments="{publishedItem:item.uid}">
{item.mvdb_id}: {item.title}
</f:link.action>
</li>
</f:for >
</ul>
</f:then>
<f:else>
<em>
<f:translate key="mpdbresearch.workNotPrinted" />
</em>
</f:else>
</f:if>

<f:if condition="{hasPrints}">
<f:then>
<f:if condition="{hasPrints}>1">
<div class="{dashboardTarget}"></div>
</f:if>
<div id="{graphTarget}"> </div>
<div id="{dashboardTarget}"></div>
<f:if condition="{hasPrints}>1">
<div class="{dashboardTarget}"></div>
</f:if>
<div id="{tableTarget}"> </div>
<f:if condition="{hasPrints}>1">
<div class="{dashboardTarget}"></div>
</f:if>
{visualizationCall->f:format.raw()}
</f:then>
<f:else>
Expand All @@ -183,60 +244,7 @@ <h3>
</f:if>
</div>
</div>

<f:if condition="{subWorks}">
<h3>
<f:translate key="mpdbresearch.partialWorks" />
</h3>
<ul>
<f:for each="{subWorks}" as="subWork">
<li>
<span class="title"> {subWork.subWork.fullTitle} </span>
<f:if condition="{subWork.subWork.opusNo}">
<small> op. {subWork.subWork.opusNo} </small>
</f:if>
<f:if condition="{subWork.subWork.indexNo}">
<small> {subWork.subWork.indexNo} </small>
</f:if>
<f:link.external uri="https://d-nb.info/{work.gndId}" target="_blank">
({subWork.subWork.gndId})
</f:link.external>
<f:if condition="{subWork.makros}">
<f:translate key="mpdbresearch.printedIn" />
<f:for each="{subWork.makros}" as="makro">
<f:link.action action="show" controller="PublisherMakroItem" arguments="{publisherMakroItem:makro}">
{makro.mvdbId}: {makro.title}
</f:link.action>
</f:for>
</f:if>
</li>
</f:for>
</ul>
</f:if>

<f:if condition="{work.published_items}">
<f:then>
<h3>
<f:translate key="mpdbresearch.printedIn" />
</h3>

<ul class="printed-in">
<f:for each="{work.published_items}" as="item">
<li>
<f:link.action action="show" controller="PublishedItem" arguments="{publishedItem:item.uid}">
{item.mvdb_id}: {item.title}
</f:link.action>
</li>
</f:for >
</ul>
</f:then>
<f:else>
<em>
<f:translate key="mpdbresearch.workNotPrinted" />
</em>
</f:else>
</f:if>
</f:section>
</f:section>

<f:section name="wrap"/>
<f:section name="sidebar"/>
Expand Down
Loading

0 comments on commit e982edc

Please sign in to comment.