From 860b7bad73c90855d487baa91fee82ca457a26fa Mon Sep 17 00:00:00 2001 From: Jonny Tischbein Date: Wed, 21 Nov 2018 17:27:10 +0100 Subject: [PATCH 1/7] Frio: Add collapsable panel-groups for admin/site --- view/theme/frio/css/mod_admin.css | 2 + view/theme/frio/templates/admin/site.tpl | 353 +++++++++++++++++++++++ 2 files changed, 355 insertions(+) create mode 100644 view/theme/frio/templates/admin/site.tpl diff --git a/view/theme/frio/css/mod_admin.css b/view/theme/frio/css/mod_admin.css index b690577d1..76056d4a1 100644 --- a/view/theme/frio/css/mod_admin.css +++ b/view/theme/frio/css/mod_admin.css @@ -2,6 +2,8 @@ #admin-users.adminpage > h1 { padding: 0 15px; } #admin-users.adminpage .panel-collapse { margin-left: -15px; margin-right: -15px; } +#adminpage.adminpage > h1 { padding: 0 15px; } + #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; } diff --git a/view/theme/frio/templates/admin/site.tpl b/view/theme/frio/templates/admin/site.tpl new file mode 100644 index 000000000..1205277fe --- /dev/null +++ b/view/theme/frio/templates/admin/site.tpl @@ -0,0 +1,353 @@ + + + + +
+

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

+
+ +
+ +
+ +
+ + {{include file="field_input.tpl" field=$sitename}} + {{include file="field_input.tpl" field=$hostname}} + {{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=$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=$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=$maximagesize}} + {{include file="field_input.tpl" field=$maximagelength}} + {{include file="field_input.tpl" field=$jpegimagequality}} + +
+
+ + + +
+ +
+ {{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_full_threads}} + + {{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}} + + +
+
+ + +
+ +
+ + {{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_input.tpl" field=$basepath}} + {{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_checkbox.tpl" field=$poco_completion}} + {{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=$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_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_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}} + +
+
+ + + +
+ +
+ + {{* separate form for relocate... *}} +
+ + {{include file="field_input.tpl" field=$relocate_url}} + + +
+
+
+
From 278d42dbc9dcc361298850843283c0474c312479 Mon Sep 17 00:00:00 2001 From: Jonny Tischbein Date: Wed, 21 Nov 2018 19:15:59 +0100 Subject: [PATCH 2/7] Save last collapsed panel + restore to open and scroll to top of panel --- view/theme/frio/templates/admin/site.tpl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/view/theme/frio/templates/admin/site.tpl b/view/theme/frio/templates/admin/site.tpl index 1205277fe..e638a14c9 100644 --- a/view/theme/frio/templates/admin/site.tpl +++ b/view/theme/frio/templates/admin/site.tpl @@ -38,6 +38,16 @@ return false; }); }); + $(function(){ + $(".collapse").on('show.bs.collapse', function(e) { + localStorage.setItem('activeTab', $(e.target).attr('id')); + }); + var activeTab = localStorage.getItem('activeTab'); + if (activeTab) { + $("#" + activeTab).collapse('show'); + window.scroll(0, $("#" + activeTab).offset().top - 120); + } + }); From 62f09fdd574842b7453e0897d7e835faae2c6f6e Mon Sep 17 00:00:00 2001 From: Jonny Tischbein Date: Wed, 21 Nov 2018 19:23:06 +0100 Subject: [PATCH 3/7] Only store last opened panel for one reload (the POST reload after a submit) --- view/theme/frio/templates/admin/site.tpl | 1 + 1 file changed, 1 insertion(+) diff --git a/view/theme/frio/templates/admin/site.tpl b/view/theme/frio/templates/admin/site.tpl index e638a14c9..6a6deb1e0 100644 --- a/view/theme/frio/templates/admin/site.tpl +++ b/view/theme/frio/templates/admin/site.tpl @@ -46,6 +46,7 @@ if (activeTab) { $("#" + activeTab).collapse('show'); window.scroll(0, $("#" + activeTab).offset().top - 120); + localStorage.removeItem('activeTab'); } }); From 36aca259d54edc992d7f4b14d0c57a25dcc7b32e Mon Sep 17 00:00:00 2001 From: Jonny Tischbein Date: Sat, 24 Nov 2018 00:44:11 +0100 Subject: [PATCH 4/7] Change saving active panel from js localStorage to via html #anker --- mod/admin.php | 4 +++- view/theme/frio/templates/admin/site.tpl | 15 +++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/mod/admin.php b/mod/admin.php index cca109f48..97bde76ca 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -1163,6 +1163,7 @@ function admin_page_site_post(App $a) $relay_scope = ((x($_POST,'relay_scope')) ? Strings::escapeTags(trim($_POST['relay_scope'])) : ''); $relay_server_tags = ((x($_POST,'relay_server_tags')) ? Strings::escapeTags(trim($_POST['relay_server_tags'])) : ''); $relay_user_tags = ((x($_POST,'relay_user_tags')) ? True : False); + $active_panel = (defaults($_POST, 'active_panel', '') ? "#" . Strings::escapeTags(trim($_POST['active_panel'])) : ''); // Has the directory url changed? If yes, then resubmit the existing profiles there if ($global_directory != Config::get('system', 'directory') && ($global_directory != '')) { @@ -1344,7 +1345,8 @@ function admin_page_site_post(App $a) Config::set('system', 'rino_encrypt', $rino); info(L10n::t('Site settings updated.') . EOL); - $a->internalRedirect('admin/site'); + + $a->internalRedirect('admin/site' . $active_panel); return; // NOTREACHED } diff --git a/view/theme/frio/templates/admin/site.tpl b/view/theme/frio/templates/admin/site.tpl index 6a6deb1e0..c0241cd0e 100644 --- a/view/theme/frio/templates/admin/site.tpl +++ b/view/theme/frio/templates/admin/site.tpl @@ -40,13 +40,14 @@ }); $(function(){ $(".collapse").on('show.bs.collapse', function(e) { - localStorage.setItem('activeTab', $(e.target).attr('id')); + var id = $(e.target).attr('id'); + $("input[name=active_panel]").val(id); }); - var activeTab = localStorage.getItem('activeTab'); - if (activeTab) { - $("#" + activeTab).collapse('show'); - window.scroll(0, $("#" + activeTab).offset().top - 120); - localStorage.removeItem('activeTab'); + var url = document.location.toString(); + if ( url.match('#') ) { + var element = '#'+url.split('#')[1]; + $(element).addClass('in'); + window.scroll(0, $(element).offset().top - 120); } }); @@ -56,6 +57,7 @@

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

+