From 5ce404f517c9de6e4b7a1e2564b5c4857c14c8f2 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 31 Mar 2020 21:38:56 -0400 Subject: [PATCH 1/8] Refactor user settings page - Fix header hierarchy - [frio] Fix panel display - Move checkbox sub-template calls to template --- mod/settings.php | 105 ++----- view/templates/settings/settings.tpl | 282 +++++++++--------- view/theme/frio/css/style.css | 6 + .../frio/templates/settings/settings.tpl | 277 ++++++++--------- 4 files changed, 289 insertions(+), 381 deletions(-) diff --git a/mod/settings.php b/mod/settings.php index 3832de1b1..c4e248293 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -823,44 +823,11 @@ function settings_content(App $a) ]); } + $net_pub_desc = ''; if (strlen(DI::config()->get('system', 'directory'))) { $net_pub_desc = ' ' . DI::l10n()->t('Your profile will also be published in the global friendica directories (e.g. %s).', DI::config()->get('system', 'directory'), DI::config()->get('system', 'directory')); - } else { - $net_pub_desc = ''; } - $profile_in_net_dir = Renderer::replaceMacros($opt_tpl, [ - '$field' => ['profile_in_netdirectory', DI::l10n()->t('Allow your profile to be searchable globally?'), $profile['net-publish'], DI::l10n()->t("Activate this setting if you want others to easily find and follow you. Your profile will be searchable on remote systems. This setting also determines whether Friendica will inform search engines that your profile should be indexed or not.") . $net_pub_desc] - ]); - - $hide_friends = Renderer::replaceMacros($opt_tpl, [ - '$field' => ['hide-friends', DI::l10n()->t('Hide your contact/friend list from viewers of your profile?'), $profile['hide-friends'], DI::l10n()->t('A list of your contacts is displayed on your profile page. Activate this option to disable the display of your contact list.')], - ]); - - $hide_wall = Renderer::replaceMacros($opt_tpl, [ - '$field' => ['hidewall', DI::l10n()->t('Hide your profile details from anonymous viewers?'), $a->user['hidewall'], DI::l10n()->t('Anonymous visitors will only see your profile picture, your display name and the nickname you are using on your profile page. Your public posts and replies will still be accessible by other means.')], - ]); - - $unlisted = Renderer::replaceMacros($opt_tpl, [ - '$field' => ['unlisted', DI::l10n()->t('Make public posts unlisted'), DI::pConfig()->get(local_user(), 'system', 'unlisted'), DI::l10n()->t('Your public posts will not appear on the community pages or in search results, nor be sent to relay servers. However they can still appear on public feeds on remote servers.')], - ]); - - $accessiblephotos = Renderer::replaceMacros($opt_tpl, [ - '$field' => ['accessible-photos', DI::l10n()->t('Make all posted pictures accessible'), DI::pConfig()->get(local_user(), 'system', 'accessible-photos'), DI::l10n()->t("This option makes every posted picture accessible via the direct link. This is a workaround for the problem that most other networks can't handle permissions on pictures. Non public pictures still won't be visible for the public on your photo albums though.")], - ]); - - $blockwall = Renderer::replaceMacros($opt_tpl, [ - '$field' => ['blockwall', DI::l10n()->t('Allow friends to post to your profile page?'), (intval($a->user['blockwall']) ? '0' : '1'), DI::l10n()->t('Your contacts may write posts on your profile wall. These posts will be distributed to your contacts')], - ]); - - $blocktags = Renderer::replaceMacros($opt_tpl, [ - '$field' => ['blocktags', DI::l10n()->t('Allow friends to tag your posts?'), (intval($a->user['blocktags']) ? '0' : '1'), DI::l10n()->t('Your contacts can add additional tags to your posts.')], - ]); - - $unkmail = Renderer::replaceMacros($opt_tpl, [ - '$field' => ['unkmail', DI::l10n()->t('Permit unknown people to send you private mail?'), $unkmail, DI::l10n()->t('Friendica network users may send you private messages even if they are not in your contact list.')], - ]); - $tpl_addr = Renderer::getMarkupTemplate('settings/nick_set.tpl'); $prof_addr = Renderer::replaceMacros($tpl_addr,[ @@ -870,18 +837,6 @@ function settings_content(App $a) $stpl = Renderer::getMarkupTemplate('settings/settings.tpl'); - $expire_arr = [ - 'days' => ['expire', DI::l10n()->t("Automatically expire posts after this many days:"), $expire, DI::l10n()->t('If empty, posts will not expire. Expired posts will be deleted')], - 'label' => DI::l10n()->t('Expiration settings'), - 'items' => ['expire_items', DI::l10n()->t('Expire posts'), $expire_items, DI::l10n()->t('When activated, posts and comments will be expired.')], - 'notes' => ['expire_notes', DI::l10n()->t('Expire personal notes'), $expire_notes, DI::l10n()->t('When activated, the personal notes on your profile page will be expired.')], - 'starred' => ['expire_starred', DI::l10n()->t('Expire starred posts'), $expire_starred, DI::l10n()->t('Starring posts keeps them from being expired. That behaviour is overwritten by this setting.')], - 'photos' => ['expire_photos', DI::l10n()->t('Expire photos'), $expire_photos, DI::l10n()->t('When activated, photos will be expired.')], - 'network_only' => ['expire_network_only', DI::l10n()->t('Only expire posts by others'), $expire_network_only, DI::l10n()->t('When activated, your own posts never expire. Then the settings above are only valid for posts you received.')], - ]; - - $group_select = Group::displayGroupSelection(local_user(), $a->user['def_gid']); - // Private/public post links for the non-JS ACL form $private_post = 1; if (!empty($_REQUEST['public']) && !$_REQUEST['public']) { @@ -932,40 +887,32 @@ function settings_content(App $a) '$defloc' => ['defloc', DI::l10n()->t('Default Post Location:'), $defloc, ''], '$allowloc' => ['allow_location', DI::l10n()->t('Use Browser Location:'), ($a->user['allow_location'] == 1), ''], + '$h_prv' => DI::l10n()->t('Security and Privacy Settings'), + '$visibility' => $profile['net-publish'], + '$maxreq' => ['maxreq', DI::l10n()->t('Maximum Friend Requests/Day:'), $maxreq , DI::l10n()->t("\x28to prevent spam abuse\x29")], + '$profile_in_dir' => $profile_in_dir, + '$profile_in_net_dir' => ['profile_in_netdirectory', DI::l10n()->t('Allow your profile to be searchable globally?'), $profile['net-publish'], DI::l10n()->t("Activate this setting if you want others to easily find and follow you. Your profile will be searchable on remote systems. This setting also determines whether Friendica will inform search engines that your profile should be indexed or not.") . $net_pub_desc], + '$hide_friends' => ['hide-friends', DI::l10n()->t('Hide your contact/friend list from viewers of your profile?'), $profile['hide-friends'], DI::l10n()->t('A list of your contacts is displayed on your profile page. Activate this option to disable the display of your contact list.')], + '$hide_wall' => ['hidewall', DI::l10n()->t('Hide your profile details from anonymous viewers?'), $a->user['hidewall'], DI::l10n()->t('Anonymous visitors will only see your profile picture, your display name and the nickname you are using on your profile page. Your public posts and replies will still be accessible by other means.')], + '$unlisted' => ['unlisted', DI::l10n()->t('Make public posts unlisted'), DI::pConfig()->get(local_user(), 'system', 'unlisted'), DI::l10n()->t('Your public posts will not appear on the community pages or in search results, nor be sent to relay servers. However they can still appear on public feeds on remote servers.')], + '$accessiblephotos' => ['accessible-photos', DI::l10n()->t('Make all posted pictures accessible'), DI::pConfig()->get(local_user(), 'system', 'accessible-photos'), DI::l10n()->t("This option makes every posted picture accessible via the direct link. This is a workaround for the problem that most other networks can't handle permissions on pictures. Non public pictures still won't be visible for the public on your photo albums though.")], + '$blockwall' => ['blockwall', DI::l10n()->t('Allow friends to post to your profile page?'), (intval($a->user['blockwall']) ? '0' : '1'), DI::l10n()->t('Your contacts may write posts on your profile wall. These posts will be distributed to your contacts')], // array('blockwall', DI::l10n()->t('Allow friends to post to your profile page:'), !$blockwall, ''), + '$blocktags' => ['blocktags', DI::l10n()->t('Allow friends to tag your posts?'), (intval($a->user['blocktags']) ? '0' : '1'), DI::l10n()->t('Your contacts can add additional tags to your posts.')], // array('blocktags', DI::l10n()->t('Allow friends to tag your posts:'), !$blocktags, ''), + '$unkmail' => ['unkmail', DI::l10n()->t('Permit unknown people to send you private mail?'), $unkmail, DI::l10n()->t('Friendica network users may send you private messages even if they are not in your contact list.')], + '$cntunkmail' => ['cntunkmail', DI::l10n()->t('Maximum private messages per day from unknown people:'), $cntunkmail , DI::l10n()->t("\x28to prevent spam abuse\x29")], + '$group_select' => Group::displayGroupSelection(local_user(), $a->user['def_gid']), + '$permissions' => DI::l10n()->t('Default Post Permissions'), + '$aclselect' => ACL::getFullSelectorHTML(DI::page(), $a->user), - '$h_prv' => DI::l10n()->t('Security and Privacy Settings'), - - '$maxreq' => ['maxreq', DI::l10n()->t('Maximum Friend Requests/Day:'), $maxreq , DI::l10n()->t("\x28to prevent spam abuse\x29")], - '$permissions' => DI::l10n()->t('Default Post Permissions'), - '$visibility' => $profile['net-publish'], - '$aclselect' => ACL::getFullSelectorHTML(DI::page(), $a->user), - '$blockwall'=> $blockwall, // array('blockwall', DI::l10n()->t('Allow friends to post to your profile page:'), !$blockwall, ''), - '$blocktags'=> $blocktags, // array('blocktags', DI::l10n()->t('Allow friends to tag your posts:'), !$blocktags, ''), - - // ACL permissions box - '$group_perms' => DI::l10n()->t('Show to Groups'), - '$contact_perms' => DI::l10n()->t('Show to Contacts'), - '$private' => DI::l10n()->t('Default Private Post'), - '$public' => DI::l10n()->t('Default Public Post'), - '$is_private' => $private_post, - '$return_path' => $query_str, - '$public_link' => $public_post_link, - '$settings_perms' => DI::l10n()->t('Default Permissions for New Posts'), - - '$group_select' => $group_select, - - - '$expire' => $expire_arr, - - '$profile_in_dir' => $profile_in_dir, - '$profile_in_net_dir' => $profile_in_net_dir, - '$hide_friends' => $hide_friends, - '$hide_wall' => $hide_wall, - '$unlisted' => $unlisted, - '$accessiblephotos' => $accessiblephotos, - '$unkmail' => $unkmail, - '$cntunkmail' => ['cntunkmail', DI::l10n()->t('Maximum private messages per day from unknown people:'), $cntunkmail , DI::l10n()->t("\x28to prevent spam abuse\x29")], - + '$expire' => [ + 'label' => DI::l10n()->t('Expiration settings'), + 'days' => ['expire', DI::l10n()->t("Automatically expire posts after this many days:"), $expire, DI::l10n()->t('If empty, posts will not expire. Expired posts will be deleted')], + 'items' => ['expire_items', DI::l10n()->t('Expire posts'), $expire_items, DI::l10n()->t('When activated, posts and comments will be expired.')], + 'notes' => ['expire_notes', DI::l10n()->t('Expire personal notes'), $expire_notes, DI::l10n()->t('When activated, the personal notes on your profile page will be expired.')], + 'starred' => ['expire_starred', DI::l10n()->t('Expire starred posts'), $expire_starred, DI::l10n()->t('Starring posts keeps them from being expired. That behaviour is overwritten by this setting.')], + 'photos' => ['expire_photos', DI::l10n()->t('Expire photos'), $expire_photos, DI::l10n()->t('When activated, photos will be expired.')], + 'network_only' => ['expire_network_only', DI::l10n()->t('Only expire posts by others'), $expire_network_only, DI::l10n()->t('When activated, your own posts never expire. Then the settings above are only valid for posts you received.')], + ], '$h_not' => DI::l10n()->t('Notification Settings'), '$lbl_not' => DI::l10n()->t('Send a notification email when:'), diff --git a/view/templates/settings/settings.tpl b/view/templates/settings/settings.tpl index fe83ebf0c..bd0fa5f20 100644 --- a/view/templates/settings/settings.tpl +++ b/view/templates/settings/settings.tpl @@ -2,183 +2,173 @@ {{$nickname_block nofilter}} -
- + + -

{{$h_pass}}

-
-{{include file="field_password.tpl" field=$password1}} -{{include file="field_password.tpl" field=$password2}} -{{include file="field_password.tpl" field=$password3}} +

{{$h_pass}}

+
+ {{include file="field_password.tpl" field=$password1}} + {{include file="field_password.tpl" field=$password2}} + {{include file="field_password.tpl" field=$password3}} -{{if $oid_enable}} -{{include file="field_input.tpl" field=$openid}} -{{/if}} + {{if $oid_enable}} + {{include file="field_input.tpl" field=$openid}} + {{/if}} -
- -
-
+
+ +
+
-

{{$h_basic}}

-
+

{{$h_basic}}

+
-{{include file="field_input.tpl" field=$username}} -{{include file="field_input.tpl" field=$email}} -{{include file="field_password.tpl" field=$password4}} -{{include file="field_custom.tpl" field=$timezone}} -{{include file="field_select.tpl" field=$language}} -{{include file="field_input.tpl" field=$defloc}} -{{include file="field_checkbox.tpl" field=$allowloc}} + {{include file="field_input.tpl" field=$username}} + {{include file="field_input.tpl" field=$email}} + {{include file="field_password.tpl" field=$password4}} + {{include file="field_custom.tpl" field=$timezone}} + {{include file="field_select.tpl" field=$language}} + {{include file="field_input.tpl" field=$defloc}} + {{include file="field_checkbox.tpl" field=$allowloc}} -
- -
-
+
+ +
+
+

{{$h_prv}}

+
-

{{$h_prv}}

-
+ - + {{include file="field_input.tpl" field=$maxreq}} -{{include file="field_input.tpl" field=$maxreq}} + {{$profile_in_dir nofilter}} -{{$profile_in_dir nofilter}} + {{include file="field_checkbox.tpl" field=$profile_in_net_dir}} + {{include file="field_checkbox.tpl" field=$hide_friends}} + {{include file="field_checkbox.tpl" field=$hide_wall}} + {{include file="field_checkbox.tpl" field=$unlisted}} + {{include file="field_checkbox.tpl" field=$accessiblephotos}} + {{include file="field_checkbox.tpl" field=$blockwall}} + {{include file="field_checkbox.tpl" field=$blocktags}} + {{include file="field_checkbox.tpl" field=$unkmail}} + {{include file="field_input.tpl" field=$cntunkmail}} -{{$profile_in_net_dir nofilter}} + {{$group_select nofilter}} -{{$hide_friends nofilter}} +

{{$permissions}}

-{{$hide_wall nofilter}} + {{$aclselect nofilter}} +
+ +
+
-{{$unlisted nofilter}} +

{{$expire.label}}

+
+
+ {{include file="field_input.tpl" field=$expire.days}} + {{include file="field_checkbox.tpl" field=$expire.items}} + {{include file="field_checkbox.tpl" field=$expire.notes}} + {{include file="field_checkbox.tpl" field=$expire.starred}} + {{include file="field_checkbox.tpl" field=$expire.network_only}} -{{$accessiblephotos nofilter}} +
+ +
+
+
-{{$blockwall nofilter}} +

{{$h_not}}

+
+
-{{$blocktags nofilter}} +
{{$lbl_not}}
-{{$unkmail nofilter}} +
+ {{include file="field_intcheckbox.tpl" field=$notify1}} + {{include file="field_intcheckbox.tpl" field=$notify2}} + {{include file="field_intcheckbox.tpl" field=$notify3}} + {{include file="field_intcheckbox.tpl" field=$notify4}} + {{include file="field_intcheckbox.tpl" field=$notify5}} + {{include file="field_intcheckbox.tpl" field=$notify6}} + {{include file="field_intcheckbox.tpl" field=$notify7}} + {{include file="field_intcheckbox.tpl" field=$notify8}} +
-{{include file="field_input.tpl" field=$cntunkmail}} + {{include file="field_checkbox.tpl" field=$email_textonly}} + {{include file="field_checkbox.tpl" field=$detailed_notif}} -{{$group_select nofilter}} + {{include file="field_checkbox.tpl" field=$desktop_notifications}} + -

{{$expire.label}}

-
-
-{{include file="field_input.tpl" field=$expire.days}} -{{include file="field_checkbox.tpl" field=$expire.items}} -{{include file="field_checkbox.tpl" field=$expire.notes}} -{{include file="field_checkbox.tpl" field=$expire.starred}} -{{include file="field_checkbox.tpl" field=$expire.network_only}} +
-
- -
-
-
+
+ +
+
-

{{$h_not}}

-
-
+

{{$h_advn}}

+
+
{{$h_descadvn}}
-
{{$lbl_not}}
+ {{$pagetype nofilter}} -
-{{include file="field_intcheckbox.tpl" field=$notify1}} -{{include file="field_intcheckbox.tpl" field=$notify2}} -{{include file="field_intcheckbox.tpl" field=$notify3}} -{{include file="field_intcheckbox.tpl" field=$notify4}} -{{include file="field_intcheckbox.tpl" field=$notify5}} -{{include file="field_intcheckbox.tpl" field=$notify6}} -{{include file="field_intcheckbox.tpl" field=$notify7}} -{{include file="field_intcheckbox.tpl" field=$notify8}} -
+
+ +
+
-{{include file="field_checkbox.tpl" field=$email_textonly}} -{{include file="field_checkbox.tpl" field=$detailed_notif}} +

{{$importcontact}}

+
+ +
{{$importcontact_text}}
+ -{{include file="field_checkbox.tpl" field=$desktop_notifications}} - - -
- -
- -
-
- -

{{$h_advn}}

-
-
{{$h_descadvn}}
- -{{$pagetype nofilter}} - -
- -
-
- -

{{$importcontact}}

-
- -
{{$importcontact_text}}
- - -
- -
-
- -

{{$relocate}}

-
-
{{$relocate_text}}
- -
- -
-
+
+ +
+
diff --git a/view/theme/frio/css/style.css b/view/theme/frio/css/style.css index 5ace932ea..d0a4c39e4 100644 --- a/view/theme/frio/css/style.css +++ b/view/theme/frio/css/style.css @@ -2904,6 +2904,12 @@ details.profile-jot-net[open] summary:before { font-size: 18px; } +.section-subtitle-wrapper > h2 { + font-size: 18px; + margin-top: 10px; + margin-bottom: 10px; +} + .fakelink > h3:before { padding-right: 10px; } diff --git a/view/theme/frio/templates/settings/settings.tpl b/view/theme/frio/templates/settings/settings.tpl index 40c1d85dd..626d3b4d0 100644 --- a/view/theme/frio/templates/settings/settings.tpl +++ b/view/theme/frio/templates/settings/settings.tpl @@ -1,54 +1,50 @@
- {{* include the title template for the settings title *}} - {{include file="section_title.tpl" title=$ptitle }} +

{{$ptitle}}

{{$nickname_block nofilter}} - + {{* We organize the settings in collapsable panel-groups *}}
{{* The password setting section *}}
-
-
+
{{include file="field_password.tpl" field=$password1}} {{include file="field_password.tpl" field=$password2}} {{include file="field_password.tpl" field=$password3}} - {{if $oid_enable}} + {{if $oid_enable}} {{include file="field_input.tpl" field=$openid}} {{include file="field_checkbox.tpl" field=$delete_openid}} - {{/if}} - -
- -
-
+ {{/if}} +
+
{{* The basic setting section *}}
-
-
- +
{{include file="field_input.tpl" field=$username}} {{include file="field_input.tpl" field=$email}} {{include file="field_password.tpl" field=$password4}} @@ -56,26 +52,24 @@ {{include file="field_select.tpl" field=$language}} {{include file="field_input.tpl" field=$defloc}} {{include file="field_checkbox.tpl" field=$allowloc}} - -
- -
-
+
+
{{* The privacity setting section *}}
-
-
+
@@ -83,212 +77,183 @@ {{$profile_in_dir nofilter}} - {{$profile_in_net_dir nofilter}} - - {{$hide_friends nofilter}} - - {{$hide_wall nofilter}} - - {{$unlisted nofilter}} - - {{$accessiblephotos nofilter}} - - {{$blockwall nofilter}} - - {{$blocktags nofilter}} - - {{$unkmail nofilter}} - + {{include file="field_checkbox.tpl" field=$profile_in_net_dir}} + {{include file="field_checkbox.tpl" field=$hide_friends}} + {{include file="field_checkbox.tpl" field=$hide_wall}} + {{include file="field_checkbox.tpl" field=$unlisted}} + {{include file="field_checkbox.tpl" field=$accessiblephotos}} + {{include file="field_checkbox.tpl" field=$blockwall}} + {{include file="field_checkbox.tpl" field=$blocktags}} + {{include file="field_checkbox.tpl" field=$unkmail}} {{include file="field_input.tpl" field=$cntunkmail}} {{$group_select nofilter}} -

{{$permissions}}

+

{{$permissions}}

{{$aclselect nofilter}} - -
- -
-
- +
+
-
-
- +
{{include file="field_input.tpl" field=$expire.days}} {{include file="field_checkbox.tpl" field=$expire.items}} {{include file="field_checkbox.tpl" field=$expire.notes}} {{include file="field_checkbox.tpl" field=$expire.starred}} {{include file="field_checkbox.tpl" field=$expire.network_only}} - -
- -
-
+
+
{{* The notification setting section *}}
-
-
-
+
-

{{$lbl_not}}

+
{{$lbl_not}}
-
- {{include file="field_intcheckbox.tpl" field=$notify1}} - {{include file="field_intcheckbox.tpl" field=$notify2}} - {{include file="field_intcheckbox.tpl" field=$notify3}} - {{include file="field_intcheckbox.tpl" field=$notify4}} - {{include file="field_intcheckbox.tpl" field=$notify5}} - {{include file="field_intcheckbox.tpl" field=$notify6}} - {{include file="field_intcheckbox.tpl" field=$notify7}} - {{include file="field_intcheckbox.tpl" field=$notify8}} -
- - {{include file="field_checkbox.tpl" field=$email_textonly}} - {{include file="field_checkbox.tpl" field=$detailed_notif}} - - {{* commented out because it was commented out in the original template -
- - {{$desktop_notifications_note}} -
- *}} - - {{include file="field_checkbox.tpl" field=$desktop_notifications}} - +
+ {{include file="field_intcheckbox.tpl" field=$notify1}} + {{include file="field_intcheckbox.tpl" field=$notify2}} + {{include file="field_intcheckbox.tpl" field=$notify3}} + {{include file="field_intcheckbox.tpl" field=$notify4}} + {{include file="field_intcheckbox.tpl" field=$notify5}} + {{include file="field_intcheckbox.tpl" field=$notify6}} + {{include file="field_intcheckbox.tpl" field=$notify7}} + {{include file="field_intcheckbox.tpl" field=$notify8}}
-
- + {{include file="field_checkbox.tpl" field=$email_textonly}} + {{include file="field_checkbox.tpl" field=$detailed_notif}} + + {{* commented out because it was commented out in the original template +
+ + {{$desktop_notifications_note}}
-
+ *}} + + {{include file="field_checkbox.tpl" field=$desktop_notifications}} + +
+
{{* The additional account setting section *}}
-
-
- +
{{$h_descadvn}}
{{$pagetype nofilter}} - -
- -
-
+
+
{{* Import contacts CSV *}}
-
-
- +
{{$importcontact_text}}
- -
-
- -
-
+
+
{{* The relocate setting section *}}
-
-
- +
{{$relocate_text}}
- -
-
- -
-
+
+
From fd8957260693e5ea9071aa6d1773db9f7c5b9f61 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 1 Apr 2020 17:22:46 -0400 Subject: [PATCH 2/8] Refactor admin site settings templates - Fix header hierarchy in admin/site.tpl - Fix panel display in frio/templates/admin/site.tpl --- src/Module/Admin/Site.php | 2 +- view/templates/admin/site.tpl | 242 ++++++++--------- view/theme/frio/templates/admin/site.tpl | 329 ++++++++++++----------- 3 files changed, 291 insertions(+), 282 deletions(-) diff --git a/src/Module/Admin/Site.php b/src/Module/Admin/Site.php index 501edaf4d..cf3fee31b 100644 --- a/src/Module/Admin/Site.php +++ b/src/Module/Admin/Site.php @@ -613,7 +613,7 @@ class Site extends BaseAdmin '$worker_title' => DI::l10n()->t('Worker'), '$relay_title' => DI::l10n()->t('Message Relay'), '$relocate' => DI::l10n()->t('Relocate Instance'), - '$relocate_warning' => DI::l10n()->t('Warning! Advanced function. Could make this server unreachable.'), + '$relocate_warning' => DI::l10n()->t('Warning! Advanced function. Could make this server unreachable.'), '$baseurl' => DI::baseUrl()->get(true), // name, label, value, help string, extra data... diff --git a/view/templates/admin/site.tpl b/view/templates/admin/site.tpl index b6d0c5930..cb948aabe 100644 --- a/view/templates/admin/site.tpl +++ b/view/templates/admin/site.tpl @@ -1,6 +1,6 @@ -
+

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

- - - -
+
+ + +
-
- {{include file="field_input.tpl" field=$sitename}} - {{include file="field_input.tpl" field=$sender_email}} - {{include file="field_textarea.tpl" field=$banner}} - {{include file="field_input.tpl" field=$shortcut_icon}} - {{include file="field_input.tpl" field=$touch_icon}} - {{include file="field_textarea.tpl" field=$additional_info}} - {{include file="field_select.tpl" field=$language}} - {{include file="field_select.tpl" field=$theme}} - {{include file="field_select.tpl" field=$theme_mobile}} - {{include file="field_select.tpl" field=$ssl_policy}} - {{if $ssl_policy.2 == 1}}{{include file="field_checkbox.tpl" field=$force_ssl}}{{/if}} - {{include file="field_checkbox.tpl" field=$hide_help}} - {{include file="field_select.tpl" field=$singleuser}} +
+ {{include file="field_input.tpl" field=$sitename}} + {{include file="field_input.tpl" field=$sender_email}} + {{include file="field_textarea.tpl" field=$banner}} + {{include file="field_input.tpl" field=$shortcut_icon}} + {{include file="field_input.tpl" field=$touch_icon}} + {{include file="field_textarea.tpl" field=$additional_info}} + {{include file="field_select.tpl" field=$language}} + {{include file="field_select.tpl" field=$theme}} + {{include file="field_select.tpl" field=$theme_mobile}} + {{include file="field_select.tpl" field=$ssl_policy}} + {{if $ssl_policy.2 == 1}}{{include file="field_checkbox.tpl" field=$force_ssl}}{{/if}} + {{include file="field_checkbox.tpl" field=$hide_help}} + {{include file="field_select.tpl" field=$singleuser}} +
@@ -63,21 +64,22 @@ * Registration */ -->
-
- - {{include file="field_input.tpl" field=$register_text}} - {{include file="field_select.tpl" field=$register_policy}} - {{include file="field_input.tpl" field=$daily_registrations}} - {{include file="field_checkbox.tpl" field=$no_multi_reg}} - {{include file="field_checkbox.tpl" field=$no_openid}} - {{include file="field_checkbox.tpl" field=$no_regfullname}} +
+ {{include file="field_input.tpl" field=$register_text}} + {{include file="field_select.tpl" field=$register_policy}} + {{include file="field_input.tpl" field=$daily_registrations}} + {{include file="field_checkbox.tpl" field=$no_multi_reg}} + {{include file="field_checkbox.tpl" field=$no_openid}} + {{include file="field_checkbox.tpl" field=$no_regfullname}} +
@@ -91,22 +93,24 @@ * File upload */ -->
-
- {{include file="field_select.tpl" field=$storagebackend}} - {{foreach from=$storageform item=$field}} - {{include file=$field.field field=$field}} - {{/foreach}} -
- {{include file="field_input.tpl" field=$maximagesize}} - {{include file="field_input.tpl" field=$maximagelength}} - {{include file="field_input.tpl" field=$jpegimagequality}} +
+ {{include file="field_select.tpl" field=$storagebackend}} + {{foreach from=$storageform item=$field}} + {{include file=$field.field field=$field}} + {{/foreach}} +
+ {{include file="field_input.tpl" field=$maximagesize}} + {{include file="field_input.tpl" field=$maximagelength}} + {{include file="field_input.tpl" field=$jpegimagequality}} +
@@ -119,46 +123,47 @@ * Corporate */ -->
-
- {{include file="field_input.tpl" field=$allowed_sites}} - {{include file="field_input.tpl" field=$allowed_email}} - {{include file="field_input.tpl" field=$forbidden_nicknames}} - {{include file="field_checkbox.tpl" field=$no_oembed_rich_content}} - {{include file="field_input.tpl" field=$allowed_oembed}} - {{include file="field_checkbox.tpl" field=$block_public}} - {{include file="field_checkbox.tpl" field=$force_publish}} - {{include file="field_select.tpl" field=$community_page_style}} - {{include file="field_input.tpl" field=$max_author_posts_community_page}} +
+ {{include file="field_input.tpl" field=$allowed_sites}} + {{include file="field_input.tpl" field=$allowed_email}} + {{include file="field_input.tpl" field=$forbidden_nicknames}} + {{include file="field_checkbox.tpl" field=$no_oembed_rich_content}} + {{include file="field_input.tpl" field=$allowed_oembed}} + {{include file="field_checkbox.tpl" field=$block_public}} + {{include file="field_checkbox.tpl" field=$force_publish}} + {{include file="field_select.tpl" field=$community_page_style}} + {{include file="field_input.tpl" field=$max_author_posts_community_page}} - {{include file="field_checkbox.tpl" field=$ostatus_disabled}} + {{include file="field_checkbox.tpl" field=$ostatus_disabled}} - {{if $diaspora_able}} - {{include file="field_checkbox.tpl" field=$diaspora_enabled}} - {{else}} -
- - {{$diaspora_not_able}} + {{if $diaspora_able}} + {{include file="field_checkbox.tpl" field=$diaspora_enabled}} + {{else}} +
+ + {{$diaspora_not_able}} +
+ {{/if}} + {{include file="field_checkbox.tpl" field=$dfrn_only}} + {{include file="field_input.tpl" field=$global_directory}} +

+ +

+ {{include file="field_checkbox.tpl" field=$newuser_private}} + {{include file="field_checkbox.tpl" field=$enotify_no_content}} + {{include file="field_checkbox.tpl" field=$private_addons}} + {{include file="field_checkbox.tpl" field=$disable_embedded}} + {{include file="field_checkbox.tpl" field=$allow_users_remote_self}} + {{include file="field_checkbox.tpl" field=$explicit_content}}
- {{/if}} - {{include file="field_checkbox.tpl" field=$dfrn_only}} - {{include file="field_input.tpl" field=$global_directory}} - - {{include file="field_checkbox.tpl" field=$newuser_private}} - {{include file="field_checkbox.tpl" field=$enotify_no_content}} - {{include file="field_checkbox.tpl" field=$private_addons}} - {{include file="field_checkbox.tpl" field=$disable_embedded}} - {{include file="field_checkbox.tpl" field=$allow_users_remote_self}} - {{include file="field_checkbox.tpl" field=$explicit_content}} - @@ -170,28 +175,29 @@ * Corporate */ -->
-
- - {{include file="field_select.tpl" field=$rino}} - {{include file="field_checkbox.tpl" field=$verifyssl}} - {{include file="field_input.tpl" field=$proxy}} - {{include file="field_input.tpl" field=$proxyuser}} - {{include file="field_input.tpl" field=$timeout}} - {{include file="field_input.tpl" field=$maxloadavg_frontend}} - {{include file="field_input.tpl" field=$optimize_max_tablesize}} - {{include file="field_input.tpl" field=$optimize_fragmentation}} - {{include file="field_input.tpl" field=$abandon_days}} - {{include file="field_input.tpl" field=$temppath}} - {{include file="field_checkbox.tpl" field=$suppress_tags}} - {{include file="field_checkbox.tpl" field=$nodeinfo}} - {{include file="field_select.tpl" field=$check_new_version_url}} +
+ {{include file="field_select.tpl" field=$rino}} + {{include file="field_checkbox.tpl" field=$verifyssl}} + {{include file="field_input.tpl" field=$proxy}} + {{include file="field_input.tpl" field=$proxyuser}} + {{include file="field_input.tpl" field=$timeout}} + {{include file="field_input.tpl" field=$maxloadavg_frontend}} + {{include file="field_input.tpl" field=$optimize_max_tablesize}} + {{include file="field_input.tpl" field=$optimize_fragmentation}} + {{include file="field_input.tpl" field=$abandon_days}} + {{include file="field_input.tpl" field=$temppath}} + {{include file="field_checkbox.tpl" field=$suppress_tags}} + {{include file="field_checkbox.tpl" field=$nodeinfo}} + {{include file="field_select.tpl" field=$check_new_version_url}} +
@@ -203,21 +209,22 @@ * Contact Directory */ -->
-
- - {{include file="field_checkbox.tpl" field=$poco_completion}} - {{include file="field_select.tpl" field=$gcontact_discovery}} - {{include file="field_input.tpl" field=$poco_requery_days}} - {{include file="field_select.tpl" field=$poco_discovery}} - {{include file="field_select.tpl" field=$poco_discovery_since}} - {{include file="field_checkbox.tpl" field=$poco_local_search}} +
+ {{include file="field_checkbox.tpl" field=$poco_completion}} + {{include file="field_select.tpl" field=$gcontact_discovery}} + {{include file="field_input.tpl" field=$poco_requery_days}} + {{include file="field_select.tpl" field=$poco_discovery}} + {{include file="field_select.tpl" field=$poco_discovery_since}} + {{include file="field_checkbox.tpl" field=$poco_local_search}} +
@@ -229,24 +236,25 @@ * Performance */ -->
-
- - {{include file="field_checkbox.tpl" field=$only_tag_search}} - {{include file="field_input.tpl" field=$itemcache}} - {{include file="field_input.tpl" field=$itemcache_duration}} - {{include file="field_input.tpl" field=$max_comments}} - {{include file="field_checkbox.tpl" field=$proxy_disabled}} - {{include file="field_checkbox.tpl" field=$dbclean}} - {{include file="field_input.tpl" field=$dbclean_expire_days}} - {{include file="field_input.tpl" field=$dbclean_unclaimed}} - {{include file="field_input.tpl" field=$dbclean_expire_conv}} +
+ {{include file="field_checkbox.tpl" field=$only_tag_search}} + {{include file="field_input.tpl" field=$itemcache}} + {{include file="field_input.tpl" field=$itemcache_duration}} + {{include file="field_input.tpl" field=$max_comments}} + {{include file="field_checkbox.tpl" field=$proxy_disabled}} + {{include file="field_checkbox.tpl" field=$dbclean}} + {{include file="field_input.tpl" field=$dbclean_expire_days}} + {{include file="field_input.tpl" field=$dbclean_unclaimed}} + {{include file="field_input.tpl" field=$dbclean_expire_conv}} +
@@ -258,21 +266,22 @@ * Worker */ -->
-
- - {{include file="field_input.tpl" field=$maxloadavg}} - {{include file="field_input.tpl" field=$min_memory}} - {{include file="field_input.tpl" field=$worker_queues}} - {{include file="field_checkbox.tpl" field=$worker_dont_fork}} - {{include file="field_checkbox.tpl" field=$worker_fastlane}} - {{include file="field_checkbox.tpl" field=$worker_frontend}} +
+ {{include file="field_input.tpl" field=$maxloadavg}} + {{include file="field_input.tpl" field=$min_memory}} + {{include file="field_input.tpl" field=$worker_queues}} + {{include file="field_checkbox.tpl" field=$worker_dont_fork}} + {{include file="field_checkbox.tpl" field=$worker_fastlane}} + {{include file="field_checkbox.tpl" field=$worker_frontend}} +
@@ -284,55 +293,55 @@ * Relay */ -->
-
- - {{include file="field_checkbox.tpl" field=$relay_subscribe}} - {{include file="field_input.tpl" field=$relay_server}} - {{include file="field_checkbox.tpl" field=$relay_directly}} - {{include file="field_select.tpl" field=$relay_scope}} - {{include file="field_input.tpl" field=$relay_server_tags}} - {{include file="field_checkbox.tpl" field=$relay_user_tags}} +
+ {{include file="field_checkbox.tpl" field=$relay_subscribe}} + {{include file="field_input.tpl" field=$relay_server}} + {{include file="field_checkbox.tpl" field=$relay_directly}} + {{include file="field_select.tpl" field=$relay_scope}} + {{include file="field_input.tpl" field=$relay_server_tags}} + {{include file="field_checkbox.tpl" field=$relay_user_tags}} +
- + - -
- -
-
- × - {{$relocate_warning}} + +
+ + + + - {{* separate form for relocate... *}} - - - {{include file="field_input.tpl" field=$relocate_url}} - - +
+
+
+ {{$relocate_warning}} +
+ {{include file="field_input.tpl" field=$relocate_url}} +
- -
+
+
From 6bb210ff7a016674d9428af959207451214170d8 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 1 Apr 2020 18:27:14 -0400 Subject: [PATCH 3/8] Refactor features pages - Create frio template for admin features page - Fix header hierarchy --- src/Module/Admin/Features.php | 18 +++++----- view/templates/admin/features.tpl | 7 ++-- view/templates/settings/features.tpl | 28 +++++++-------- view/theme/frio/css/style.css | 2 +- view/theme/frio/templates/admin/features.tpl | 34 +++++++++++++++++++ .../frio/templates/settings/features.tpl | 23 +++++-------- 6 files changed, 68 insertions(+), 44 deletions(-) create mode 100644 view/theme/frio/templates/admin/features.tpl diff --git a/src/Module/Admin/Features.php b/src/Module/Admin/Features.php index 46c0a1384..a97bc0e7b 100644 --- a/src/Module/Admin/Features.php +++ b/src/Module/Admin/Features.php @@ -64,15 +64,14 @@ class Features extends BaseAdmin { parent::content($parameters); - $arr = []; - $features = Feature::get(false); + $features = []; - foreach ($features as $fname => $fdata) { - $arr[$fname] = []; - $arr[$fname][0] = $fdata[0]; + foreach (Feature::get(false) as $fname => $fdata) { + $features[$fname] = []; + $features[$fname][0] = $fdata[0]; foreach (array_slice($fdata, 1) as $f) { $set = DI::config()->get('feature', $f[0], $f[3]); - $arr[$fname][1][] = [ + $features[$fname][1][] = [ ['feature_' . $f[0], $f[1], $set, $f[2]], ['featurelock_' . $f[0], DI::l10n()->t('Lock feature %s', $f[1]), $f[4], ''] ]; @@ -82,9 +81,10 @@ class Features extends BaseAdmin $tpl = Renderer::getMarkupTemplate('admin/features.tpl'); $o = Renderer::replaceMacros($tpl, [ '$form_security_token' => parent::getFormSecurityToken("admin_manage_features"), - '$title' => DI::l10n()->t('Manage Additional Features'), - '$features' => $arr, - '$submit' => DI::l10n()->t('Save Settings'), + '$baseurl' => DI::baseUrl()->get(true), + '$title' => DI::l10n()->t('Manage Additional Features'), + '$features' => $features, + '$submit' => DI::l10n()->t('Save Settings'), ]); return $o; diff --git a/view/templates/admin/features.tpl b/view/templates/admin/features.tpl index b1c8bad8f..46a7abea2 100644 --- a/view/templates/admin/features.tpl +++ b/view/templates/admin/features.tpl @@ -1,12 +1,11 @@ -

{{$title}}

-
- + + {{foreach $features as $g => $f}} -

{{$f.0}}

+

{{$f.0}}

{{foreach $f.1 as $fcat}} diff --git a/view/templates/settings/features.tpl b/view/templates/settings/features.tpl index c69670b48..e96daea2b 100644 --- a/view/templates/settings/features.tpl +++ b/view/templates/settings/features.tpl @@ -1,22 +1,18 @@ -

{{$title}}

- - + -{{foreach $features as $f}} -

{{$f.0}}

-
- -{{foreach $f.1 as $fcat}} - {{include file="field_checkbox.tpl" field=$fcat}} -{{/foreach}} -
- -
-
-{{/foreach}} + {{foreach $features as $f}} +

{{$f.0}}

+
+ {{foreach $f.1 as $fcat}} + {{include file="field_checkbox.tpl" field=$fcat}} + {{/foreach}} +
+ +
+
+ {{/foreach}} - diff --git a/view/theme/frio/css/style.css b/view/theme/frio/css/style.css index d0a4c39e4..f5d9a1971 100644 --- a/view/theme/frio/css/style.css +++ b/view/theme/frio/css/style.css @@ -2875,7 +2875,7 @@ details.profile-jot-net[open] summary:before { /* Emulates Bootstrap display */ .settings-block { - margin: 0 -15px 5px; + margin: 0 0 5px; color: #333; background-color: rgba(255,255,255,0.95); border-radius: 4px; diff --git a/view/theme/frio/templates/admin/features.tpl b/view/theme/frio/templates/admin/features.tpl new file mode 100644 index 000000000..13db0a300 --- /dev/null +++ b/view/theme/frio/templates/admin/features.tpl @@ -0,0 +1,34 @@ +
+

{{$title}}

+
+ + {{* We organize the settings in collapsable panel-groups *}} +
+ {{foreach $features as $g => $f}} +
+ +
+
+ {{foreach $f.1 as $fcat}} +
+ {{include file="field_checkbox.tpl" field=$fcat.0}} + {{include file="field_checkbox.tpl" field=$fcat.1}} +
+ {{/foreach}} +
+ +
+
+ {{/foreach}} +
+ +
+
diff --git a/view/theme/frio/templates/settings/features.tpl b/view/theme/frio/templates/settings/features.tpl index 1db5fd966..61fecf57f 100644 --- a/view/theme/frio/templates/settings/features.tpl +++ b/view/theme/frio/templates/settings/features.tpl @@ -1,31 +1,26 @@
- {{* include the title template for the settings title *}} - {{include file="section_title.tpl" title=$title }} - - +

{{$title}}

- + {{* We organize the settings in collapsable panel-groups *}}
{{foreach $features as $g => $f}}
-
-
+
{{foreach $f.1 as $fcat}} {{include file="field_checkbox.tpl" field=$fcat}} {{/foreach}} - -
- -
-
+
+
From b480e4eaa97f8708957dbe0eec771bda7a2a376d Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 1 Apr 2020 18:39:40 -0400 Subject: [PATCH 4/8] Refactor display page - Fix header hierarchy - Fix panel display --- view/templates/settings/display.tpl | 49 +++++++------ .../theme/frio/templates/settings/display.tpl | 71 ++++++++----------- 2 files changed, 54 insertions(+), 66 deletions(-) diff --git a/view/templates/settings/display.tpl b/view/templates/settings/display.tpl index a9f82c16b..15247d874 100644 --- a/view/templates/settings/display.tpl +++ b/view/templates/settings/display.tpl @@ -1,35 +1,34 @@ -

{{$ptitle}}

- - + + -{{include file="field_themeselect.tpl" field=$theme}} -{{include file="field_input.tpl" field=$itemspage_network}} + {{include file="field_themeselect.tpl" field=$theme}} + {{include file="field_input.tpl" field=$itemspage_network}} -{{* Show the mobile theme selection only if mobile themes are available *}} -{{if count($mobile_theme.4) > 1}} -{{include file="field_themeselect.tpl" field=$mobile_theme}} -{{/if}} + {{* Show the mobile theme selection only if mobile themes are available *}} + {{if count($mobile_theme.4) > 1}} + {{include file="field_themeselect.tpl" field=$mobile_theme}} + {{/if}} -{{include file="field_input.tpl" field=$itemspage_mobile_network}} -{{include file="field_input.tpl" field=$ajaxint}} -{{include file="field_checkbox.tpl" field=$no_auto_update}} -{{include file="field_checkbox.tpl" field=$nosmile}} -{{include file="field_checkbox.tpl" field=$infinite_scroll}} -{{include file="field_checkbox.tpl" field=$no_smart_threading}} -{{include file="field_checkbox.tpl" field=$hide_dislike}} + {{include file="field_input.tpl" field=$itemspage_mobile_network}} + {{include file="field_input.tpl" field=$ajaxint}} + {{include file="field_checkbox.tpl" field=$no_auto_update}} + {{include file="field_checkbox.tpl" field=$nosmile}} + {{include file="field_checkbox.tpl" field=$infinite_scroll}} + {{include file="field_checkbox.tpl" field=$no_smart_threading}} + {{include file="field_checkbox.tpl" field=$hide_dislike}} -

{{$calendar_title}}

-{{include file="field_select.tpl" field=$first_day_of_week}} +

{{$calendar_title}}

+ {{include file="field_select.tpl" field=$first_day_of_week}} -
- -
+
+ +
-{{if $theme_config}} -

{{$stitle}}

-{{$theme_config nofilter}} -{{/if}} + {{if $theme_config}} +

{{$stitle}}

+ {{$theme_config nofilter}} + {{/if}} diff --git a/view/theme/frio/templates/settings/display.tpl b/view/theme/frio/templates/settings/display.tpl index f67bb3f40..95dde620e 100644 --- a/view/theme/frio/templates/settings/display.tpl +++ b/view/theme/frio/templates/settings/display.tpl @@ -1,71 +1,65 @@ -
- {{* include the title template for the settings title *}} - {{include file="section_title.tpl" title=$ptitle }} - - +

{{$ptitle}}

- +
-
-
- +
{{include file="field_themeselect.tpl" field=$theme}} {{* Show the mobile theme selection only if mobile themes are available *}} {{if count($mobile_theme.4) > 1}} {{include file="field_themeselect.tpl" field=$mobile_theme}} {{/if}} - -
- -
-
- +
+
-
-
+
{{if $theme_config}} {{$theme_config nofilter}} {{/if}}
+
-
-
- +
{{include file="field_input.tpl" field=$itemspage_network}} {{include file="field_input.tpl" field=$itemspage_mobile_network}} {{include file="field_input.tpl" field=$ajaxint}} @@ -74,32 +68,27 @@ {{include file="field_checkbox.tpl" field=$infinite_scroll}} {{include file="field_checkbox.tpl" field=$no_smart_threading}} {{include file="field_checkbox.tpl" field=$hide_dislike}} - -
- -
-
+
+
-
-
- +
{{include file="field_select.tpl" field=$first_day_of_week}} - -
- -
-
+
+
From 91fb396ec17f540dff2dd76d003ee5da262edfaf Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 1 Apr 2020 19:14:37 -0400 Subject: [PATCH 5/8] Refactor profile edit page - Fix header hierarchy - [frio] Fix panel display --- view/templates/settings/profile/index.tpl | 2 +- .../frio/templates/settings/profile/index.tpl | 67 ++++++++----------- .../vier/templates/settings/profile/index.tpl | 8 +-- 3 files changed, 34 insertions(+), 43 deletions(-) diff --git a/view/templates/settings/profile/index.tpl b/view/templates/settings/profile/index.tpl index 8c89dc1ba..7188212c0 100644 --- a/view/templates/settings/profile/index.tpl +++ b/view/templates/settings/profile/index.tpl @@ -97,7 +97,7 @@
-

{{$lbl_custom_fields_section}}

+

{{$lbl_custom_fields_section}}

{{$custom_fields_description nofilter}}
{{foreach $custom_fields as $custom_field}} diff --git a/view/theme/frio/templates/settings/profile/index.tpl b/view/theme/frio/templates/settings/profile/index.tpl index 05a4bb215..21387437e 100644 --- a/view/theme/frio/templates/settings/profile/index.tpl +++ b/view/theme/frio/templates/settings/profile/index.tpl @@ -1,5 +1,5 @@
- {{include file="section_title.tpl" title=$banner}} +

{{$banner}}

{{* The actions dropdown which can performed to the current profile *}}