From 5a82ee04bc685e91997a16c5cd73346171ffb6ec Mon Sep 17 00:00:00 2001 From: rabuzarus Date: Sun, 22 Apr 2018 20:23:24 +0200 Subject: [PATCH] frio - some work on the admin users template to be more consistant with other setting pages --- view/theme/frio/css/mod_admin.css | 5 +- view/theme/frio/css/style.css | 19 +- view/theme/frio/js/mod_admin.js | 28 +- .../frio/templates/admin/contactblock.tpl | 32 +- view/theme/frio/templates/admin/users.tpl | 568 ++++++++++-------- 5 files changed, 376 insertions(+), 276 deletions(-) diff --git a/view/theme/frio/css/mod_admin.css b/view/theme/frio/css/mod_admin.css index cbcd53453..5199d5a55 100644 --- a/view/theme/frio/css/mod_admin.css +++ b/view/theme/frio/css/mod_admin.css @@ -1,12 +1,13 @@ -#admin-users.adminpage { padding-left:0; padding-right: 0;} #admin-users.adminpage > h1 { padding: 0 15px; } - +#admin-users.adminpage .panel-collapse { margin-left: -15px; margin-right: -15px; } #admin-users td { word-break: break-all; } #admin-users #users th:first-of-type { width: 1em; } #admin-users #users th:nth-of-type(2) { width: 40px; } #admin-users #users th:last-of-type { width: 1em; } +#admin-users td > .checkbox { margin: 0; } +#admin-users .admin-settings-footer-elements { padding-left: 8px; padding-right: 8px; } #admin-users #deleted th:first-of-type { width: 40px; } diff --git a/view/theme/frio/css/style.css b/view/theme/frio/css/style.css index 35c577b5a..1614547b8 100644 --- a/view/theme/frio/css/style.css +++ b/view/theme/frio/css/style.css @@ -2654,7 +2654,8 @@ ul li:hover .contact-wrapper .contact-action-link:hover { margin-left: -15px; margin-right: -15px; } -.panel-group-settings > .panel { +.panel-group-settings > .panel, +.panel-group-settings > form > .panel { padding-left: 15px; padding-right: 15px; } @@ -2939,6 +2940,22 @@ section.help-content-wrapper li { #adminpage .plugin .desc { padding-left: 10px; } +.adminpage .admin-settings-action-link, +.adminpage .admin-settings-action-link:hover { + color: #555; +} +.adminpage .admin-settings-action-link:hover { + opacity: 1; +} +.adminpage .admin-settings-action-link { + opacity: 0.8; +} +#admin-users tr.blocked { + background-color: #f8efc0; +} +.adminpage .table-hover > tbody > tr:hover + tr.details { + background-color: #f5f5f5; +} /* Register Page*/ #register-openid-wrapper, #register-name-wrapper, #register-invite-wrapper, #profile-publish-wrapper { diff --git a/view/theme/frio/js/mod_admin.js b/view/theme/frio/js/mod_admin.js index dc8abe054..188b48098 100644 --- a/view/theme/frio/js/mod_admin.js +++ b/view/theme/frio/js/mod_admin.js @@ -9,7 +9,9 @@ $(function() { selectnone($(this).data('selectNone')); }); - $('body').on('change', 'input[type=checkbox].select', function() { + // Toggle checkbox status to all or none for all checkboxes of a specific + // css class. + $('body').on('change', 'input[type=checkbox].selecttoggle', function() { $this = $(this); if ($this.prop('checked')) { selectall($this.data('selectClass')); @@ -20,6 +22,26 @@ $(function() { } }); + // Use AJAX calls to reorder the table (so we don't need to reload the page). + $('body').on('click', '.table-order', function(e) { + e.preventDefault(); + + // Get the parent table element. + var table = $(this).parents('table'); + var orderUrl = this.getAttribute("data-order-url"); + table.fadeTo("fast", 0.33); + + $("body").css("cursor", "wait"); + + $.get(orderUrl, function(data) { + // Find the table element in the html we got. + var result = $(data).find('#' + table[0].id); + // And add the new table html to the parent. + $(table).parent().html(result); + + $("body").css("cursor", "auto"); + }); + }); function selectall(cls) { $('.' + cls).prop('checked', true); @@ -39,7 +61,7 @@ function confirm_delete(msg, uname){ } function details(uid) { - $("#user-"+uid+"-detail").toggleClass("hidden"); - $("#user-"+uid).toggleClass("opened"); + $("#user-" + uid + "-detail").toggleClass("hidden"); + $("#user-" + uid).toggleClass("opened"); return false; } diff --git a/view/theme/frio/templates/admin/contactblock.tpl b/view/theme/frio/templates/admin/contactblock.tpl index f330854bc..9c3f9165b 100644 --- a/view/theme/frio/templates/admin/contactblock.tpl +++ b/view/theme/frio/templates/admin/contactblock.tpl @@ -3,35 +3,35 @@

{{$title}} - {{$page}}

{{$description}}

- +

{{$h_contacts}}

- {{if $contacts}} + {{if $contacts}} - - {{foreach $th_contacts as $th}} - + + {{foreach $th_contacts as $th}} + {{/foreach}} {{foreach $contacts as $contact}} - - - - - - + + + + + + {{/foreach}} - + @@ -40,9 +40,9 @@
- {{$th}} - + {{$th}} +
{{$contact.nickname}}{{$contact.name}}{{$contact.url}}
{{$contact.nickname}}{{$contact.name}}{{$contact.url}}
{{$total_contacts}}
{{$paginate}} - {{else}} + {{else}}

{{$no_data|escape:'html'}}

- {{/if}} + {{/if}}

{{$h_newblock}}

diff --git a/view/theme/frio/templates/admin/users.tpl b/view/theme/frio/templates/admin/users.tpl index 784d46b20..4d4d2a31e 100644 --- a/view/theme/frio/templates/admin/users.tpl +++ b/view/theme/frio/templates/admin/users.tpl @@ -7,279 +7,339 @@
+ {{* We organize the settings in collapsable panel-groups *}} +
- -
-

{{$h_pending}}

+ +
+ - {{if $pending}} - - - - - {{foreach $th_pending as $th}}{{/foreach}} - - - - - {{foreach $pending as $u}} - - - - - - - - - - - - - {{/foreach}} - -
{{$th}}
{{$u.created}}{{$u.name}}{{$u.email}} - - -
{{$pendingnotetext}}{{$u.note}}
-