diff options
| author | Christian Weiske <cweiske@cweiske.de> | 2014-10-13 20:41:30 +0200 |
|---|---|---|
| committer | Christian Weiske <cweiske@cweiske.de> | 2014-10-13 20:41:30 +0200 |
| commit | ca442a803832c885af7835c5fcf7cd48cfe752ce (patch) | |
| tree | d58b2eb4e70223d56e981cd4c03cc8a331d67f40 /templates | |
| parent | dab31d3882a398d5f459a0aca71b2e35ab641708 (diff) | |
| download | grauphel-ca442a803832c885af7835c5fcf7cd48cfe752ce.tar.gz grauphel-ca442a803832c885af7835c5fcf7cd48cfe752ce.zip | |
Token deletion with simple undo
Following the lines of
- http://alistapart.com/article/neveruseawarning
- https://github.com/owncloud/core/issues/9268
- https://github.com/owncloud/contacts/issues/107
I've added simple undo functionality to the "delete token" action.
The user has 5 seconds to click on the "restore" button to undo the
token deletion.
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/tokens.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/templates/tokens.php b/templates/tokens.php index 9c1da6d..3aaabb7 100644 --- a/templates/tokens.php +++ b/templates/tokens.php @@ -3,6 +3,8 @@ <?php /** @var $l OC_L10N */ ?> <?php $_['appNavigation']->printPage(); ?> +<script type="text/javascript" src="<?php p(OCP\Util::linkTo('grauphel','js/grauphel.js')); ?>"></script> + <div id="app-content" class="list"> <h1>Manage access tokens</h1> <p> @@ -10,7 +12,7 @@ You can permanently revoke access by clicking the "delete" icon on the right side of each token row. </p> - <table class="table"> + <table class="table" id="grauphel-tokens"> <thead> <tr> <th>Token</th> @@ -20,14 +22,17 @@ </thead> <tbody> <?php foreach ($_['tokens'] as $token) { ?> - <tr> + <tr id="token-<?php p($token->tokenKey); ?>"> <td><?php p($token->tokenKey); ?></td> <td title="<?php p($token->client); ?>"><?php p($_['client']->getNiceName($token->client)); ?></td> <td> <?php p(\OCP\Util::formatDate($token->lastuse)); ?> <form method="POST" action="<?php p(OCP\Util::linkToRoute('grauphel.token.delete', array('username' => $_['username'], 'tokenKey' => $token->tokenKey))); ?>"> <input type="hidden" name="delete" value="1" /> - <button type="submit" class="icon-delete delete action" original-title="Delete"/> + <button type="submit" class="icon-delete delete action" + original-title="Delete" + data-token="token-<?php p($token->tokenKey); ?>" + /> </form> </td> </tr> |
