mirror of https://github.com/portainer/portainer
feat(support): add new offerings (#3608)
* feat(support): add new offerings * feat(support): refactor for simplicity * feat(support): rename for claritypull/3621/head
parent
bfdb4dba12
commit
d022853059
|
@ -3,8 +3,10 @@
|
||||||
<div class="blocklist-item-box">
|
<div class="blocklist-item-box">
|
||||||
<!-- extension-image -->
|
<!-- extension-image -->
|
||||||
<span class="blocklist-item-logo">
|
<span class="blocklist-item-logo">
|
||||||
<img class="blocklist-item-logo" ng-if="$ctrl.model.Id == 1" src="../../../../../assets/images/support_1.png" />
|
<img class="blocklist-item-logo" ng-if="$ctrl.model.Id == 1 || $ctrl.model.Id == 2 || $ctrl.model.Id == 3"
|
||||||
<img class="blocklist-item-logo" ng-if="$ctrl.model.Id == 2" src="../../../../../assets/images/support_2.png" />
|
src="../../../../../assets/images/support_1.png" />
|
||||||
|
<img class="blocklist-item-logo" ng-if="$ctrl.model.Id == 4 || $ctrl.model.Id == 5"
|
||||||
|
src="../../../../../assets/images/support_2.png" />
|
||||||
</span>
|
</span>
|
||||||
<!-- !extension-image -->
|
<!-- !extension-image -->
|
||||||
<!-- extension-details -->
|
<!-- extension-details -->
|
||||||
|
|
|
@ -45,15 +45,19 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="margin-top: 10px; margin-bottom: 95px;">
|
<div style="margin-top: 10px; margin-bottom: 95px;">
|
||||||
<label for="endpoint_count" class="col-sm-7 control-label text-left" style="margin-top: 7px;">Hosts</label>
|
<label for="endpoint_count" class="col-sm-7 control-label text-left"
|
||||||
|
style="margin-top: 7px;">Hosts</label>
|
||||||
<div class="col-sm-5">
|
<div class="col-sm-5">
|
||||||
<input type="number" class="form-control" ng-model="formValues.hostCount" id="endpoint_count" placeholder="10" min="10">
|
<input type="number" class="form-control" ng-model="formValues.hostCount" id="endpoint_count"
|
||||||
|
placeholder="{{ state.placeholder }}" min="{{ state.minHosts }}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="margin-top: 15px;" >
|
<div style="margin-top: 15px;">
|
||||||
<a href="https://portainer.io/checkout/?add-to-cart={{ product.ProductId }}&quantity={{ formValues.hostCount }}" target="_blank">
|
<a href="https://portainer.io/checkout/?add-to-cart={{ product.ProductId }}&quantity={{ formValues.hostCount }}"
|
||||||
<button ng-disabled="!formValues.hostCount || formValues.hostCount < 10" class="btn btn-primary btn-sm" style="width: 100%; margin-left: 0;">Buy</button>
|
target="_blank">
|
||||||
|
<button ng-disabled="isBuyButtonEnabled()" class="btn btn-primary btn-sm"
|
||||||
|
style="width: 100%; margin-left: 0;">Buy</button>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -81,4 +85,4 @@
|
||||||
</rd-widget-body>
|
</rd-widget-body>
|
||||||
</rd-widget>
|
</rd-widget>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
|
@ -1,14 +1,40 @@
|
||||||
angular.module('portainer.app')
|
angular.module('portainer.app')
|
||||||
.controller('SupportProductController', ['$scope', '$transition$',
|
.controller('SupportProductController', ['$scope', '$transition$',
|
||||||
function($scope, $transition$) {
|
function ($scope, $transition$) {
|
||||||
|
|
||||||
$scope.formValues = {
|
$scope.formValues = {
|
||||||
hostCount: 10
|
hostCount: 0
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.state = {
|
||||||
|
minHosts: 0,
|
||||||
|
placeholder: 0
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.isBuyButtonEnabled = function () {
|
||||||
|
return !$scope.formValues.hostCount || ($scope.formValues.hostCount < $scope.state.minHosts);
|
||||||
};
|
};
|
||||||
|
|
||||||
function initView() {
|
function initView() {
|
||||||
$scope.product = $transition$.params().product;
|
$scope.product = $transition$.params().product;
|
||||||
|
|
||||||
|
if ($scope.product.Id == 1) {
|
||||||
|
$scope.formValues.hostCount = 1;
|
||||||
|
$scope.state.minHosts = 1;
|
||||||
|
$scope.state.placeholder = 1;
|
||||||
|
}
|
||||||
|
if ($scope.product.Id == 2 || $scope.product.Id == 3) {
|
||||||
|
$scope.formValues.hostCount = 4;
|
||||||
|
$scope.state.minHosts = 4;
|
||||||
|
$scope.state.placeholder = 4;
|
||||||
|
}
|
||||||
|
if ($scope.product.Id == 4 || $scope.product.Id == 5) {
|
||||||
|
$scope.formValues.hostCount = 10;
|
||||||
|
$scope.state.minHosts = 10;
|
||||||
|
$scope.state.placeholder = 10;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
initView();
|
initView();
|
||||||
}]);
|
}
|
||||||
|
]);
|
Loading…
Reference in New Issue