mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
change coupon route in angular router to promo
This commit is contained in:
@@ -116,5 +116,6 @@
|
|||||||
"apply": "Apply",
|
"apply": "Apply",
|
||||||
"resubscribe": "Resubscribe",
|
"resubscribe": "Resubscribe",
|
||||||
"promoCode": "Promo Code",
|
"promoCode": "Promo Code",
|
||||||
|
"promoCodeApplied": "Promo Code Applied! Check your inventory",
|
||||||
"promoPlaceholder": "Enter Promotion Code"
|
"promoPlaceholder": "Enter Promotion Code"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -216,9 +216,9 @@ window.habitrpg = angular.module('habitrpg',
|
|||||||
url: "/export",
|
url: "/export",
|
||||||
templateUrl: "partials/options.settings.export.html"
|
templateUrl: "partials/options.settings.export.html"
|
||||||
})
|
})
|
||||||
.state('options.settings.coupon', {
|
.state('options.settings.promo', {
|
||||||
url: "/coupon",
|
url: "/promo",
|
||||||
templateUrl: "partials/options.settings.coupon.html"
|
templateUrl: "partials/options.settings.promo.html"
|
||||||
})
|
})
|
||||||
.state('options.settings.subscription', {
|
.state('options.settings.subscription', {
|
||||||
url: "/subscription",
|
url: "/subscription",
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ habitrpg.controller('SettingsCtrl',
|
|||||||
var mapPrefToEmailString = {
|
var mapPrefToEmailString = {
|
||||||
'importantAnnouncements': 'inactivityEmails'
|
'importantAnnouncements': 'inactivityEmails'
|
||||||
};
|
};
|
||||||
|
|
||||||
// If ?unsubFrom param is passed with valid email type,
|
// If ?unsubFrom param is passed with valid email type,
|
||||||
// automatically unsubscribe users from that email and
|
// automatically unsubscribe users from that email and
|
||||||
// show an alert
|
// show an alert
|
||||||
@@ -42,7 +42,7 @@ habitrpg.controller('SettingsCtrl',
|
|||||||
User.set({"preferences.stickyHeader":false});
|
User.set({"preferences.stickyHeader":false});
|
||||||
$rootScope.$on('userSynced', function(){
|
$rootScope.$on('userSynced', function(){
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,7 +144,7 @@ habitrpg.controller('SettingsCtrl',
|
|||||||
$http.post(ApiUrl.get() + '/api/v2/user/coupon/' + code).success(function(res,code){
|
$http.post(ApiUrl.get() + '/api/v2/user/coupon/' + code).success(function(res,code){
|
||||||
if (code!==200) return;
|
if (code!==200) return;
|
||||||
User.sync();
|
User.sync();
|
||||||
Notification.text('Coupon applied! Check your inventory');
|
Notification.text(env.t('promoCodeApplied'));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
$scope.generateCodes = function(codes){
|
$scope.generateCodes = function(codes){
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ script(id='partials/options.settings.html', type="text/ng-template")
|
|||||||
li(ng-class="{ active: $state.includes('options.settings.export') }")
|
li(ng-class="{ active: $state.includes('options.settings.export') }")
|
||||||
a(ui-sref='options.settings.export')
|
a(ui-sref='options.settings.export')
|
||||||
=env.t('dataExport')
|
=env.t('dataExport')
|
||||||
li(ng-class="{ active: $state.includes('options.settings.coupon') }")
|
li(ng-class="{ active: $state.includes('options.settings.promo') }")
|
||||||
a(ui-sref='options.settings.coupon')
|
a(ui-sref='options.settings.promo')
|
||||||
=env.t('promoCode')
|
=env.t('promoCode')
|
||||||
li(ng-class="{ active: $state.includes('options.settings.subscription') }")
|
li(ng-class="{ active: $state.includes('options.settings.subscription') }")
|
||||||
a(ui-sref='options.settings.subscription')=env.t('subscription')
|
a(ui-sref='options.settings.subscription')=env.t('subscription')
|
||||||
@@ -154,11 +154,11 @@ script(type='text/ng-template', id='partials/options.settings.settings.html')
|
|||||||
a.btn.btn-danger(ng-click='openModal("reset", {controller:"SettingsCtrl"})', popover-trigger='mouseenter', popover-placement='right', popover=env.t('resetAccPop'))= env.t('resetAccount')
|
a.btn.btn-danger(ng-click='openModal("reset", {controller:"SettingsCtrl"})', popover-trigger='mouseenter', popover-placement='right', popover=env.t('resetAccPop'))= env.t('resetAccount')
|
||||||
a.btn.btn-danger(ng-click='openModal("delete", {controller:"SettingsCtrl"})', popover-trigger='mouseenter', popover=env.t('deleteAccPop'))= env.t('deleteAccount')
|
a.btn.btn-danger(ng-click='openModal("delete", {controller:"SettingsCtrl"})', popover-trigger='mouseenter', popover=env.t('deleteAccPop'))= env.t('deleteAccount')
|
||||||
|
|
||||||
script(type='text/ng-template', id='partials/options.settings.coupon.html')
|
script(type='text/ng-template', id='partials/options.settings.promo.html')
|
||||||
.container-fluid
|
.container-fluid
|
||||||
.row
|
.row
|
||||||
.col-md-6
|
.col-md-6
|
||||||
h2= env.t('promoCode')
|
h2=env.t('promoCode')
|
||||||
form.form-inline(role='form',ng-submit='enterCoupon(_couponCode)')
|
form.form-inline(role='form',ng-submit='enterCoupon(_couponCode)')
|
||||||
input.form-control(type='text', ng-model='_couponCode', placeholder=env.t('promoPlaceholder'))
|
input.form-control(type='text', ng-model='_couponCode', placeholder=env.t('promoPlaceholder'))
|
||||||
button.btn.btn-primary(type='submit')= env.t('submit')
|
button.btn.btn-primary(type='submit')= env.t('submit')
|
||||||
|
|||||||
@@ -243,7 +243,7 @@ nav.toolbar(ng-controller='AuthCtrl', ng-class='{active: isToolbarHidden}')
|
|||||||
li
|
li
|
||||||
a(ui-sref='options.settings.export')=env.t('export')
|
a(ui-sref='options.settings.export')=env.t('export')
|
||||||
li
|
li
|
||||||
a(ui-sref='options.settings.coupon')=env.t('promoCode')
|
a(ui-sref='options.settings.promo')=env.t('promoCode')
|
||||||
li
|
li
|
||||||
a(ui-sref='options.settings.subscription')=env.t('subscription')
|
a(ui-sref='options.settings.subscription')=env.t('subscription')
|
||||||
li
|
li
|
||||||
|
|||||||
Reference in New Issue
Block a user