mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 23:27:26 +01:00
* dummy * Renamed internationalized strings to more meaningful names * moved the new group creation state out to its own URL, so it can also be linked to by the static/plans page * Added redirect-through-login functionality from the static/plans page new-group button This includes a static non-modal login page (similar to how other sites have both a login page and login modal) The login body has been abstracted out from its modal-specific view into mixins to accomplish this * deleted bak files added by mistake * deleted scripts added by mistake * changed static/plans Create Group button text * Added form link (https://github.com/HabitRPG/habitica/issues/8674#issuecomment-303518039) Removed changes to non-EN locale files (https://github.com/HabitRPG/habitica/pull/8729#issuecomment-303555211) * reverted key name changes as per https://github.com/HabitRPG/habitica/pull/8729#issuecomment-304515534 * changed $rootScope to $scope https://github.com/HabitRPG/habitica/pull/8729#discussion_r120695874
This commit is contained in:
@@ -9,35 +9,11 @@ angular.module('habitrpg')
|
||||
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});
|
||||
};
|
||||
}]);
|
||||
|
||||
Reference in New Issue
Block a user