Commit d9d64d1d authored by Thomas Löffler's avatar Thomas Löffler
Browse files

Add distribution image to detail view if exists

parent 7679f753
Pipeline #11552 passed with stages
in 5 minutes and 54 seconds
...@@ -863,4 +863,22 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implement ...@@ -863,4 +863,22 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implement
{ {
$this->lastDownloadSync = $lastDownloadSync; $this->lastDownloadSync = $lastDownloadSync;
} }
public function getDistributionImage(): string
{
$distributionImage = '';
if ($this->lastVersion->getEmCategory() === 'distribution') {
$folder = $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['ter']['repositoryDir'] . $this->extKey[0] . '/' . $this->extKey[1];
$distributionFile = $folder . '/' . $this->extKey . '_' . $this->lastVersion->getVersionString() . '_Distribution.png';
if (is_file($distributionFile)) {
$distributionImage = str_replace(
\TYPO3\CMS\Core\Core\Environment::getProjectPath() . 'private',
'',
$distributionFile
);
}
}
return $distributionImage;
}
} }
...@@ -179,6 +179,12 @@ ...@@ -179,6 +179,12 @@
<f:render partial="ExternalButtonLink" arguments="{externalLink: 'https://crowdin.com/project/{extension.crowdinKey}/invite', icon: 'fa-globe', label: 'Crowdin translations'}" /> <f:render partial="ExternalButtonLink" arguments="{externalLink: 'https://crowdin.com/project/{extension.crowdinKey}/invite', icon: 'fa-globe', label: 'Crowdin translations'}" />
</f:if> </f:if>
<f:if condition="{extension.distributionImage}">
<div class="mt-3 mb-3">
<f:image class="distributionImage" src="{extension.distributionImage}" />
</div>
</f:if>
<div class="alert alert-secondary"> <div class="alert alert-secondary">
<f:render partial="ExtensionSingleInfo" arguments="{extension:extension, settings:settings, owner:owner, flattrUrl:flattrUrl, documentationLink:documentationLink, qualityLinkNotBroken:qualityLinkNotBroken, urlToQualityServer:urlToQualityServer}" /> <f:render partial="ExtensionSingleInfo" arguments="{extension:extension, settings:settings, owner:owner, flattrUrl:flattrUrl, documentationLink:documentationLink, qualityLinkNotBroken:qualityLinkNotBroken, urlToQualityServer:urlToQualityServer}" />
</div> </div>
......
...@@ -158,3 +158,8 @@ span.ter-ext-state-expiremental { ...@@ -158,3 +158,8 @@ span.ter-ext-state-expiremental {
.carousel-inner .carousel-item-left { .carousel-inner .carousel-item-left {
transform: translateX(0); transform: translateX(0);
} }
.distributionImage {
width: 100%;
height: auto;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment