From 9a7f508550d0eaf9100739054542e66fc525c5b0 Mon Sep 17 00:00:00 2001 From: fabrixxm Date: Fri, 20 Apr 2018 14:02:45 +0200 Subject: [PATCH 1/5] Admin users: Update page type names, add raw flags template context Change user table header "Account" to "Type": it use less space :-) --- mod/admin.php | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/mod/admin.php b/mod/admin.php index 74849ea9e..79a476d3a 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -1735,13 +1735,27 @@ function admin_page_users(App $a) $adminlist = explode(",", str_replace(" ", "", $a->config['admin_email'])); $_setup_users = function ($e) use ($adminlist) { - $accounts = [ - L10n::t('Normal Account'), - L10n::t('Automatic Follower Account'), - L10n::t('Public Forum Account'), - L10n::t('Automatic Friend Account') + $page_types = [ + PAGE_NORMAL => L10n::t('Normal Account Page'), + PAGE_SOAPBOX => L10n::t('Soapbox Page'), + PAGE_COMMUNITY => L10n::t('Public Forum'), + PAGE_FREELOVE => L10n::t('Automatic Friend Page'), + PAGE_PRVGROUP => L10n::t('Private Forum') ]; - $e['page-flags'] = $accounts[$e['page-flags']]; + $account_types = [ + ACCOUNT_TYPE_PERSON => L10n::t('Personal Page'), + ACCOUNT_TYPE_ORGANISATION => L10n::t('Organisation Page'), + ACCOUNT_TYPE_NEWS => L10n::t('News Page'), + ACCOUNT_TYPE_COMMUNITY => L10n::t('Community Forum') + ]; + + + + $e['page-flags-raw'] = $e['page-flags']; + $e['page-flags'] = $page_types[$e['page-flags']]; + $e['account-type-raw'] = $e['account-type']; + $e['account-type'] = $account_types[$e['account-type']]; + $e['register_date'] = Temporal::getRelativeDate($e['register_date']); $e['login_date'] = Temporal::getRelativeDate($e['login_date']); $e['lastitem_date'] = Temporal::getRelativeDate($e['lastitem_date']); @@ -1778,8 +1792,7 @@ function admin_page_users(App $a) array_push($users, array_pop($tmp_users)); } - $th_users = array_map(null, [L10n::t('Name'), L10n::t('Email'), L10n::t('Register date'), L10n::t('Last login'), L10n::t('Last item'), L10n::t('Account')], $valid_orders - ); + $th_users = array_map(null, [L10n::t('Name'), L10n::t('Email'), L10n::t('Register date'), L10n::t('Last login'), L10n::t('Last item'), L10n::t('Type')], $valid_orders); $t = get_markup_template('admin/users.tpl'); $o = replace_macros($t, [ From 516eb2b9eabb5f89cd9c9b569574daca323cba59 Mon Sep 17 00:00:00 2001 From: fabrixxm Date: Fri, 20 Apr 2018 14:07:11 +0200 Subject: [PATCH 2/5] Frio admin/users template: fix users avatars, table cols width to have more space --- view/theme/frio/css/mod_admin.css | 11 ++++++++++- view/theme/frio/templates/admin/users.tpl | 8 ++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/view/theme/frio/css/mod_admin.css b/view/theme/frio/css/mod_admin.css index 7a8c6f659..cbcd53453 100644 --- a/view/theme/frio/css/mod_admin.css +++ b/view/theme/frio/css/mod_admin.css @@ -1,7 +1,16 @@ #admin-users.adminpage { padding-left:0; padding-right: 0;} #admin-users.adminpage > h1 { padding: 0 15px; } -#users img.icon, #deleted img.icon { height: 24px; } + +#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 #deleted th:first-of-type { width: 40px; } + +#admin-users #users img.avatar-nano, #deleted img.avatar-nano { height: 24px; width: 24px; } .opened .caret { transform: rotate(180deg); } tr.details td, tr.details th diff --git a/view/theme/frio/templates/admin/users.tpl b/view/theme/frio/templates/admin/users.tpl index 831ee49b6..6e2051aca 100644 --- a/view/theme/frio/templates/admin/users.tpl +++ b/view/theme/frio/templates/admin/users.tpl @@ -55,7 +55,7 @@ -
+
@@ -84,7 +84,7 @@ {{foreach $th_users as $k=>$th}} {{if $k < 2 || $order_users == $th.1 || ($k==5 && !in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1])) }} - + {{if $order_users == $th.1}} {{if $order_direction_users == "+"}} @@ -112,7 +112,7 @@   {{/if}} - + {{$u.name}} {{$u.email}} {{if $order_users == $th_users.2.1}} @@ -227,7 +227,7 @@ {{foreach $deleted as $u}} - + {{$u.name}} {{$u.email}} {{$u.deleted}} From 23e5225b20dbf4936e936de0981e3a1ad6da0dd2 Mon Sep 17 00:00:00 2001 From: fabrixxm Date: Fri, 20 Apr 2018 14:11:34 +0200 Subject: [PATCH 3/5] Frio admn/users: use icons for page flags and account type in table to have more space --- view/theme/frio/templates/admin/users.tpl | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/view/theme/frio/templates/admin/users.tpl b/view/theme/frio/templates/admin/users.tpl index 6e2051aca..21ff3f4b5 100644 --- a/view/theme/frio/templates/admin/users.tpl +++ b/view/theme/frio/templates/admin/users.tpl @@ -128,7 +128,26 @@ {{/if}} {{if !in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1]) }} - {{$u.page_flags}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.account_expired}}({{$accountexpired}}){{/if}} + + + + {{if $u.page_flags_raw==0 && $u.account_type_raw > 0}} + + {{/if}} + {{if $u.is_admin}}{{/if}} + {{if $u.account_expired}}{{/if}} + {{/if}} From 12b7bce1cc80b34e68256da7c38668c840ee831d Mon Sep 17 00:00:00 2001 From: fabrixxm Date: Fri, 20 Apr 2018 14:27:36 +0200 Subject: [PATCH 4/5] admin users, don't set account-type if page flag isn't PAGE_NORMAL --- mod/admin.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mod/admin.php b/mod/admin.php index 79a476d3a..3debb57be 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -1753,8 +1753,9 @@ function admin_page_users(App $a) $e['page-flags-raw'] = $e['page-flags']; $e['page-flags'] = $page_types[$e['page-flags']]; - $e['account-type-raw'] = $e['account-type']; - $e['account-type'] = $account_types[$e['account-type']]; + + $e['account-type-raw'] = ($e['page_flags_raw']==0) ? $e['account-type'] : -1; + $e['account-type'] = ($e['page_flags_raw']==0) ? $account_types[$e['account-type']] : ""; $e['register_date'] = Temporal::getRelativeDate($e['register_date']); $e['login_date'] = Temporal::getRelativeDate($e['login_date']); From f97636193552ffeed8b531139d9fe632e4f8ae7d Mon Sep 17 00:00:00 2001 From: fabrixxm Date: Fri, 20 Apr 2018 14:30:04 +0200 Subject: [PATCH 5/5] Frio admin/users template: show account type in user details --- view/theme/frio/templates/admin/users.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/theme/frio/templates/admin/users.tpl b/view/theme/frio/templates/admin/users.tpl index 21ff3f4b5..784d46b20 100644 --- a/view/theme/frio/templates/admin/users.tpl +++ b/view/theme/frio/templates/admin/users.tpl @@ -173,7 +173,7 @@ {{if in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1]) }}

- ↕ {{$th_users.5.0}} : {{$u.page_flags}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.account_expired}}({{$accountexpired}}){{/if}}

+ ↕ {{$th_users.5.0}} : {{$u.page_flags}}{{if $u.page_flags_raw==0 && $u.account_type_raw > 0}}, {{$u.account_type}}{{/if}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.account_expired}}({{$accountexpired}}){{/if}}

{{/if}}