aboutsummaryrefslogtreecommitdiff
path: root/data/assets
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2016-05-22 00:50:55 -0400
committerPaul Duncan <pabs@pablotron.org>2016-05-22 00:50:55 -0400
commit2a2d6ed0b48276d8bfe82bbd1ad2c2f5e11290b6 (patch)
treeeaa65c26e5838c137058ace1edaa1b279050e65c /data/assets
parentf0230ea7716a7b9d9b7a35ebb4967a394d032887 (diff)
downloadguff-2a2d6ed0b48276d8bfe82bbd1ad2c2f5e11290b6.tar.bz2
guff-2a2d6ed0b48276d8bfe82bbd1ad2c2f5e11290b6.zip
add user-{add,edit}-dialog and assets/js/admin/users.js
Diffstat (limited to 'data/assets')
-rw-r--r--data/assets/js/admin/users.js (renamed from data/assets/test/tab-users.js)63
1 files changed, 3 insertions, 60 deletions
diff --git a/data/assets/test/tab-users.js b/data/assets/js/admin/users.js
index d60e348..a5eef0f 100644
--- a/data/assets/test/tab-users.js
+++ b/data/assets/js/admin/users.js
@@ -1,5 +1,6 @@
jQuery(function($) {
"use strict";
+
var TEMPLATES = new LuigiTemplate.Cache({
user: [
"<a ",
@@ -59,7 +60,7 @@ jQuery(function($) {
}
function reload() {
- var btn = $('#reload'),
+ var btn = $('#users-reload'),
list = $('#users');
// show loading
@@ -88,17 +89,6 @@ jQuery(function($) {
return false;
}
- // old test, not used any more
- function set_user(user_id) {
- return send('test/set_user', {
- user_id: user_id,
- }).fail(function(r) {
- alert('Error ' + r.responseText);
- }).done(function(r) {
- // do nothing
- });
- }
-
$('#users-q').on('search-update', function() {
filter();
});
@@ -230,54 +220,7 @@ jQuery(function($) {
return false;
});
- $('#login-dialog').on('show.bs.modal', function() {
- $('#login-email').val('');
- $('#login-password').val('');
- });
-
- $('#login-dialog').on('shown.bs.modal', function() {
- $('#login-email').focus();
- });
-
- $('#login-confirm').click(function() {
- var me = $(this);
-
- if (me.hasClass('disabled'))
- return false;
-
- // toggle loading
- me.toggleClass('disabled').find('.loading').toggleClass('hidden');
-
- send('test/login', {
- email: $('#login-email').val(),
- password: $('#login-password').val(),
- }).always(function() {
- // toggle loading
- me.toggleClass('disabled').find('.loading').toggleClass('hidden');
- }).fail(function(r) {
- alert('Error ' + r.responseText);
- }).done(function(r) {
- console.log(r);
- $('#login-dialog').modal('hide');
- });
-
- // stop event
- return false;
- });
-
- $('#login-user, #login-password').keydown(function(ev) {
- if (ev.which == 13) {
- setTimeout(function() {
- // trigger login
- $('#login-confirm').click();
- }, 10);
-
- // stop event
- return false;
- }
- });
-
- $('#reload').click(reload);
+ $('#users-reload').click(reload);
// load users
$('#admin-tab-users').on('show.bs.tab', function() {