From c4678c37a27c4af5d05b8363d19f49bb5f16c67d Mon Sep 17 00:00:00 2001 From: plegall Date: Sat, 9 Jan 2016 17:55:44 +0100 Subject: feature #397, edit user in a popin --- admin/themes/default/template/user_list.tpl | 67 ++++++++++++++++++----------- 1 file changed, 41 insertions(+), 26 deletions(-) diff --git a/admin/themes/default/template/user_list.tpl b/admin/themes/default/template/user_list.tpl index 39e3318b9..87966fd69 100644 --- a/admin/themes/default/template/user_list.tpl +++ b/admin/themes/default/template/user_list.tpl @@ -1,3 +1,4 @@ +{include file='include/colorbox.inc.tpl'} {combine_script id='common' load='footer' path='admin/themes/default/js/common.js'} {combine_script id='jquery.dataTables' load='footer' path='themes/default/js/plugins/jquery.dataTables.js'} @@ -274,7 +275,7 @@ jQuery(document).ready(function() { jQuery("script.userDetails").html() ); - jQuery("#user"+userId).append(template(user)); + jQuery("#user"+userId).html(template(user)); /* groups select */ jQuery('[data-selectize=groups]').selectize({ @@ -339,10 +340,19 @@ jQuery(document).ready(function() { console.log('technical error loading user details'); } }); - - return '
'; + + jQuery(".user_form_popin") + .attr("id", "user"+userId) + .html('
{/literal}{'Loading...'|translate|escape:'javascript'}{literal}
') + ; } +jQuery(document).on('click', '.close-user-details', function(e) { + jQuery('.user_form_popin').colorbox.close(); + e.preventDefault(); +}); + + /* change password */ jQuery(document).on('click', '.changePasswordOpen', function() { var userId = jQuery(this).parentsUntil('form').parent().find('input[name=user_id]').val(); @@ -537,28 +547,14 @@ jQuery(document).ready(function() { */ jQuery(document).on('click', '#userList tbody td .openUserDetails', function() { var nTr = this.parentNode.parentNode; - if (jQuery(this).hasClass('icon-cancel-circled')) { - /* This row is already open - close it */ - jQuery(this) - .removeClass('icon-cancel-circled') - .addClass('icon-pencil') - .attr('title', "{/literal}{'Open user details'|translate|escape:'javascript'}{literal}") - .html("{/literal}{'edit'|translate|escape:'javascript'}{literal}") - ; - - oTable.fnClose( nTr ); - } - else { - /* Open this row */ - jQuery(this) - .removeClass('icon-pencil') - .addClass('icon-cancel-circled') - .attr('title', "{/literal}{'Close user details'|translate|escape:'javascript'}{literal}") - .html("{/literal}{'close'|translate|escape:'javascript'}{literal}") - ; - - oTable.fnOpen( nTr, fnFormatDetails(oTable, nTr), 'details' ); - } + + jQuery.colorbox({ + inline:true, + title:"{/literal}{'Edit user'|translate}{literal}", + href:".user_form_popin" + }); + + fnFormatDetails(oTable, nTr); }); @@ -841,6 +837,20 @@ span.infos, span.errors {background-image:none; padding:2px 5px; margin:0;border .recent_period_infos {margin-left:10px;} .nb_image_page, .recent_period {width:340px;margin-top:5px;} #action_recent_period .recent_period {display:inline-block;} + +.user_form_popin { + width:750px; + height:430px; + padding:10px; +} + +.userProperties form { + text-align:left; +} + +.popinWait { + padding-top:200px; +} {/literal}{/html_style}
@@ -1153,7 +1163,12 @@ span.infos, span.errors {background-image:none; padding:2px 5px; margin:0;border - + + {'close'|translate} + +
+
+
\ No newline at end of file -- cgit v1.2.3 From 041065a8247b3300e091bb811fe715a21f0c8524 Mon Sep 17 00:00:00 2001 From: plegall Date: Sat, 9 Jan 2016 18:01:18 +0100 Subject: feature #398, update user list when user is modified --- admin/themes/default/template/user_list.tpl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/admin/themes/default/template/user_list.tpl b/admin/themes/default/template/user_list.tpl index 87966fd69..c781a39ee 100644 --- a/admin/themes/default/template/user_list.tpl +++ b/admin/themes/default/template/user_list.tpl @@ -551,7 +551,10 @@ jQuery(document).on('click', '.close-user-details', function(e) { jQuery.colorbox({ inline:true, title:"{/literal}{'Edit user'|translate}{literal}", - href:".user_form_popin" + href:".user_form_popin", + onClosed: function() { + oTable.fnDraw(); + } }); fnFormatDetails(oTable, nTr); -- cgit v1.2.3 From d78caf8603e37f9e15be961c99039a078179c437 Mon Sep 17 00:00:00 2001 From: plegall Date: Sat, 9 Jan 2016 18:28:26 +0100 Subject: move new CSS rules to theme.css instead of {html_style} --- admin/themes/default/template/user_list.tpl | 14 -------------- admin/themes/default/theme.css | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/admin/themes/default/template/user_list.tpl b/admin/themes/default/template/user_list.tpl index c781a39ee..1f4b09f25 100644 --- a/admin/themes/default/template/user_list.tpl +++ b/admin/themes/default/template/user_list.tpl @@ -840,20 +840,6 @@ span.infos, span.errors {background-image:none; padding:2px 5px; margin:0;border .recent_period_infos {margin-left:10px;} .nb_image_page, .recent_period {width:340px;margin-top:5px;} #action_recent_period .recent_period {display:inline-block;} - -.user_form_popin { - width:750px; - height:430px; - padding:10px; -} - -.userProperties form { - text-align:left; -} - -.popinWait { - padding-top:200px; -} {/literal}{/html_style}
diff --git a/admin/themes/default/theme.css b/admin/themes/default/theme.css index 509aff377..2b8471b85 100644 --- a/admin/themes/default/theme.css +++ b/admin/themes/default/theme.css @@ -1228,6 +1228,21 @@ a.group_perm { .userProperty {width:340px;float:left;margin-bottom:15px;} .userActions {float:right;text-align:right;} +.user_form_popin { + width:750px; + height:430px; + padding:10px; +} + +.userProperties form { + text-align:left; +} + +.popinWait { + padding-top:200px; +} + + .preview-box.icon-zoom-in { display:block; position:relative; -- cgit v1.2.3 From 71c30f46c80e8b230708938ac3dc0cb062c83482 Mon Sep 17 00:00:00 2001 From: plegall Date: Sat, 9 Jan 2016 18:37:07 +0100 Subject: feature #397, bigger padding inside popin --- admin/themes/default/theme.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/themes/default/theme.css b/admin/themes/default/theme.css index 2b8471b85..0aa0dba1a 100644 --- a/admin/themes/default/theme.css +++ b/admin/themes/default/theme.css @@ -1231,7 +1231,7 @@ a.group_perm { .user_form_popin { width:750px; height:430px; - padding:10px; + padding:20px; } .userProperties form { -- cgit v1.2.3 From a3f80046b63f3a397087b6f0534bdc386a642875 Mon Sep 17 00:00:00 2001 From: plegall Date: Sat, 9 Jan 2016 18:47:50 +0100 Subject: feature #397, close popin when user deleted --- admin/themes/default/template/user_list.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/themes/default/template/user_list.tpl b/admin/themes/default/template/user_list.tpl index 1f4b09f25..6744f6f69 100644 --- a/admin/themes/default/template/user_list.tpl +++ b/admin/themes/default/template/user_list.tpl @@ -484,7 +484,7 @@ jQuery(document).on('click', '.close-user-details', function(e) { jQuery('#user'+userId+' .userDelete .loading').show(); }, success:function(data) { - oTable.fnDraw(); + jQuery('.user_form_popin').colorbox.close(); jQuery('#showAddUser .infos').html('✔ User '+username+' deleted').show(); }, error:function(XMLHttpRequest, textStatus, errorThrows) { -- cgit v1.2.3 From ac8c2bf47037f82da06263d4408ce8ebfe3d5ecb Mon Sep 17 00:00:00 2001 From: plegall Date: Sat, 9 Jan 2016 18:53:38 +0100 Subject: feature #397, l10n --- language/en_UK/admin.lang.php | 1 + language/fr_FR/admin.lang.php | 1 + 2 files changed, 2 insertions(+) diff --git a/language/en_UK/admin.lang.php b/language/en_UK/admin.lang.php index 272d2bf63..3a55c1a1f 100644 --- a/language/en_UK/admin.lang.php +++ b/language/en_UK/admin.lang.php @@ -984,3 +984,4 @@ $lang['width & height'] = 'width & height'; $lang['Upload in progress'] = 'Upload in progress'; $lang['Orphans'] = 'Orphans'; $lang['Delete %d orphan photos'] = 'Delete %d orphan photos'; +$lang['Edit user'] = 'Edit user'; \ No newline at end of file diff --git a/language/fr_FR/admin.lang.php b/language/fr_FR/admin.lang.php index 7bd93f439..fe242f0f9 100644 --- a/language/fr_FR/admin.lang.php +++ b/language/fr_FR/admin.lang.php @@ -985,3 +985,4 @@ $lang['No and unlock sub-albums'] = 'Non, et déverrouiller les sous-albums'; $lang['Upload in progress'] = 'Transfert en cours...'; $lang['Orphans'] = 'Orphelines'; $lang['Delete %d orphan photos'] = 'Supprimer les %d photos orphelines'; +$lang['Edit user'] = 'Éditer l\'utilisateur'; -- cgit v1.2.3