Commit e0d52181 authored by Simon Gilli's avatar Simon Gilli
Browse files

Merge branch '175-display-other-extension-of-same-user' into 'develop'

Resolve "Display Other extension of same user"

Closes #175

See merge request !338
parents bf7a6857 52d2c996
Pipeline #11542 passed with stages
in 7 minutes and 41 seconds
......@@ -792,12 +792,27 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implement
public function getAdditionalSupportVersions(): array
{
$supportVersions = [];
$supportedVersions = $this->getAllSupportedVersions();
$supportVersionsOfLastVersion = $this->getLastVersion()->getMatrixOfSupportedTypo3Versions();
foreach ($supportedVersions as $key => $version) {
$test = $supportVersionsOfLastVersion[$key];
if (!empty($test)) {
unset($supportedVersions[$key]);
}
}
return $supportedVersions;
}
public function getAllSupportedVersions(): array
{
$supportedVersions = [];
$ltsVersionService = GeneralUtility::makeInstance(\T3o\TerFe2\Service\LTSVersionService::class);
foreach ($ltsVersionService->getOldLTSVersions() as $versionNumber) {
if (VersionUtility::doesExtensionSupportTypo3Version($this, $versionNumber)) {
$supportVersions[$ltsVersionService->getVersionLabelOfRelease($versionNumber)] = [
$supportedVersions[$ltsVersionService->getVersionLabelOfRelease($versionNumber)] = [
'label' => $ltsVersionService->getVersionLabelOfRelease($versionNumber) . ' LTS',
'badgeClass' => 'danger'
];
......@@ -805,29 +820,21 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implement
}
foreach ($ltsVersionService->getELTSVersions() as $versionNumber) {
if (VersionUtility::doesExtensionSupportTypo3Version($this, $versionNumber)) {
$supportVersions[$ltsVersionService->getVersionLabelOfRelease($versionNumber)] = ['label' => $ltsVersionService->getVersionLabelOfRelease($versionNumber) . ' LTS', 'badgeClass' => 'warning'];
$supportedVersions[$ltsVersionService->getVersionLabelOfRelease($versionNumber)] = ['label' => $ltsVersionService->getVersionLabelOfRelease($versionNumber) . ' LTS', 'badgeClass' => 'warning'];
}
}
foreach ($ltsVersionService->getActiveVersions() as $versionNumber) {
if (VersionUtility::doesExtensionSupportTypo3Version($this, $versionNumber)) {
$supportVersions[$ltsVersionService->getVersionLabelOfRelease($versionNumber)] = ['label' => $ltsVersionService->getVersionLabelOfRelease($versionNumber) . ' LTS', 'badgeClass' => 'success'];
$supportedVersions[$ltsVersionService->getVersionLabelOfRelease($versionNumber)] = ['label' => $ltsVersionService->getVersionLabelOfRelease($versionNumber) . ' LTS', 'badgeClass' => 'success'];
}
}
if ($ltsVersionService->getLatestDevelopmentVersion(true) > VersionNumberUtility::convertVersionNumberToInteger($ltsVersionService->coreData['latest_lts'])
&& VersionUtility::doesExtensionSupportTypo3Version($this, $ltsVersionService->getLatestDevelopmentVersion(true))) {
$supportVersions[$ltsVersionService->getLatestDevelopmentVersion()] = ['label' => $ltsVersionService->getLatestDevelopmentVersion() . '-dev', 'badgeClass' => 'primary'];
}
array_unique($supportVersions);
$supportVersionsOfLastVersion = $this->getLastVersion()->getMatrixOfSupportedTypo3Versions();
foreach ($supportVersions as $key => $version) {
$test = $supportVersionsOfLastVersion[$key];
if (!empty($test)) {
unset($supportVersions[$key]);
}
$supportedVersions[$ltsVersionService->getLatestDevelopmentVersion()] = ['label' => $ltsVersionService->getLatestDevelopmentVersion() . '-dev', 'badgeClass' => 'primary'];
}
array_unique($supportedVersions);
return $supportVersions;
return $supportedVersions;
}
/**
......
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<div class="text-center my-3">
<div class="row mx-auto my-auto">
<div id="extensionCarousel" class="carousel slide w-100" data-ride="carousel">
<div class="carousel-inner w-100" role="listbox">
<f:for each="{extensionsByUser}" iteration="it" as="extension">
<div class="carousel-item{f:if(condition:it.isFirst,then:' active')}">
<div class="col-md-4">
<div class="card">
<div class="card-header">
<h5 class="card-title">
<terfe2:extensionIcon version="{extension.lastVersion}" alt="{extension.lastVersion.title}" class="ter-ext-icon" />
<f:link.action action="show" arguments="{extension: extension}">
<span title="Extension title: {extension.lastVersion.title}" itemprop="alternateName">
{extension.lastVersion.title}
</span>
</f:link.action>
<br>
<small>({extension.extKey})</small>
</h5>
</div>
<div class="card-body">
<p>{extension.lastVersion.description}</p>
<small>
Supported TYPO3 versions:<br>
<f:for each="{extension.allSupportedVersions}" 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>
</small>
</div>
<div class="card-footer">
<small>
Last upload:
<f:format.date format="%d. %b %Y">@{extension.lastVersion.uploadDate}</f:format.date>
</small>
</div>
</div>
</div>
</div>
</f:for>
</div>
<a class="carousel-control-prev w-auto" href="#extensionCarousel" role="button" data-slide="prev">
<span class="carousel-control-prev-icon bg-primary border border-primary rounded-circle" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next w-auto" href="#extensionCarousel" role="button" data-slide="next">
<span class="carousel-control-next-icon bg-primary border border-primary rounded-circle" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
</div>
</html>
......@@ -49,7 +49,9 @@
<h4 class="alert-header">
<span class="ter-ext-state-beta"><i class="fa fa-exclamation-triangle"></i></span>
Abandoned extension<br>
<small class="text-muted">This extension has no maintainer at the moment. If you like to become the maintainer of this extension, fill out our <f:link.page pageUid="{settings.pages.abandonedExtensionFormPid}">registration form</f:link.page>.</small>
<small class="text-muted">This extension has no maintainer at the moment. If you like to become the maintainer of this extension, fill out our
<f:link.page pageUid="{settings.pages.abandonedExtensionFormPid}">registration form</f:link.page>
.</small>
</h4>
</div>
</f:if>
......@@ -128,7 +130,8 @@
<i class="fas fa-info-circle" data-placement="right" data-toggle="tooltip" title="Packagist downloads are fetched during the day and are not up-to-date."></i>
</h4>
<p>
Total downloads (TER and Extension Manager) incl. November 2020: <f:format.number decimals="0" thousandsSeparator=",">{extension.oldDownloads}</f:format.number>
Total downloads (TER and Extension Manager) incl. November 2020:
<f:format.number decimals="0" thousandsSeparator=",">{extension.oldDownloads}</f:format.number>
</p>
<script type="text/javascript">
var versionChartData = {extension.downloadsByTimeIntervalAsJson -> f:format.raw()};
......@@ -148,10 +151,10 @@
</f:if>
<f:if condition="{extension.externalManual}">
<f:then>
<f:render partial="ExternalButtonLink" arguments="{externalLink: extension.externalManual, icon: 'fa-book', label: 'External Manual', btnStyle: 'btn-info'}"/>
<f:render partial="ExternalButtonLink" arguments="{externalLink: extension.externalManual, icon: 'fa-book', label: 'External Manual', btnStyle: 'btn-info'}" />
</f:then>
<f:else>
<f:render partial="ExternalButtonLink" arguments="{externalLink: documentationLink, icon: 'fa-book', label: 'Extension Manual', btnStyle: 'btn-info'}"/>
<f:render partial="ExternalButtonLink" arguments="{externalLink: documentationLink, icon: 'fa-book', label: 'Extension Manual', btnStyle: 'btn-info'}" />
</f:else>
</f:if>
<f:security.ifAuthenticated>
......@@ -168,12 +171,12 @@
</f:else>
</f:if>
</f:security.ifAuthenticated>
<f:render partial="ExternalButtonLink" arguments="{externalLink: extension.forgeLink, icon: 'fa-hand-o-right', label: 'Found an Issue?'}"/>
<f:render partial="ExternalButtonLink" arguments="{externalLink: extension.repositoryUrl, icon: 'fa-code-fork', label: 'Code Insights'}"/>
<f:render partial="ExternalButtonLink" arguments="{externalLink: extension.packagistPage, icon: 'fa-cube', label: 'Packagist.org'}"/>
<f:render partial="ExternalButtonLink" arguments="{externalLink: extension.paypalUrl, icon: 'fa-thumbs-o-up', label: 'Donate and Give Kudos'}"/>
<f:render partial="ExternalButtonLink" arguments="{externalLink: extension.forgeLink, icon: 'fa-hand-o-right', label: 'Found an Issue?'}" />
<f:render partial="ExternalButtonLink" arguments="{externalLink: extension.repositoryUrl, icon: 'fa-code-fork', label: 'Code Insights'}" />
<f:render partial="ExternalButtonLink" arguments="{externalLink: extension.packagistPage, icon: 'fa-cube', label: 'Packagist.org'}" />
<f:render partial="ExternalButtonLink" arguments="{externalLink: extension.paypalUrl, icon: 'fa-thumbs-o-up', label: 'Donate and Give Kudos'}" />
<f:if condition="{extension.localizationStatus}">
<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>
<div class="alert alert-secondary">
......@@ -223,6 +226,12 @@
<f:render partial="InstallationHowTo" arguments="{_all}" />
<f:if condition="{extensionsByUser -> f:count()} > 0">
<h3>Other extensions by this user</h3>
<f:render partial="OtherExtensionsByUser" arguments="{extensionsByUser: extensionsByUser}" />
</f:if>
<h3 id="version-history">
<f:translate key="version_history" />
</h3>
......
......@@ -200,6 +200,32 @@ jQuery(document).ready(function ($) {
});
}
var extensionCarousel = $('#extensionCarousel');
if (extensionCarousel.length) {
extensionCarousel.carousel({
interval: 10000
});
$('.carousel .carousel-item').each(function () {
var minPerSlide = 3;
var next = $(this).next();
if (!next.length) {
next = $(this).siblings(':first');
}
next.children(':first-child').clone().appendTo($(this));
minPerSlide--;
for (var i = 1; i < minPerSlide; i++) {
next = next.next();
if (!next.length) {
next = $(this).siblings(':first');
}
next.children(':first-child').clone().appendTo($(this));
}
});
}
});
function copyToClipboard(el) {
......
......@@ -112,3 +112,49 @@ span.ter-ext-state-expiremental {
}
}
/*
* Extensions detail
*/
.ter-ext-single-otherextensions .btn {
padding: .375rem .5rem;
}
@media (max-width: 768px) {
.carousel-inner .carousel-item > div {
display: none;
}
.carousel-inner .carousel-item > div:first-child {
display: block;
}
}
.carousel-inner .carousel-item.active,
.carousel-inner .carousel-item-next,
.carousel-inner .carousel-item-prev {
display: flex;
}
.carousel-inner .card-body {
display: block;
}
/* display 3 */
@media (min-width: 768px) {
.carousel-inner .carousel-item-right.active,
.carousel-inner .carousel-item-next {
transform: translateX(33.333%);
}
.carousel-inner .carousel-item-left.active,
.carousel-inner .carousel-item-prev {
transform: translateX(-33.333%);
}
}
.carousel-inner .carousel-item-right,
.carousel-inner .carousel-item-left {
transform: translateX(0);
}
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