mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
* make comment more accurate: members are removed, not banned They can rejoin with an invitation in a private group or at any time in a public group. * change windows line breaks to unix line breaks * change flavour text of Golden Knight collection quest to reduce number of testimonies * fix grammatical error noticed by mandyzhou * improve message about not being able to send PMs because we often see people report it as a bug * update instructions for cancelling Google subscriptions (thanks to Scea for noticing) * change Delete Completed on-hover message - fixes #8598 * correct the Orb of Rebirth's text about pets and mounts (they are not locked)
44 lines
1.4 KiB
JavaScript
44 lines
1.4 KiB
JavaScript
"use strict";
|
|
|
|
/*
|
|
A controller to manage the Group Plans page
|
|
*/
|
|
|
|
angular.module('habitrpg')
|
|
.controller("GroupPlansCtrl", ['$scope', '$window', 'Groups', 'Payments',
|
|
function($scope, $window, Groups, Payments) {
|
|
$scope.PAGES = {
|
|
BENEFITS: 'benefits',
|
|
CREATE_GROUP: 'create-group',
|
|
UPGRADE_GROUP: 'upgrade-group',
|
|
};
|
|
$scope.activePage = $scope.PAGES.BENEFITS;
|
|
$scope.newGroup = {
|
|
type: 'guild',
|
|
privacy: 'private',
|
|
};
|
|
$scope.PAYMENTS = {
|
|
AMAZON: 'amazon',
|
|
STRIPE: 'stripe',
|
|
};
|
|
|
|
$scope.changePage = function (page) {
|
|
$scope.activePage = page;
|
|
$window.scrollTo(0, 0);
|
|
};
|
|
|
|
$scope.newGroupIsReady = function () {
|
|
return !!$scope.newGroup.name;
|
|
};
|
|
|
|
$scope.createGroup = function () {
|
|
$scope.changePage($scope.PAGES.UPGRADE_GROUP);
|
|
};
|
|
|
|
$scope.upgradeGroup = function (paymentType) {
|
|
var subscriptionKey = 'group_monthly'; // @TODO: Get from content API?
|
|
if (paymentType === $scope.PAYMENTS.STRIPE) Payments.showStripe({subscription: subscriptionKey, coupon: null, groupToCreate: $scope.newGroup});
|
|
if (paymentType === $scope.PAYMENTS.AMAZON) Payments.amazonPayments.init({type: 'subscription', subscription: subscriptionKey, coupon: null, groupToCreate: $scope.newGroup});
|
|
};
|
|
}]);
|