diff --git a/migrations/challenges/sync-all-challenges.js b/migrations/challenges/sync-all-challenges.js index 5200bab806..4cb9d00088 100644 --- a/migrations/challenges/sync-all-challenges.js +++ b/migrations/challenges/sync-all-challenges.js @@ -1,47 +1,47 @@ -import Bluebird from 'Bluebird'; - -import { model as Challenges } from '../../website/server/models/challenge'; -import { model as User } from '../../website/server/models/user'; - -async function syncChallengeToMembers (challenges) { - let challengSyncPromises = challenges.map(async function (challenge) { - let users = await User.find({ - // _id: '', - challenges: challenge._id, - }).exec(); - - let promises = []; - users.forEach(function (user) { - promises.push(challenge.syncToUser(user)); - promises.push(challenge.save()); - promises.push(user.save()); - }); - - return Bluebird.all(promises); - }); - - return await Bluebird.all(challengSyncPromises); -} - -async function syncChallenges (lastChallengeDate) { - let query = { - // _id: '', - }; - - if (lastChallengeDate) { - query.createdOn = { $lte: lastChallengeDate }; - } - - let challengesFound = await Challenges.find(query) - .limit(10) - .sort('-createdAt') - .exec(); - - let syncedChallenges = await syncChallengeToMembers(challengesFound) - .catch(reason => console.error(reason)); - let lastChallenge = challengesFound[challengesFound.length - 1]; - if (lastChallenge) syncChallenges(lastChallenge.createdAt); - return syncedChallenges; -}; - -module.exports = syncChallenges; +import Bluebird from 'Bluebird'; + +import { model as Challenges } from '../../website/server/models/challenge'; +import { model as User } from '../../website/server/models/user'; + +async function syncChallengeToMembers (challenges) { + let challengSyncPromises = challenges.map(async function (challenge) { + let users = await User.find({ + // _id: '', + challenges: challenge._id, + }).exec(); + + let promises = []; + users.forEach(function (user) { + promises.push(challenge.syncToUser(user)); + promises.push(challenge.save()); + promises.push(user.save()); + }); + + return Bluebird.all(promises); + }); + + return await Bluebird.all(challengSyncPromises); +} + +async function syncChallenges (lastChallengeDate) { + let query = { + // _id: '', + }; + + if (lastChallengeDate) { + query.createdOn = { $lte: lastChallengeDate }; + } + + let challengesFound = await Challenges.find(query) + .limit(10) + .sort('-createdAt') + .exec(); + + let syncedChallenges = await syncChallengeToMembers(challengesFound) + .catch(reason => console.error(reason)); + let lastChallenge = challengesFound[challengesFound.length - 1]; + if (lastChallenge) syncChallenges(lastChallenge.createdAt); + return syncedChallenges; +}; + +module.exports = syncChallenges; diff --git a/test/client-old/spec/controllers/groupTaskActionsCtrlSpec.js b/test/client-old/spec/controllers/groupTaskActionsCtrlSpec.js index 1e2b5cc7e1..f058731b13 100644 --- a/test/client-old/spec/controllers/groupTaskActionsCtrlSpec.js +++ b/test/client-old/spec/controllers/groupTaskActionsCtrlSpec.js @@ -1,63 +1,63 @@ -describe('Group Tasks Meta Actions Controller', () => { - let rootScope, scope, user, userSerivce; - - beforeEach(() => { - module(function($provide) { - $provide.value('User', {}); - }); - - inject(($rootScope, $controller) => { - rootScope = $rootScope; - - user = specHelper.newUser(); - user._id = "unique-user-id"; - userSerivce = {user: user}; - - scope = $rootScope.$new(); - - scope.task = { - group: { - assignedUsers: [], - approval: { - required: false, - } - }, - }; - scope.task._edit = angular.copy(scope.task); - - $controller('GroupTaskActionsCtrl', {$scope: scope, User: userSerivce}); - }); - }); - - describe('toggleTaskRequiresApproval', function () { - it('toggles task approval required field from false to true', function () { - scope.toggleTaskRequiresApproval(); - expect(scope.task._edit.group.approval.required).to.be.true; - }); - - it('toggles task approval required field from true to false', function () { - scope.task._edit.group.approval.required = true; - scope.toggleTaskRequiresApproval(); - expect(scope.task._edit.group.approval.required).to.be.false; - }); - }); - - - describe('assign events', function () { - it('adds a group member to assigned users on "addedGroupMember" event ', () => { - var testId = 'test-id'; - rootScope.$broadcast('addedGroupMember', testId); - expect(scope.task.group.assignedUsers).to.contain(testId); - expect(scope.task._edit.group.assignedUsers).to.contain(testId); - }); - - it('removes a group member to assigned users on "addedGroupMember" event ', () => { - var testId = 'test-id'; - scope.task.group.assignedUsers.push(testId); - scope.task._edit.group.assignedUsers.push(testId); - rootScope.$broadcast('removedGroupMember', testId); - expect(scope.task.group.assignedUsers).to.not.contain(testId); - expect(scope.task._edit.group.assignedUsers).to.not.contain(testId); - }); - }); -}); +describe('Group Tasks Meta Actions Controller', () => { + let rootScope, scope, user, userSerivce; + + beforeEach(() => { + module(function($provide) { + $provide.value('User', {}); + }); + + inject(($rootScope, $controller) => { + rootScope = $rootScope; + + user = specHelper.newUser(); + user._id = "unique-user-id"; + userSerivce = {user: user}; + + scope = $rootScope.$new(); + + scope.task = { + group: { + assignedUsers: [], + approval: { + required: false, + } + }, + }; + scope.task._edit = angular.copy(scope.task); + + $controller('GroupTaskActionsCtrl', {$scope: scope, User: userSerivce}); + }); + }); + + describe('toggleTaskRequiresApproval', function () { + it('toggles task approval required field from false to true', function () { + scope.toggleTaskRequiresApproval(); + expect(scope.task._edit.group.approval.required).to.be.true; + }); + + it('toggles task approval required field from true to false', function () { + scope.task._edit.group.approval.required = true; + scope.toggleTaskRequiresApproval(); + expect(scope.task._edit.group.approval.required).to.be.false; + }); + }); + + + describe('assign events', function () { + it('adds a group member to assigned users on "addedGroupMember" event ', () => { + var testId = 'test-id'; + rootScope.$broadcast('addedGroupMember', testId); + expect(scope.task.group.assignedUsers).to.contain(testId); + expect(scope.task._edit.group.assignedUsers).to.contain(testId); + }); + + it('removes a group member to assigned users on "addedGroupMember" event ', () => { + var testId = 'test-id'; + scope.task.group.assignedUsers.push(testId); + scope.task._edit.group.assignedUsers.push(testId); + rootScope.$broadcast('removedGroupMember', testId); + expect(scope.task.group.assignedUsers).to.not.contain(testId); + expect(scope.task._edit.group.assignedUsers).to.not.contain(testId); + }); + }); +}); diff --git a/website/client-old/css/header.styl b/website/client-old/css/header.styl index 475a633fac..1593de5d2c 100644 --- a/website/client-old/css/header.styl +++ b/website/client-old/css/header.styl @@ -91,8 +91,8 @@ height: 10.5em width: 100% - // Covers avatars, health bar at 1005-768. Fix: - @media (max-width: 1005px) and (min-width: 768px) + // Covers avatars, health bar at 1005-768. Fix: + @media (max-width: 1005px) and (min-width: 768px) margin-top: 2.8em; // this is a wrapper for avatars in the header diff --git a/website/client-old/js/controllers/groupPlansCtrl.js b/website/client-old/js/controllers/groupPlansCtrl.js index 6fd7d96317..487037ce87 100644 --- a/website/client-old/js/controllers/groupPlansCtrl.js +++ b/website/client-old/js/controllers/groupPlansCtrl.js @@ -1,43 +1,43 @@ -"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}); - }; - }]); +"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}); + }; + }]); diff --git a/website/client/README.md b/website/client/README.md index f553bbd3a4..cfc8206c1b 100644 --- a/website/client/README.md +++ b/website/client/README.md @@ -1,20 +1,20 @@ -#Running - - Open a terminal and type `npm run client:dev` - - Open a second terminal and type `npm start` - -#Preparation Reading -- Vue 2 (https://vuejs.org) - -- Webpack (https://webpack.github.io/) is the build system and it includes plugins for code transformation, right now we have: BabelJS for ES6 transpilation, eslint for code style, less and postcss for css compilation. The code comes from https://github.com/vuejs-templates/webpack which is a Webpack template for Vue, with some small modifications to adapt it to our use case. Docs http://vuejs-templates.github.io/webpack/ - -- We’re using `.vue` files that make it possible to have HTML, JS and CSS for each component together in a single location. They’re implemented as a webpack plugin and the docs can be found here http://vue-loader.vuejs.org/en/ - -- SemanticUI is the UI framework http://semantic-ui.com/. So far I’ve only used the CSS part, it also has JS plugins but I’ve yet to use them. It supports theming so if it’s not too difficult we’ll want to customize the base theme with our own styles instead of writing CSS rules to override the original styling. - -The code is in `/website/client`. We’re using something very similar to Vuex (equivalent of React’s Redux) for state management http://vuex.vuejs.org/en/index.html - -The API is almost the same except that we don’t use mutations but only actions because it would make it difficult to work with common code - -The project is developed directly in the `develop` branch as long as we’ll be able to avoid splitting it into a different branch. - -So far most of the work has been on the template, so there’s no complex logic to understand. The only thing I would suggest you to read about is Vuex for data management: it’s basically a Flux implementation: there’s a central store that hold the data for the entire app, and every change to the data must happen through an action, the data cannot be mutated directly. +#Running + - Open a terminal and type `npm run client:dev` + - Open a second terminal and type `npm start` + +#Preparation Reading +- Vue 2 (https://vuejs.org) + +- Webpack (https://webpack.github.io/) is the build system and it includes plugins for code transformation, right now we have: BabelJS for ES6 transpilation, eslint for code style, less and postcss for css compilation. The code comes from https://github.com/vuejs-templates/webpack which is a Webpack template for Vue, with some small modifications to adapt it to our use case. Docs http://vuejs-templates.github.io/webpack/ + +- We’re using `.vue` files that make it possible to have HTML, JS and CSS for each component together in a single location. They’re implemented as a webpack plugin and the docs can be found here http://vue-loader.vuejs.org/en/ + +- SemanticUI is the UI framework http://semantic-ui.com/. So far I’ve only used the CSS part, it also has JS plugins but I’ve yet to use them. It supports theming so if it’s not too difficult we’ll want to customize the base theme with our own styles instead of writing CSS rules to override the original styling. + +The code is in `/website/client`. We’re using something very similar to Vuex (equivalent of React’s Redux) for state management http://vuex.vuejs.org/en/index.html + +The API is almost the same except that we don’t use mutations but only actions because it would make it difficult to work with common code + +The project is developed directly in the `develop` branch as long as we’ll be able to avoid splitting it into a different branch. + +So far most of the work has been on the template, so there’s no complex logic to understand. The only thing I would suggest you to read about is Vuex for data management: it’s basically a Flux implementation: there’s a central store that hold the data for the entire app, and every change to the data must happen through an action, the data cannot be mutated directly. diff --git a/website/client/readme.md b/website/client/readme.md index f553bbd3a4..cfc8206c1b 100644 --- a/website/client/readme.md +++ b/website/client/readme.md @@ -1,20 +1,20 @@ -#Running - - Open a terminal and type `npm run client:dev` - - Open a second terminal and type `npm start` - -#Preparation Reading -- Vue 2 (https://vuejs.org) - -- Webpack (https://webpack.github.io/) is the build system and it includes plugins for code transformation, right now we have: BabelJS for ES6 transpilation, eslint for code style, less and postcss for css compilation. The code comes from https://github.com/vuejs-templates/webpack which is a Webpack template for Vue, with some small modifications to adapt it to our use case. Docs http://vuejs-templates.github.io/webpack/ - -- We’re using `.vue` files that make it possible to have HTML, JS and CSS for each component together in a single location. They’re implemented as a webpack plugin and the docs can be found here http://vue-loader.vuejs.org/en/ - -- SemanticUI is the UI framework http://semantic-ui.com/. So far I’ve only used the CSS part, it also has JS plugins but I’ve yet to use them. It supports theming so if it’s not too difficult we’ll want to customize the base theme with our own styles instead of writing CSS rules to override the original styling. - -The code is in `/website/client`. We’re using something very similar to Vuex (equivalent of React’s Redux) for state management http://vuex.vuejs.org/en/index.html - -The API is almost the same except that we don’t use mutations but only actions because it would make it difficult to work with common code - -The project is developed directly in the `develop` branch as long as we’ll be able to avoid splitting it into a different branch. - -So far most of the work has been on the template, so there’s no complex logic to understand. The only thing I would suggest you to read about is Vuex for data management: it’s basically a Flux implementation: there’s a central store that hold the data for the entire app, and every change to the data must happen through an action, the data cannot be mutated directly. +#Running + - Open a terminal and type `npm run client:dev` + - Open a second terminal and type `npm start` + +#Preparation Reading +- Vue 2 (https://vuejs.org) + +- Webpack (https://webpack.github.io/) is the build system and it includes plugins for code transformation, right now we have: BabelJS for ES6 transpilation, eslint for code style, less and postcss for css compilation. The code comes from https://github.com/vuejs-templates/webpack which is a Webpack template for Vue, with some small modifications to adapt it to our use case. Docs http://vuejs-templates.github.io/webpack/ + +- We’re using `.vue` files that make it possible to have HTML, JS and CSS for each component together in a single location. They’re implemented as a webpack plugin and the docs can be found here http://vue-loader.vuejs.org/en/ + +- SemanticUI is the UI framework http://semantic-ui.com/. So far I’ve only used the CSS part, it also has JS plugins but I’ve yet to use them. It supports theming so if it’s not too difficult we’ll want to customize the base theme with our own styles instead of writing CSS rules to override the original styling. + +The code is in `/website/client`. We’re using something very similar to Vuex (equivalent of React’s Redux) for state management http://vuex.vuejs.org/en/index.html + +The API is almost the same except that we don’t use mutations but only actions because it would make it difficult to work with common code + +The project is developed directly in the `develop` branch as long as we’ll be able to avoid splitting it into a different branch. + +So far most of the work has been on the template, so there’s no complex logic to understand. The only thing I would suggest you to read about is Vuex for data management: it’s basically a Flux implementation: there’s a central store that hold the data for the entire app, and every change to the data must happen through an action, the data cannot be mutated directly. diff --git a/website/common/locales/en/groups.json b/website/common/locales/en/groups.json index 012bc259dc..c4ae284d37 100644 --- a/website/common/locales/en/groups.json +++ b/website/common/locales/en/groups.json @@ -114,7 +114,7 @@ "messageRequired": "A message is required.", "toUserIDRequired": "A User ID is required", "gemAmountRequired": "A number of gems is required", - "notAuthorizedToSendMessageToThisUser": "Can't send message to this user.", + "notAuthorizedToSendMessageToThisUser": "You can't send a message to this player because they have chosen to block messages.", "privateMessageGiftGemsMessage": "Hello <%= receiverName %>, <%= senderName %> has sent you <%= gemAmount %> gems!", "privateMessageGiftSubscriptionMessage": "<%= numberOfMonths %> months of subscription! ", "cannotSendGemsToYourself": "Cannot send gems to yourself. Try a subscription instead.", diff --git a/website/common/locales/en/questsContent.json b/website/common/locales/en/questsContent.json index c41d73d95b..601efa0f42 100644 --- a/website/common/locales/en/questsContent.json +++ b/website/common/locales/en/questsContent.json @@ -109,7 +109,7 @@ "questGoldenknight1DropGoldenknight2Quest": "The Golden Knight Part 2: Gold Knight (Scroll)", "questGoldenknight2Text": "The Golden Knight, Part 2: Gold Knight", - "questGoldenknight2Notes": "Armed with hundreds of Habitican's testimonies, you finally confront the Golden Knight. You begin to recite the Habitcan's complaints to her, one by one. \"And @Pfeffernusse says that your constant bragging-\" The knight raises her hand to silence you and scoffs, \"Please, these people are merely jealous of my success. Instead of complaining, they should simply work as hard as I! Perhaps I shall show you the power you can attain through diligence such as mine!\" She raises her morningstar and prepares to attack you!", + "questGoldenknight2Notes": "Armed with dozens of Habiticans' testimonies, you finally confront the Golden Knight. You begin to recite the Habitcans' complaints to her, one by one. \"And @Pfeffernusse says that your constant bragging-\" The knight raises her hand to silence you and scoffs, \"Please, these people are merely jealous of my success. Instead of complaining, they should simply work as hard as I! Perhaps I shall show you the power you can attain through diligence such as mine!\" She raises her morningstar and prepares to attack you!", "questGoldenknight2Boss": "Gold Knight", "questGoldenknight2DropGoldenknight3Quest": "The Golden Knight Part 3: The Iron Knight (Scroll)", diff --git a/website/common/locales/en/rebirth.json b/website/common/locales/en/rebirth.json index 4e49970b89..dc3e25eebf 100644 --- a/website/common/locales/en/rebirth.json +++ b/website/common/locales/en/rebirth.json @@ -11,7 +11,7 @@ "rebirthInList1": "Tasks, history, equipment, and settings remain.", "rebirthInList2": "Challenge, Guild, and Party memberships remain.", "rebirthInList3": "Gems, backer tiers, and contributor levels remain.", - "rebirthInList4": "Items obtained from Gems or drops (such as pets and mounts) remain, though you cannot access them until you unlock them again.", + "rebirthInList4": "Items obtained from Gems or drops (such as pets and mounts) remain.", "rebirthEarnAchievement": "You also earn an Achievement for beginning a new adventure!", "beReborn": "Be Reborn", "rebirthAchievement": "You've begun a new adventure! This is Rebirth <%= number %> for you, and the highest Level you've attained is <%= level %>. To stack this Achievement, begin your next new adventure when you've reached an even higher Level!", diff --git a/website/common/locales/en/subscriber.json b/website/common/locales/en/subscriber.json index b36e878c23..4cd3e59bd9 100644 --- a/website/common/locales/en/subscriber.json +++ b/website/common/locales/en/subscriber.json @@ -37,7 +37,7 @@ "subscribed": "Subscribed", "manageSub": "Click to manage subscription", "cancelSub": "Cancel Subscription", - "cancelSubInfoGoogle": "Please go to the \"My apps & games\" > \"Subscriptions\" section of the Google Play Store app to cancel your subscription or to see your subscription's termination date if you have already cancelled it. This screen is not able to show you whether your subscription has been cancelled.", + "cancelSubInfoGoogle": "Please go to the \"Account\" > \"Subscriptions\" section of the Google Play Store app to cancel your subscription or to see your subscription's termination date if you have already cancelled it. This screen is not able to show you whether your subscription has been cancelled.", "cancelSubInfoApple": "Please follow Apple’s official instructions to cancel your subscription or to see your subscription's termination date if you have already cancelled it. This screen is not able to show you whether your subscription has been cancelled.", "canceledSubscription": "Canceled Subscription", "cancelingSubscription": "Canceling the subscription", diff --git a/website/common/locales/en/tasks.json b/website/common/locales/en/tasks.json index e157f4f200..3ceb4c227f 100644 --- a/website/common/locales/en/tasks.json +++ b/website/common/locales/en/tasks.json @@ -1,7 +1,7 @@ { "clearCompleted": "Delete Completed", "lotOfToDos": "Your most recent 30 completed To-Dos are shown here. You can see older completed To-Dos from Data > Data Display Tool or Data > Export Data > User Data.", - "deleteToDosExplanation": "If you click the button below, all of your completed To-Dos and archived To-Dos will be permanently deleted. Export them first if you want to keep a record of them.", + "deleteToDosExplanation": "If you click the button below, all of your completed To-Dos and archived To-Dos will be permanently deleted, except for To-Dos from active challenges and Group Plans. Export them first if you want to keep a record of them.", "addmultiple": "Add Multiple", "addsingle": "Add Single", "habit": "Habit", diff --git a/website/views/options/profile/achievements.jade b/website/views/options/profile/achievements.jade index 0392405013..1abb279148 100644 --- a/website/views/options/profile/achievements.jade +++ b/website/views/options/profile/achievements.jade @@ -1,5 +1,5 @@ -script(id='partials/options.profile.achievements.html', type='text/ng-template') - .container-fluid - div(class='row') - div(ng-class='user.flags.classSelected && !user.preferences.disableClasses ? "col-md-4" : "col-md-6"') - include ../../shared/profiles/achievements +script(id='partials/options.profile.achievements.html', type='text/ng-template') + .container-fluid + div(class='row') + div(ng-class='user.flags.classSelected && !user.preferences.disableClasses ? "col-md-4" : "col-md-6"') + include ../../shared/profiles/achievements diff --git a/website/views/options/profile/avatar.jade b/website/views/options/profile/avatar.jade index e0213ef5b1..d97088da3f 100644 --- a/website/views/options/profile/avatar.jade +++ b/website/views/options/profile/avatar.jade @@ -1,2 +1,2 @@ -script(id='partials/options.profile.avatar.html', type='text/ng-template') - +customizeProfile() +script(id='partials/options.profile.avatar.html', type='text/ng-template') + +customizeProfile() diff --git a/website/views/options/settings/export.jade b/website/views/options/settings/export.jade index 6b80129f22..dbcea5a094 100644 --- a/website/views/options/settings/export.jade +++ b/website/views/options/settings/export.jade @@ -1,13 +1,13 @@ -script(id='partials/options.settings.export.html', type="text/ng-template") - .container-fluid - .row - .col-md-6 - h2=env.t('dataExport') - small=env.t('saveData') - h4=env.t('habitHistory') - =env.t('exportHistory') - a(href="/export/history.csv")= ' ' + env.t('csv') - h4=env.t('userData') - =env.t('exportUserData') - a(href="/export/userdata.xml")= ' ' + env.t('xml') + ' ' - a(href="/export/userdata.json")= env.t('json') +script(id='partials/options.settings.export.html', type="text/ng-template") + .container-fluid + .row + .col-md-6 + h2=env.t('dataExport') + small=env.t('saveData') + h4=env.t('habitHistory') + =env.t('exportHistory') + a(href="/export/history.csv")= ' ' + env.t('csv') + h4=env.t('userData') + =env.t('exportUserData') + a(href="/export/userdata.xml")= ' ' + env.t('xml') + ' ' + a(href="/export/userdata.json")= env.t('json') diff --git a/website/views/options/settings/notification.jade b/website/views/options/settings/notification.jade index 487df82af7..a1f8cbfb25 100644 --- a/website/views/options/settings/notification.jade +++ b/website/views/options/settings/notification.jade @@ -1,49 +1,49 @@ -script(id='partials/options.settings.notifications.html', type="text/ng-template") - .container-fluid - .row - .personal-options.col-md-6 - .panel.panel-default - .panel-heading - =env.t('notifications') - .panel-body - table.table - tr - td - th - span=env.t("email") - th - span=env.t("push") - -var unsubscribeFromAllEmails = 'user.preferences.emailNotifications.unsubscribeFromAll' - -var unsubscribeFromAllPush = 'user.preferences.pushNotifications.unsubscribeFromAll' - each notification in ['newPM', 'wonChallenge', 'giftedGems', 'giftedSubscription', 'invitedParty', 'invitedGuild', 'kickedGroup', 'questStarted', 'invitedQuest', 'importantAnnouncements', 'weeklyRecaps', 'onboarding'] - tr - td - span=env.t(notification) - td - -var preference = 'user.preferences.emailNotifications.' + notification - input(type='checkbox', ng-model='#{preference}', - ng-disabled='#{unsubscribeFromAllEmails} === true || #{preference} === undefined', - ng-checked='#{unsubscribeFromAllEmails} === false && #{preference} === true', - ng-change='set({"preferences.emailNotifications.#{notification}": #{preference} ? true: false})') - td - -var preference = 'user.preferences.pushNotifications.' + notification - input(type='checkbox', ng-model='#{preference}', - ng-disabled='#{unsubscribeFromAllPush} === true || #{preference} === undefined', - ng-checked='#{unsubscribeFromAllPush} === false && #{preference} === true', - ng-change='set({"preferences.pushNotifications.#{notification}": #{preference} ? true: false})') - - hr - - .checkbox - label - input(type='checkbox', ng-model='user.preferences.pushNotifications.unsubscribeFromAll', - ng-change='set({"preferences.pushNotifications.unsubscribeFromAll": user.preferences.pushNotifications.unsubscribeFromAll ? true: false})') - span=env.t('unsubscribeAllPush') - - .checkbox - label - input(type='checkbox', ng-model='user.preferences.emailNotifications.unsubscribeFromAll', - ng-change='set({"preferences.emailNotifications.unsubscribeFromAll": user.preferences.emailNotifications.unsubscribeFromAll ? true: false})') - span=env.t('unsubscribeAllEmails') - - small=env.t('unsubscribeAllEmailsText') +script(id='partials/options.settings.notifications.html', type="text/ng-template") + .container-fluid + .row + .personal-options.col-md-6 + .panel.panel-default + .panel-heading + =env.t('notifications') + .panel-body + table.table + tr + td + th + span=env.t("email") + th + span=env.t("push") + -var unsubscribeFromAllEmails = 'user.preferences.emailNotifications.unsubscribeFromAll' + -var unsubscribeFromAllPush = 'user.preferences.pushNotifications.unsubscribeFromAll' + each notification in ['newPM', 'wonChallenge', 'giftedGems', 'giftedSubscription', 'invitedParty', 'invitedGuild', 'kickedGroup', 'questStarted', 'invitedQuest', 'importantAnnouncements', 'weeklyRecaps', 'onboarding'] + tr + td + span=env.t(notification) + td + -var preference = 'user.preferences.emailNotifications.' + notification + input(type='checkbox', ng-model='#{preference}', + ng-disabled='#{unsubscribeFromAllEmails} === true || #{preference} === undefined', + ng-checked='#{unsubscribeFromAllEmails} === false && #{preference} === true', + ng-change='set({"preferences.emailNotifications.#{notification}": #{preference} ? true: false})') + td + -var preference = 'user.preferences.pushNotifications.' + notification + input(type='checkbox', ng-model='#{preference}', + ng-disabled='#{unsubscribeFromAllPush} === true || #{preference} === undefined', + ng-checked='#{unsubscribeFromAllPush} === false && #{preference} === true', + ng-change='set({"preferences.pushNotifications.#{notification}": #{preference} ? true: false})') + + hr + + .checkbox + label + input(type='checkbox', ng-model='user.preferences.pushNotifications.unsubscribeFromAll', + ng-change='set({"preferences.pushNotifications.unsubscribeFromAll": user.preferences.pushNotifications.unsubscribeFromAll ? true: false})') + span=env.t('unsubscribeAllPush') + + .checkbox + label + input(type='checkbox', ng-model='user.preferences.emailNotifications.unsubscribeFromAll', + ng-change='set({"preferences.emailNotifications.unsubscribeFromAll": user.preferences.emailNotifications.unsubscribeFromAll ? true: false})') + span=env.t('unsubscribeAllEmails') + + small=env.t('unsubscribeAllEmailsText') diff --git a/website/views/options/settings/promo.jade b/website/views/options/settings/promo.jade index 509f31b713..956d762b4e 100644 --- a/website/views/options/settings/promo.jade +++ b/website/views/options/settings/promo.jade @@ -1,21 +1,21 @@ -script(type='text/ng-template', id='partials/options.settings.promo.html') - .container-fluid - .row - .col-md-6 - h2=env.t('promoCode') - form.form-inline(role='form',ng-submit='enterCoupon(_couponCode)') - input.form-control(type='text', ng-model='_couponCode', placeholder=env.t('promoPlaceholder')) - button.btn.btn-primary(type='submit')= env.t('submit') - div - small= env.t('couponText') - div(ng-if='user.contributor.sudo') - hr - h4=env.t('generateCodes') - form.form(role='form',ng-submit='generateCodes(_codes)',ng-init='_codes={}') - .form-group - input.form-control(type='text',ng-model='_codes.event',placeholder="Event code (eg, 'wondercon')") - .form-group - input.form-control(type='number',ng-model='_codes.count',placeholder="Number of codes to generate (eg, 250)") - .form-group - button.btn.btn-primary(type='submit')=env.t('generate') - a.btn.btn-default(href='/api/v3/coupons?_id={{user._id}}&apiToken={{User.settings.auth.apiToken}}')=env.t('getCodes') +script(type='text/ng-template', id='partials/options.settings.promo.html') + .container-fluid + .row + .col-md-6 + h2=env.t('promoCode') + form.form-inline(role='form',ng-submit='enterCoupon(_couponCode)') + input.form-control(type='text', ng-model='_couponCode', placeholder=env.t('promoPlaceholder')) + button.btn.btn-primary(type='submit')= env.t('submit') + div + small= env.t('couponText') + div(ng-if='user.contributor.sudo') + hr + h4=env.t('generateCodes') + form.form(role='form',ng-submit='generateCodes(_codes)',ng-init='_codes={}') + .form-group + input.form-control(type='text',ng-model='_codes.event',placeholder="Event code (eg, 'wondercon')") + .form-group + input.form-control(type='number',ng-model='_codes.count',placeholder="Number of codes to generate (eg, 250)") + .form-group + button.btn.btn-primary(type='submit')=env.t('generate') + a.btn.btn-default(href='/api/v3/coupons?_id={{user._id}}&apiToken={{User.settings.auth.apiToken}}')=env.t('getCodes') diff --git a/website/views/options/settings/settings.jade b/website/views/options/settings/settings.jade index 903869d4fc..1f5a1b7e81 100644 --- a/website/views/options/settings/settings.jade +++ b/website/views/options/settings/settings.jade @@ -1,186 +1,186 @@ -script(type='text/ng-template', id='partials/options.settings.settings.html') - .container-fluid - .row - .personal-options.col-md-6 - .panel.panel-default - .panel-heading - =env.t('settings') - .panel-body - - .form-horizontal - h5=env.t('language') - select.form-control(ng-model='language.code', ng-options='lang.code as lang.name for lang in availableLanguages', ng-change='changeLanguage()') - small - !=env.t('americanEnglishGovern') - br - strong - !=env.t('helpWithTranslation') - - hr - - .form-horizontal - h5=env.t('dateFormat') - select.form-control(ng-model='user.preferences.dateFormat', ng-options='DF for DF in availableFormats', ng-change='set({"preferences.dateFormat": user.preferences.dateFormat})') - - hr - - .checkbox - label - input(type='checkbox', ng-click='hideHeader() ', ng-checked='user.preferences.hideHeader!==true') - span.hint(popover-trigger='mouseenter', popover-placement='right', popover=env.t('showHeaderPop'))=env.t('showHeader') - .checkbox - label - input(type='checkbox', ng-click='toggleStickyHeader()', ng-checked='user.preferences.stickyHeader!==false', ng-disabled="user.preferences.hideHeader!==false") - span.hint(popover-trigger='mouseenter', popover-placement='right', popover=env.t('stickyHeaderPop'))=env.t('stickyHeader') - .checkbox - label - input(type='checkbox', ng-model='user.preferences.newTaskEdit', ng-change='set({"preferences.newTaskEdit": user.preferences.newTaskEdit?true: false})') - span.hint(popover-trigger='mouseenter', popover-placement='right', popover=env.t('newTaskEditPop'))=env.t('newTaskEdit') - .checkbox - label - input(type='checkbox', ng-model='user.preferences.tagsCollapsed', ng-change='set({"preferences.tagsCollapsed": user.preferences.tagsCollapsed?true: false})') - span.hint(popover-trigger='mouseenter', popover-placement='right', popover=env.t('startCollapsedPop'))=env.t('startCollapsed') - .checkbox - label - input(type='checkbox', ng-model='user.preferences.advancedCollapsed', ng-change='set({"preferences.advancedCollapsed": user.preferences.advancedCollapsed?true: false})') - span.hint(popover-trigger='mouseenter', popover-placement='right', popover=env.t('startAdvCollapsedPop'))=env.t('startAdvCollapsed') - .checkbox - label - input(type='checkbox', ng-model='user.preferences.dailyDueDefaultView', ng-change='set({"preferences.dailyDueDefaultView": user.preferences.dailyDueDefaultView?true: false})') - span.hint(popover-trigger='mouseenter', popover-placement='right', popover=env.t('dailyDueDefaultViewPop'))=env.t('dailyDueDefaultView') - .checkbox(ng-if='party.memberCount === 1') - label - input(type='checkbox', ng-model='user.preferences.displayInviteToPartyWhenPartyIs1', ng-change='set({"preferences.displayInviteToPartyWhenPartyIs1": user.preferences.displayInviteToPartyWhenPartyIs1 ? true : false})') - span.hint(popover-trigger='mouseenter', popover-placement='right', popover=env.t('displayInviteToPartyWhenPartyIs1'))=env.t('displayInviteToPartyWhenPartyIs1') - .checkbox - label=env.t('suppressLevelUpModal') - input(type='checkbox', ng-model='user.preferences.suppressModals.levelUp', ng-change='set({"preferences.suppressModals.levelUp": user.preferences.suppressModals.levelUp?true: false})') - .checkbox - label=env.t('suppressHatchPetModal') - input(type='checkbox', ng-model='user.preferences.suppressModals.hatchPet', ng-change='set({"preferences.suppressModals.hatchPet": user.preferences.suppressModals.hatchPet?true: false})') - .checkbox - label=env.t('suppressRaisePetModal') - input(type='checkbox', ng-model='user.preferences.suppressModals.raisePet', ng-change='set({"preferences.suppressModals.raisePet": user.preferences.suppressModals.raisePet?true: false})') - .checkbox - label=env.t('suppressStreakModal') - input(type='checkbox', ng-model='user.preferences.suppressModals.streak', ng-change='set({"preferences.suppressModals.streak": user.preferences.suppressModals.streak?true: false})') - //- .checkbox - //- label=env.t('confirmScoreNotes') - //- input(type='checkbox', ng-model='user.preferences.tasks.confirmScoreNotes', ng-change='set({"preferences.tasks.confirmScoreNotes": user.preferences.tasks.confirmScoreNotes ? true: false})') - - //- .checkbox - //- label=env.t('groupTasksByChallenge') - //- input(type='checkbox', ng-model='user.preferences.tasks.groupByChallenge', ng-change='set({"preferences.tasks.groupByChallenge": user.preferences.tasks.groupByChallenge ? true: false})') - - hr - - button.btn.btn-default(ng-click='showBailey()', popover-trigger='mouseenter', popover-placement='right', popover=env.t('showBaileyPop'))= env.t('showBailey') - button.btn.btn-default(ng-click='openRestoreModal()', popover-trigger='mouseenter', popover-placement='right', popover=env.t('fixValPop'))= env.t('fixVal') - button.btn.btn-default(ng-if='user.preferences.disableClasses==true', ng-click='User.changeClass({})', popover-trigger='mouseenter', popover-placement='right', popover=env.t('enableClassPop'))= env.t('enableClass') - - hr - - h5=env.t('customDayStart') - alert.alert-warning=env.t('customDayStartInfo1') - - .form-horizontal - .form-group - .col-sm-7 - select.form-control(ng-model='dayStart') - - var number = 0 - while number < 24 - - var value = number - - var meridian = number < 12 ? 'AM' : 'PM' - - var hour = number++ % 12 - option(value=value) #{hour ? hour : 12}:00 #{meridian} - - .col-sm-5 - br.visible-xs - button.btn.btn-block.btn-primary(ng-click='openDayStartModal(dayStart)', - ng-disabled='dayStart == user.preferences.dayStart') - =env.t('saveCustomDayStart') - - hr - - h5=env.t('timezone') - .form-horizontal - .form-group - .col-sm-12 - p!=env.t('timezoneUTC', {utc: "{{ user.preferences.timezoneOffset | timezoneOffsetToUtc }}"}) - br - p!=env.t('timezoneInfo') - - .personal-options.col-md-6 - .panel.panel-default - .panel-heading - span=env.t('registration') - .panel-body - div - ul.list-inline - li(ng-repeat='network in SOCIAL_AUTH_NETWORKS') - button.btn.btn-primary(ng-if='!user.auth[network.key].id', ng-click='socialLogin(network.key, user)')=env.t('registerWithSocial', {network: '{{network.name}}'}) - button.btn.btn-primary(disabled='disabled', ng-if='!hasBackupAuthOption(user, network.key) && user.auth[network.key].id')=env.t('registeredWithSocial', {network: '{{network.name}}'}) - button.btn.btn-danger(ng-click='deleteSocialAuth(network.key)', ng-if='hasBackupAuthOption(user, network.key) && user.auth[network.key].id')=env.t('detachSocial', {network: '{{network.name}}'}) - hr - div(ng-if='!user.auth.local.username') - p=env.t('addLocalAuth') - form(ng-submit='http("post", "/api/v3/user/auth/local/register", localAuth, "addedLocalAuth")', ng-init='localAuth={}', name='localAuth', novalidate) - //-.alert.alert-danger(ng-messages='changeUsername.$error && changeUsername.submitted')=env.t('fillAll') - .form-group - input.form-control(type='text', placeholder=env.t('username'), ng-model='localAuth.username', required) - .form-group - input.form-control(type='text', placeholder=env.t('email'), ng-model='localAuth.email', required) - .form-group - input.form-control(type='password', placeholder=env.t('password'), ng-model='localAuth.password', required) - .form-group - input.form-control(type='password', placeholder=env.t('confirmPass'), ng-model='localAuth.confirmPassword', required) - input.btn.btn-default(type='submit', ng-disabled='localAuth.$invalid', value=env.t('submit')) - - div(ng-if='user.auth.local.username') - p=env.t('username') - |: {{user.auth.local.username}} - p - small.muted - =env.t('loginNameDescription1') - |  - a(href='/#/options/profile/profile')=env.t('loginNameDescription2') - |  - =env.t('loginNameDescription3') - p=env.t('email') - |: {{user.auth.local.email}} - hr - - h5=env.t('changeUsername') - form(ng-submit='changeUser("username", usernameUpdates)', ng-init='usernameUpdates={}', ng-show='user.auth.local', name='changeUsername', novalidate) - //-.alert.alert-danger(ng-messages='changeUsername.$error && changeUsername.submitted')=env.t('fillAll') - .form-group - input.form-control(type='text', placeholder=env.t('newUsername'), ng-model='usernameUpdates.username', required) - .form-group - input.form-control(type='password', placeholder=env.t('password'), ng-model='usernameUpdates.password', required) - input.btn.btn-default(type='submit', ng-disabled='changeUsername.$invalid', value=env.t('submit')) - - h5=env.t('changeEmail') - form(ng-submit='changeUser("email", emailUpdates)', ng-show='user.auth.local', name='changeEmail', novalidate) - .form-group - input.form-control(type='text', placeholder=env.t('newEmail'), ng-model='emailUpdates.newEmail', required) - .form-group - input.form-control(type='password', placeholder=env.t('password'), ng-model='emailUpdates.password', required) - input.btn.btn-default(type='submit', ng-disabled='changeEmail.$invalid', value=env.t('submit')) - - h5=env.t('changePass') - form(ng-submit='changeUser("password", passwordUpdates)', ng-show='user.auth.local', name='changePassword', novalidate) - .form-group - input.form-control(type='password', placeholder=env.t('oldPass'), ng-model='passwordUpdates.password', required) - .form-group - input.form-control(type='password', placeholder=env.t('newPass'), ng-model='passwordUpdates.newPassword', required) - .form-group - input.form-control(type='password', placeholder=env.t('confirmPass'), ng-model='passwordUpdates.confirmPassword', required) - input.btn.btn-default(type='submit', ng-disabled='changePassword.$invalid', value=env.t('submit')) - - - .panel.panel-default - .panel-heading - span=env.t('dangerZone') - .panel-body - 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') +script(type='text/ng-template', id='partials/options.settings.settings.html') + .container-fluid + .row + .personal-options.col-md-6 + .panel.panel-default + .panel-heading + =env.t('settings') + .panel-body + + .form-horizontal + h5=env.t('language') + select.form-control(ng-model='language.code', ng-options='lang.code as lang.name for lang in availableLanguages', ng-change='changeLanguage()') + small + !=env.t('americanEnglishGovern') + br + strong + !=env.t('helpWithTranslation') + + hr + + .form-horizontal + h5=env.t('dateFormat') + select.form-control(ng-model='user.preferences.dateFormat', ng-options='DF for DF in availableFormats', ng-change='set({"preferences.dateFormat": user.preferences.dateFormat})') + + hr + + .checkbox + label + input(type='checkbox', ng-click='hideHeader() ', ng-checked='user.preferences.hideHeader!==true') + span.hint(popover-trigger='mouseenter', popover-placement='right', popover=env.t('showHeaderPop'))=env.t('showHeader') + .checkbox + label + input(type='checkbox', ng-click='toggleStickyHeader()', ng-checked='user.preferences.stickyHeader!==false', ng-disabled="user.preferences.hideHeader!==false") + span.hint(popover-trigger='mouseenter', popover-placement='right', popover=env.t('stickyHeaderPop'))=env.t('stickyHeader') + .checkbox + label + input(type='checkbox', ng-model='user.preferences.newTaskEdit', ng-change='set({"preferences.newTaskEdit": user.preferences.newTaskEdit?true: false})') + span.hint(popover-trigger='mouseenter', popover-placement='right', popover=env.t('newTaskEditPop'))=env.t('newTaskEdit') + .checkbox + label + input(type='checkbox', ng-model='user.preferences.tagsCollapsed', ng-change='set({"preferences.tagsCollapsed": user.preferences.tagsCollapsed?true: false})') + span.hint(popover-trigger='mouseenter', popover-placement='right', popover=env.t('startCollapsedPop'))=env.t('startCollapsed') + .checkbox + label + input(type='checkbox', ng-model='user.preferences.advancedCollapsed', ng-change='set({"preferences.advancedCollapsed": user.preferences.advancedCollapsed?true: false})') + span.hint(popover-trigger='mouseenter', popover-placement='right', popover=env.t('startAdvCollapsedPop'))=env.t('startAdvCollapsed') + .checkbox + label + input(type='checkbox', ng-model='user.preferences.dailyDueDefaultView', ng-change='set({"preferences.dailyDueDefaultView": user.preferences.dailyDueDefaultView?true: false})') + span.hint(popover-trigger='mouseenter', popover-placement='right', popover=env.t('dailyDueDefaultViewPop'))=env.t('dailyDueDefaultView') + .checkbox(ng-if='party.memberCount === 1') + label + input(type='checkbox', ng-model='user.preferences.displayInviteToPartyWhenPartyIs1', ng-change='set({"preferences.displayInviteToPartyWhenPartyIs1": user.preferences.displayInviteToPartyWhenPartyIs1 ? true : false})') + span.hint(popover-trigger='mouseenter', popover-placement='right', popover=env.t('displayInviteToPartyWhenPartyIs1'))=env.t('displayInviteToPartyWhenPartyIs1') + .checkbox + label=env.t('suppressLevelUpModal') + input(type='checkbox', ng-model='user.preferences.suppressModals.levelUp', ng-change='set({"preferences.suppressModals.levelUp": user.preferences.suppressModals.levelUp?true: false})') + .checkbox + label=env.t('suppressHatchPetModal') + input(type='checkbox', ng-model='user.preferences.suppressModals.hatchPet', ng-change='set({"preferences.suppressModals.hatchPet": user.preferences.suppressModals.hatchPet?true: false})') + .checkbox + label=env.t('suppressRaisePetModal') + input(type='checkbox', ng-model='user.preferences.suppressModals.raisePet', ng-change='set({"preferences.suppressModals.raisePet": user.preferences.suppressModals.raisePet?true: false})') + .checkbox + label=env.t('suppressStreakModal') + input(type='checkbox', ng-model='user.preferences.suppressModals.streak', ng-change='set({"preferences.suppressModals.streak": user.preferences.suppressModals.streak?true: false})') + //- .checkbox + //- label=env.t('confirmScoreNotes') + //- input(type='checkbox', ng-model='user.preferences.tasks.confirmScoreNotes', ng-change='set({"preferences.tasks.confirmScoreNotes": user.preferences.tasks.confirmScoreNotes ? true: false})') + + //- .checkbox + //- label=env.t('groupTasksByChallenge') + //- input(type='checkbox', ng-model='user.preferences.tasks.groupByChallenge', ng-change='set({"preferences.tasks.groupByChallenge": user.preferences.tasks.groupByChallenge ? true: false})') + + hr + + button.btn.btn-default(ng-click='showBailey()', popover-trigger='mouseenter', popover-placement='right', popover=env.t('showBaileyPop'))= env.t('showBailey') + button.btn.btn-default(ng-click='openRestoreModal()', popover-trigger='mouseenter', popover-placement='right', popover=env.t('fixValPop'))= env.t('fixVal') + button.btn.btn-default(ng-if='user.preferences.disableClasses==true', ng-click='User.changeClass({})', popover-trigger='mouseenter', popover-placement='right', popover=env.t('enableClassPop'))= env.t('enableClass') + + hr + + h5=env.t('customDayStart') + alert.alert-warning=env.t('customDayStartInfo1') + + .form-horizontal + .form-group + .col-sm-7 + select.form-control(ng-model='dayStart') + - var number = 0 + while number < 24 + - var value = number + - var meridian = number < 12 ? 'AM' : 'PM' + - var hour = number++ % 12 + option(value=value) #{hour ? hour : 12}:00 #{meridian} + + .col-sm-5 + br.visible-xs + button.btn.btn-block.btn-primary(ng-click='openDayStartModal(dayStart)', + ng-disabled='dayStart == user.preferences.dayStart') + =env.t('saveCustomDayStart') + + hr + + h5=env.t('timezone') + .form-horizontal + .form-group + .col-sm-12 + p!=env.t('timezoneUTC', {utc: "{{ user.preferences.timezoneOffset | timezoneOffsetToUtc }}"}) + br + p!=env.t('timezoneInfo') + + .personal-options.col-md-6 + .panel.panel-default + .panel-heading + span=env.t('registration') + .panel-body + div + ul.list-inline + li(ng-repeat='network in SOCIAL_AUTH_NETWORKS') + button.btn.btn-primary(ng-if='!user.auth[network.key].id', ng-click='socialLogin(network.key, user)')=env.t('registerWithSocial', {network: '{{network.name}}'}) + button.btn.btn-primary(disabled='disabled', ng-if='!hasBackupAuthOption(user, network.key) && user.auth[network.key].id')=env.t('registeredWithSocial', {network: '{{network.name}}'}) + button.btn.btn-danger(ng-click='deleteSocialAuth(network.key)', ng-if='hasBackupAuthOption(user, network.key) && user.auth[network.key].id')=env.t('detachSocial', {network: '{{network.name}}'}) + hr + div(ng-if='!user.auth.local.username') + p=env.t('addLocalAuth') + form(ng-submit='http("post", "/api/v3/user/auth/local/register", localAuth, "addedLocalAuth")', ng-init='localAuth={}', name='localAuth', novalidate) + //-.alert.alert-danger(ng-messages='changeUsername.$error && changeUsername.submitted')=env.t('fillAll') + .form-group + input.form-control(type='text', placeholder=env.t('username'), ng-model='localAuth.username', required) + .form-group + input.form-control(type='text', placeholder=env.t('email'), ng-model='localAuth.email', required) + .form-group + input.form-control(type='password', placeholder=env.t('password'), ng-model='localAuth.password', required) + .form-group + input.form-control(type='password', placeholder=env.t('confirmPass'), ng-model='localAuth.confirmPassword', required) + input.btn.btn-default(type='submit', ng-disabled='localAuth.$invalid', value=env.t('submit')) + + div(ng-if='user.auth.local.username') + p=env.t('username') + |: {{user.auth.local.username}} + p + small.muted + =env.t('loginNameDescription1') + |  + a(href='/#/options/profile/profile')=env.t('loginNameDescription2') + |  + =env.t('loginNameDescription3') + p=env.t('email') + |: {{user.auth.local.email}} + hr + + h5=env.t('changeUsername') + form(ng-submit='changeUser("username", usernameUpdates)', ng-init='usernameUpdates={}', ng-show='user.auth.local', name='changeUsername', novalidate) + //-.alert.alert-danger(ng-messages='changeUsername.$error && changeUsername.submitted')=env.t('fillAll') + .form-group + input.form-control(type='text', placeholder=env.t('newUsername'), ng-model='usernameUpdates.username', required) + .form-group + input.form-control(type='password', placeholder=env.t('password'), ng-model='usernameUpdates.password', required) + input.btn.btn-default(type='submit', ng-disabled='changeUsername.$invalid', value=env.t('submit')) + + h5=env.t('changeEmail') + form(ng-submit='changeUser("email", emailUpdates)', ng-show='user.auth.local', name='changeEmail', novalidate) + .form-group + input.form-control(type='text', placeholder=env.t('newEmail'), ng-model='emailUpdates.newEmail', required) + .form-group + input.form-control(type='password', placeholder=env.t('password'), ng-model='emailUpdates.password', required) + input.btn.btn-default(type='submit', ng-disabled='changeEmail.$invalid', value=env.t('submit')) + + h5=env.t('changePass') + form(ng-submit='changeUser("password", passwordUpdates)', ng-show='user.auth.local', name='changePassword', novalidate) + .form-group + input.form-control(type='password', placeholder=env.t('oldPass'), ng-model='passwordUpdates.password', required) + .form-group + input.form-control(type='password', placeholder=env.t('newPass'), ng-model='passwordUpdates.newPassword', required) + .form-group + input.form-control(type='password', placeholder=env.t('confirmPass'), ng-model='passwordUpdates.confirmPassword', required) + input.btn.btn-default(type='submit', ng-disabled='changePassword.$invalid', value=env.t('submit')) + + + .panel.panel-default + .panel-heading + span=env.t('dangerZone') + .panel-body + 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') diff --git a/website/views/options/social/group.jade b/website/views/options/social/group.jade index 7cac400daa..51fc476bb1 100644 --- a/website/views/options/social/group.jade +++ b/website/views/options/social/group.jade @@ -107,7 +107,7 @@ a.pull-right.gem-wallet(ng-if='group.type!="party"', popover-trigger='mouseenter table.table.table-striped(ng-show='::group.memberCount > 1 || group.type !== "party"' bindonce='group') tr(ng-repeat='member in group.members track by member._id') td.media - // allow leaders and administrators to ban members + // allow leaders and administrators to remove members .pull-left(ng-show='(isAbleToEditGroup(group) && member._id != user._id)') a.media-object(ng-click='removeMember(group, member, true)') span.glyphicon.glyphicon-ban-circle(tooltip=env.t('banTip')) @@ -130,7 +130,7 @@ a.pull-right.gem-wallet(ng-if='group.type!="party"', popover-trigger='mouseenter table.table.table-striped tr(ng-repeat='invite in group.invites') td.media - // allow leaders and administrators to ban members + // allow leaders and administrators to remove members .pull-left(ng-show='isAbleToEditGroup(group)') a.media-object(ng-click='removeMember(group, invite, false)') span.glyphicon.glyphicon-ban-circle(tooltip=env.t('banTip')) diff --git a/website/views/shared/modals/task-notes.jade b/website/views/shared/modals/task-notes.jade index fcad3da5c5..c68bb6b9fd 100644 --- a/website/views/shared/modals/task-notes.jade +++ b/website/views/shared/modals/task-notes.jade @@ -1,10 +1,10 @@ -script(type='text/ng-template', id='modals/task-notes.html') - .modal-header - h4 Task Notes - - .modal-body - textarea.form-control(ng-model="task.scoreNotes", row="10") - - .modal-footer - .btn.btn-default(ng-click='$close()')=env.t('cancel') - .btn.btn-primary(ng-click="$close(task)")=env.t('save') +script(type='text/ng-template', id='modals/task-notes.html') + .modal-header + h4 Task Notes + + .modal-body + textarea.form-control(ng-model="task.scoreNotes", row="10") + + .modal-footer + .btn.btn-default(ng-click='$close()')=env.t('cancel') + .btn.btn-primary(ng-click="$close(task)")=env.t('save') diff --git a/website/views/shared/modals/tasks-edit.jade b/website/views/shared/modals/tasks-edit.jade index 0ed820bb76..8459ee3c16 100644 --- a/website/views/shared/modals/tasks-edit.jade +++ b/website/views/shared/modals/tasks-edit.jade @@ -1,6 +1,6 @@ -script(type='text/ng-template', id='modals/task-edit.html') - .modal-content.task-modal(style='min-width:22em', class='{{taskStatus}}', id="task-{{task._id}}") - .modal-body.text-center(style='padding-bottom:0') - include ../tasks/edit/index - .modal-footer(style='margin-top:0') - .container-fluid +script(type='text/ng-template', id='modals/task-edit.html') + .modal-content.task-modal(style='min-width:22em', class='{{taskStatus}}', id="task-{{task._id}}") + .modal-body.text-center(style='padding-bottom:0') + include ../tasks/edit/index + .modal-footer(style='margin-top:0') + .container-fluid diff --git a/website/views/shared/tasks/task-list.jade b/website/views/shared/tasks/task-list.jade index c1a65a15dd..18a81f6bc0 100644 --- a/website/views/shared/tasks/task-list.jade +++ b/website/views/shared/tasks/task-list.jade @@ -1,20 +1,20 @@ -script(id='templates/task-list.html', type="text/ng-template") - ul(ng-init='setObj(obj)', class='{{::list.type}}s main-list', - ng-show='obj[list.type+"s"].length > 0', - ng-if='showNormalList(obj)') - task(hrpg-sort-tasks) - - div(ng-init='setObj(obj);') - div( - ng-repeat="(key, taskList) in groupedList[list.type]", - ng-if='showGroupedList(obj)') - h3 {{key}} - ul(class='{{::list.type}}s main-list', - ng-show='taskList.length > 0') - task(hrpg-sort-tasks) - - //Loads the non-sortable lists for challenges - ul(ng-init='setObj(obj)', class='{{::list.type}}s main-list', - ng-show='obj[list.type + "s"].length > 0', - ng-if='showChallengeList()') - task +script(id='templates/task-list.html', type="text/ng-template") + ul(ng-init='setObj(obj)', class='{{::list.type}}s main-list', + ng-show='obj[list.type+"s"].length > 0', + ng-if='showNormalList(obj)') + task(hrpg-sort-tasks) + + div(ng-init='setObj(obj);') + div( + ng-repeat="(key, taskList) in groupedList[list.type]", + ng-if='showGroupedList(obj)') + h3 {{key}} + ul(class='{{::list.type}}s main-list', + ng-show='taskList.length > 0') + task(hrpg-sort-tasks) + + //Loads the non-sortable lists for challenges + ul(ng-init='setObj(obj)', class='{{::list.type}}s main-list', + ng-show='obj[list.type + "s"].length > 0', + ng-if='showChallengeList()') + task