Commit 698669ec authored by Thomas Löffler's avatar Thomas Löffler

Adds nice TYPO3 version view to detail view and fixes Chrome bug

parent 63b3fb9a
Pipeline #1960 passed with stages
in 1 minute and 54 seconds
......@@ -213,6 +213,7 @@ class ExtensionController extends \T3o\TerFe2\Controller\AbstractController
$documentationService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\T3o\TerFe2\Service\Documentation::class);
$documentationLink = $documentationService->getDocumentationLink($extension->getExtKey(), $extension->getLastVersion()->getVersionString());
$this->view->assign('documentationLink', $documentationLink);
\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($GLOBALS['TSFE']->fe_user->user);
$pageRenderer = $this->objectManager->get(\TYPO3\CMS\Core\Page\PageRenderer::class);
$pageRenderer->addMetaTag('<meta name="description" content="' . htmlspecialchars($extension->getLastVersion()->getDescription()) . '" />');
......
......@@ -1226,4 +1226,34 @@ class Version extends \T3o\TerFe2\Domain\Model\AbstractEntity
return $typo3Dependency;
}
/**
* @return array
*/
public function getMatrixOfSupportedTypo3Versions(): array
{
// @todo: Get these versions automatically
$typo3Versions = [
'6.2 LTS' => 6002000,
'7 LTS' => 7006000,
'8 LTS' => 8007000,
'9' => 9000000
];
$supportedTypo3Versions = [];
foreach ($typo3Versions as $label => $mainVersion) {
$supportedTypo3Versions[$label] = $this->isSupportedByTypo3Version($mainVersion);
}
return $supportedTypo3Versions;
}
/**
* @param int $mainVersion
* @return bool
*/
public function isSupportedByTypo3Version(int $mainVersion): bool
{
return \T3o\TerFe2\Utility\Version::doesExtensionVersionSupportTypo3Version($this, $mainVersion);
}
}
<html xmlns:terfe2="http://typo3.org/ns/T3o/TerFe2/ViewHelpers" data-namespace-typo3-fluid="true">
<f:debug>{settings}</f:debug>
<f:security.ifHasRole role="{settings.reviewerGroupUid}">
<f:then>
<f:form action="update" method="post" controller="Review" name="extension" object="{extension}">
<table class="table table-hover">
<thead>
<tr>
<th class="col-sm-1 text-center"><i class="fa fa-bug"></i></th>
<th class="col-sm-2"><i class="fa fa-info"></i> Version</th>
<th class="col-sm-4"><i class="fa fa-comment-o"></i> Upload comment</th>
<th class="col-sm-3">Supports TYPO3 version</th>
<th class="col-sm-2"><i class="fa fa-download"></i> Download</th>
<th class="w-5 text-center"><i class="fa fa-bug"></i></th>
<th class="w-10">Version</th>
<th class="w-45">Upload comment</th>
<th class="w-30">Supports TYPO3 version</th>
<th class="w-10">Download</th>
</tr>
</thead>
<tbody>
......@@ -70,10 +70,10 @@
<table class="table table-hover">
<thead>
<tr>
<th class="col-sm-2"><i class="fa fa-info"></i> Version</th>
<th class="col-sm-5"><i class="fa fa-comment-o"></i> Upload comment</th>
<th class="col-sm-3">Supports TYPO3 version</th>
<th class="col-sm-2"><i class="fa fa-download"></i> Download</th>
<th class="w-10">Version</th>
<th class="w-50">Upload comment</th>
<th class="w-30">Works with TYPO3</th>
<th class="w-10">Download</th>
</tr>
</thead>
<tbody>
......
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:if condition="{version.matrixOfSupportedTypo3Versions}">
<h5>Works with TYPO3</h5>
<ul class="list-inline">
<f:for each="{version.matrixOfSupportedTypo3Versions}" key="label" as="supported">
<li class="list-inline-item btn btn-{f:if(condition:'{supported}',then:'success',else:'secondary')}">{label}</li>
</f:for>
</ul>
</f:if>
</html>
......@@ -42,13 +42,7 @@
<div class="row mb-3">
<div class="col-md-8">
<p>{extension.lastVersion.description}</p>
<f:if condition="{extension.lastVersion.typo3Dependency}">
<p>
<strong>
This version works for TYPO3 {extension.lastVersion.typo3Dependency.versionString}
</strong>
</p>
</f:if>
<f:render partial="VersionSupportForTypo3" arguments="{version: extension.lastVersion}" />
<f:if condition="{extension.tags}">
<h3>Tags</h3>
<p class="tags">
......
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