Permalink
Comparing changes
Open a pull request
- 1 commit
- 3 files changed
- 0 commit comments
- 1 contributor
Unified
Split
Showing
with
37 additions
and 16 deletions.
- +1 −0 AUTHORS
- +11 −11 h/js/directives.coffee
- +25 −5 h/templates/accountmanagement.html
| @@ -7,3 +7,4 @@ Jehan Tremback <jehan@hypothes.is> | ||
| Randall Leeds <tilgovi@hypothes.is> | ||
| Kristof Csillag <csillag@hypothes.is> | ||
| Gergely Ujvari <ujvari@hypothes.is> | ||
| Jake Hartnell <jakehartnell@hypothes.is> | ||
| @@ -512,18 +512,18 @@ accountManagement = -> | ||
| # Checks to see if email is duplicate. | ||
| return | ||
| controller: ($scope, $rootScope, $filter, $element) -> | ||
| $scope.deleteAccount = -> | ||
| r = window.confirm "Are you sure you want to delete your account? Deleting an account is irreversible. | ||
| If you have contributed to public conversations that others have replied to we will not delete your | ||
| individual annotations. If you want to delete your annotations, you must do so before deleting your | ||
| account, and you must delete each annotation individually, by hand. Deleting an annotation does not | ||
| delete replies to that annotation, it creates a blank stub that replies are still attached to." | ||
| if r | ||
| return | ||
| $scope.confirmDelete = false | ||
| $scope.toggleConfirmDelete = -> | ||
| $scope.confirmDelete = !$scope.confirmDelete | ||
| $scope.deleteAcount = (form) -> | ||
| # If the password is correct, the account is deleted. | ||
| # The extension is then removed from the page. | ||
| # Confirmation of success is given. | ||
| alert("Account deleted.") | ||
| $scope.submit = (form) -> | ||
| console.log form | ||
| # Handles submitting of the form. | ||
| # Handles submitting of the form. | ||
| # Jake's Note: there is an addional piece of UI I would like to implement. The basic idea being | ||
| # to give some visual indication that the changes they have made have been applied successfully. | ||
| @@ -549,7 +549,7 @@ accountProfile = -> | ||
| name : "Jake Hartnell" | ||
| password : "password" | ||
| location : "Berkeley, CA" | ||
| bio : "Science Fiction Writer currently working as a Product designer and frontend engineer at Hypothes.is." | ||
| bio : "A short bio..." | ||
| website : "http://jakehartnell.com" | ||
| gravatar : "" | ||
| restrict: 'C' | ||
| @@ -1,6 +1,5 @@ | ||
| <!-- Account --> | ||
| <form name="edit_profile" | ||
| ng-show="activePanel.name == 'Account'" | ||
| ng-show="activePanel.name == 'Account' && !confirmDelete" | ||
| novalidate> | ||
| <h2>Change Email</h2> | ||
| @@ -36,7 +35,7 @@ <h2>Change Email</h2> | ||
| </form> | ||
| <form name="changepassword" | ||
| ng-show="activePanel.name == 'Account'" | ||
| ng-show="activePanel.name == 'Account' && !confirmDelete" | ||
| novalidate> | ||
| <h2>Change Password</h2> | ||
| @@ -68,6 +67,27 @@ <h2>Change Password</h2> | ||
| </span> | ||
| <button class="btn check-icon" ng-click="submit(changepassword)" ng-disabled="!changepassword.$valid">Save</button> | ||
| <a class="pull-right" href="" ng-click="deleteAccount()">Delete account</a> | ||
| </form> | ||
| <!-- / Account --> | ||
| <form name="deleteaccount" | ||
| ng-show="activePanel.name == 'Account'" | ||
| novalidate> | ||
| <h2>Delete Account</h2> | ||
| <button class="btn" ng-click="toggleConfirmDelete()" ng-hide="confirmDelete">Delete account</button> | ||
| <div ng-show="confirmDelete"> | ||
| <p>Deleting an account is irreversible. If you have contributed to public conversations that others have replied to we will not delete your individual annotations.</p> | ||
| <p><em>If you want to delete your annotations, you must do so before deleting your account</em>, and you must delete each annotation individually, by hand. Deleting an annotation does not delete replies to that annotation, it creates a blank stub that replies are still attached to.</p> | ||
| <p>Are you sure you want to delete your account? Please enter your password to confirm:</p> | ||
| <input class="fullwidth" type="password" name="password" ng-model="model.password" placeholder="Password" required autocapitalize="false" > | ||
| <span slow-validate="password"> | ||
| <span ng-show="deleteaccount.password.$error.minlength" | ||
| >Your password does not match the one we have on record.</span> | ||
| </span> | ||
| <br /> | ||
| <button class="btn" ng-click="deleteAccount()" ng-disabled="!deleteaccount.$valid">Delete account</button> | ||
| <button class="btn" ng-click="toggleConfirmDelete()">Cancel</button> | ||
| </div> | ||
| </form> | ||