Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove shop links from plugin details modal #22154

Merged
merged 10 commits into from
Apr 29, 2024
1 change: 0 additions & 1 deletion plugins/Marketplace/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ public function pluginDetails()
$view->activeTab = $activeTab;
$view->isAutoUpdatePossible = SettingsPiwik::isAutoUpdatePossible();
$view->isAutoUpdateEnabled = SettingsPiwik::isAutoUpdateEnabled();
$view->numUsers = $this->environment->getNumUsers();

return $view->render();
}
Expand Down
31 changes: 30 additions & 1 deletion plugins/Marketplace/stylesheets/plugin-details.less
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,25 @@
}

#pluginDetailsTabs {
border-right: 1px solid silver;
margin-top: 25px;
}

// some plugins receive inline style from the marketplace
// override them for consistency
mneudert marked this conversation as resolved.
Show resolved Hide resolved
.main-div-readme {
display: flex;
}

.left-div-readme {
width: 50%;
}

.right-div-readme {
flex-grow: initial;
width: 48%;
}

.contentDetails p {
margin: 0 0 10px;
}
Expand All @@ -54,6 +70,17 @@
padding-right: 25px;
}

.metadata {
padding-left: 0.75rem;

// -1px to force overlapping border overlapping with content
margin-left: calc(~"0.75rem - 1px");
border-left: 1px solid silver;

// prevent text overflow
word-break: break-word;
}

.variationPicker {
margin-top: 0;
margin-bottom: 15px;
Expand All @@ -69,6 +96,7 @@
.download,
.install {
padding: 11px 19px;
margin-bottom: 20px;
font-size: 17.5px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
Expand Down Expand Up @@ -318,7 +346,8 @@
}

.right-div-readme {
flex-grow: 1; width: 50%;
flex-grow: 1;
width: 50%;
}

.plugin-metadata-part2 {
Expand Down
62 changes: 8 additions & 54 deletions plugins/Marketplace/templates/plugin-details.twig
Original file line number Diff line number Diff line change
Expand Up @@ -110,42 +110,12 @@
<div class="metadata">
<div class="actionButton">
{% if not plugin.isDownloadable or not isSuperUser %}
{% if hasSomeAdminAccess and plugin.hasExceededLicense is defined and plugin.hasExceededLicense and plugin.consumer %}
{% if plugin.consumer.loginUrl is defined and plugin.consumer.loginUrl %}
<a class="install update"
target="_blank"
rel="noreferrer noopener"
href="{{ plugin.consumer.loginUrl|default('')|e('html_attr') }}"
>{{ 'Marketplace_UpgradeSubscription'|translate }}</a>
{% endif %}

{% elseif not plugin.isDownloadable and plugin.isPaid and plugin.shop is defined and plugin.shop %}

{% if plugin.shop.variations|length %}

<h4 style="color:#5bb75b;font-weight: bold;font-size: 1.2em;">{{ 'Marketplace_TryFreeTrialTitle'|translate }}</h4>
<div class="input-field variationPicker">
<select title="{{ 'Marketplace_ShownPriceIsExclTax'|translate|e('html_attr') }} {{ 'Marketplace_CurrentNumPiwikUsers'|translate(numUsers)|e('html_attr') }}">
{% for variation in plugin.shop.variations %}
<option value="{{ variation.addToCartUrl }}"
title="{{ 'Marketplace_PriceExclTax'|translate(variation.price, variation.currency)|e('html_attr') }} {{ 'Marketplace_CurrentNumPiwikUsers'|translate(numUsers)|e('html_attr') }}"
{% if variation.recommended is defined and variation.recommended %}selected{% endif %}
>{{ variation.name }} - {{ variation.prettyPrice }} / {{ variation.period }}</option>
{% endfor %}
</select>
</div>

<a class="install update addToCartLink" target="_blank"
title="{{ 'Marketplace_ClickToCompletePurchase'|translate|e('html_attr') }}"
rel="noreferrer noopener"
href="{{ plugin.shop.url|default('')|e('html_attr') }}"
>{{ 'Marketplace_AddToCart'|translate }}</a>
{% else %}
<a class="install update" target="_blank"
rel="noreferrer noopener"
href="{% if plugin.shop is defined and plugin.shop and plugin.shop.url %}{{ plugin.shop.url|e('html_attr') }}{% else %}{{ plugin.homepage|e('html_attr') }}{% endif %}"
>{{ 'General_MoreDetails'|translate }}</a>
{% endif %}
{% if hasSomeAdminAccess and plugin.hasExceededLicense is defined and plugin.hasExceededLicense and plugin.consumer and plugin.consumer.loginUrl is defined and plugin.consumer.loginUrl %}
<a class="install update"
target="_blank"
rel="noreferrer noopener"
href="{{ plugin.consumer.loginUrl|default('')|e('html_attr') }}"
>{{ 'Marketplace_UpgradeSubscription'|translate }}</a>
{% endif %}
{% elseif isSuperUser %}
{% if not isAutoUpdatePossible %}
Expand All @@ -155,31 +125,15 @@
<a class="install update"
href="{{ linkTo({'module': 'Marketplace', 'action':'updatePlugin', 'pluginName': plugin.name, 'nonce': updateNonce}) }}"
>{{ 'CoreUpdater_UpdateTitle'|translate }}</a>
{% elseif plugin.isInstalled %}
<br />
<br />
<br />
<br />
{% elseif 0 < plugin.missingRequirements|length %}
<br />
<br />
<br />
<br />
{% else %}
{% elseif not plugin.isInstalled and 0 == plugin.missingRequirements|length %}
<a href="{{ linkTo({'module': 'Marketplace', 'action': 'installPlugin', 'pluginName': plugin.name, 'nonce': installNonce}) }}"
class="install">{{ 'Marketplace_ActionInstall'|translate }}</a>
{% endif %}
{% else %}
<br />
<br />
<br />
<br />
{% endif %}
</div>

{% if plugin.specialOffer is defined and plugin.specialOffer %}<p style="color: green;"><br />{{ plugin.specialOffer }}</p>{% endif %}
{% if plugin.specialOffer is defined and plugin.specialOffer %}<p style="color: green;">{{ plugin.specialOffer }}<br /><br /></p>{% endif %}

<p><br /></p>
<dl>
{% if not isBundle %}
<dt>{{ 'CorePluginsAdmin_Version'|translate }}</dt>
Expand Down
Loading