mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-14 07:52:15 +00:00
add delete account functionality (*sigh*, y'all asked for it)
This commit is contained in:
parent
7a7c96ca57
commit
368748b67a
2 changed files with 16 additions and 0 deletions
|
|
@ -92,6 +92,10 @@ module.exports.app = (appExports, model) ->
|
|||
appExports.toggleHeader = (e, el) ->
|
||||
user.set 'preferences.hideHeader', !user.get('preferences.hideHeader')
|
||||
|
||||
appExports.deleteAccount = (e, el) ->
|
||||
model.del "users.#{user.get('id')}", ->
|
||||
window.location.href = "/logout"
|
||||
|
||||
user.on 'set', 'flags.customizationsNotification', (captures, args) ->
|
||||
return unless captures == true
|
||||
$('.main-avatar').popover('destroy') #remove previous popovers
|
||||
|
|
|
|||
|
|
@ -28,8 +28,10 @@
|
|||
{{/}}
|
||||
|
||||
<hr/>
|
||||
<h4>Danger Zone</h4>
|
||||
<a class='btn btn-danger' data-target="#reset-modal" data-toggle="modal" rel=tooltip title="Resets your entire account (dangerous).">Reset</a>
|
||||
<a class='btn btn-danger' data-target="#restore-modal" data-toggle="modal" rel=tooltip title="Restores attributes to your character.">Restore</a>
|
||||
<a class='btn btn-danger' data-target="#delete-modal" data-toggle="modal" rel=tooltip title="Delete your account.">Delete</a>
|
||||
</div>
|
||||
<div class="tab-pane" id="settings-api">
|
||||
<small>Copy these for use in third party applications.</small>
|
||||
|
|
@ -104,6 +106,16 @@
|
|||
</@footer>
|
||||
</app:modals:modal>
|
||||
|
||||
<app:modals:modal modalId="delete-modal" header="Delete Account">
|
||||
<p>Woa woa woa! Are you sure? This will seriously delete your account forever, and it can never be restored. (Seriously, I don't know why people want this feature - but it was highly requested, so here it is).</p>
|
||||
<p>If you're absolutely certain, type <strong>DELETE</strong> into the text-box below.</p>
|
||||
<p><input type="text" value="{_deleteAccount}" /></p>
|
||||
<@footer>
|
||||
<button class="btn btn-large" data-dismiss="modal" aria-hidden="true">Cancel</button>
|
||||
<button data-dismiss="modal" x-bind="click:deleteAccount" class="btn btn-danger btn-small {#unless equal(_deleteAccount,'DELETE')}disabled{/}">Delete Account</button>
|
||||
</@footer>
|
||||
</app:modals:modal>
|
||||
|
||||
{{else}}
|
||||
<app:modals:modal modalId="login-modal" header="Login / Register">
|
||||
<a href="/auth/facebook"><img src='/img/facebook-login-register.jpeg' alt="Login / Register With Facebook"/></a>
|
||||
|
|
|
|||
Loading…
Reference in a new issue