Commit 950ffa01 authored by Tomas Norre Mikkelsen's avatar Tomas Norre Mikkelsen Committed by Thomas Löffler
Browse files

[TASK] Add side-by-side view for TYPO3 Versions

parent da3d1d85
......@@ -710,20 +710,13 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
$this->crowdinKey = $crowdinKey;
}
public function getSupportedVersion(): array
public function getAdditionalSupportVersions(): array
{
$supportMaintainedVersions = [];
$supportDevVersion = [];
$supportELTSVersions = [];
$supportOlderVersions = [];
$ltsVersionService = GeneralUtility::makeInstance(\T3o\TerFe2\Service\LTSVersionService::class);
foreach ($ltsVersionService->getCurrentStableVersions(true) as $versionNumber) {
if (VersionUtility::doesExtensionSupportTypo3Version($this, $versionNumber)) {
$supportMaintainedVersions[] = ['label' => $ltsVersionService->getVersionLabelOfRelease($versionNumber) . ' LTS', 'badgeClass' => 'success'];
}
}
if ($ltsVersionService->getLatestDevelopmentVersion(true) > VersionNumberUtility::convertVersionNumberToInteger($ltsVersionService->coreData['latest_lts'])
&& VersionUtility::doesExtensionSupportTypo3Version($this, $ltsVersionService->getLatestDevelopmentVersion(true))) {
$supportDevVersion[] = ['label' => $ltsVersionService->getLatestDevelopmentVersion() . '-dev', 'badgeClass' => 'primary'];
......@@ -740,6 +733,6 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
}
}
return array_merge($supportOlderVersions, $supportELTSVersions, $supportMaintainedVersions, $supportDevVersion);
return array_merge($supportOlderVersions, $supportELTSVersions, $supportDevVersion);
}
}
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<h4>This version supports TYPO3</h4>
<p>
<f:for each="{supportedVersion}" as="version">
<button class="btn btn-{version.badgeClass} btn-sm mr-2" disabled title="{f:translate(key:'title_{version.badgeClass}', arguments: {0: version.label})}">{version.label}</button>
</f:for>
</p>
<f:if condition="{version.typo3Dependency}">
<div class="container">
<div class="row">
<div class="col-sm">
<h5>This version supports TYPO3</h5>
<p>
<f:for each="{version.matrixOfSupportedTypo3Versions}" as="version">
<button class="btn btn-{version.badgeClass} btn-sm mr-2" disabled title="{f:translate(key:'title_{version.badgeClass}', arguments: {0: version.label})}">{version.label}</button>
</f:for>
</p>
</div>
<f:if condition="{additionalVersions}">
<div class="col-sm">
<h5>Older versions also support TYPO3</h5>
<p>
<f:for each="{additionalVersions}" as="version">
<button class="btn btn-{version.badgeClass} btn-sm mr-2" disabled title="{f:translate(key:'title_{version.badgeClass}', arguments: {0: version.label})}">{version.label}</button>
</f:for>
</p>
</div>
</f:if>
</div>
</div>
</f:if>
</html>
......@@ -92,7 +92,7 @@
<div class="row mb-3">
<div class="col-md-8">
<p itemprop="description">{extension.lastVersion.description}</p>
<f:render partial="VersionSupportForTypo3" arguments="{supportedVersion: extension.supportedVersion}" />
<f:render partial="VersionSupportForTypo3" arguments="{version: extension.lastVersion, additionalVersions: extension.additionalSupportVersions}" />
<f:if condition="{extension.composerName}">
<p class="mb-3">
<h4>Composer support</h4>
......
Supports Markdown
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