From b55676d08914d58927b5503a1bfa283397cd6d44 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 17 Jun 2021 07:33:45 +0000 Subject: New landing page HQ with separate views for direct messages, public/limited messages and starred messages if the feature is enabled --- Zotlabs/Widget/Hq_controls.php | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) (limited to 'Zotlabs/Widget/Hq_controls.php') diff --git a/Zotlabs/Widget/Hq_controls.php b/Zotlabs/Widget/Hq_controls.php index 0caa54a1a..781e2a0bd 100644 --- a/Zotlabs/Widget/Hq_controls.php +++ b/Zotlabs/Widget/Hq_controls.php @@ -9,17 +9,32 @@ class Hq_controls { if (! local_channel()) return; + $entries = [ + 'toggle_editor' => [ + 'label' => t('Toggle post editor'), + 'id' => 'jot-toggle', + 'href' => '#', + 'class' => 'btn btn-outline-primary', + 'type' => 'button', + 'icon' => 'pencil', + 'extra' => 'data-toggle="button"' + ] + ]; + + + $entries['toggle_notes'] = [ + 'label' => t('Toggle personal notes'), + 'id' => 'notes-toggle', + 'href' => '#', + 'class' => 'btn btn-outline-primary', + 'type' => 'button', + 'icon' => 'sticky-note-o', + 'extra' => 'data-toggle="button"' + ]; + return replace_macros(get_markup_template('hq_controls.tpl'), [ - '$title' => t('HQ Control Panel'), - '$menu' => [ - 'create' => [ - 'label' => t('Create a new post'), - 'id' => 'jot-toggle', - 'href' => '#', - 'class' => '' - ] - ] + '$entries' => $entries ] ); } -- cgit v1.2.3 From 34ca2cddd4d70e08c6351ef0f72ea5e2a6c9b056 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 17 Jun 2021 07:43:32 +0000 Subject: only show notes if the app is enabled --- Zotlabs/Widget/Hq_controls.php | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'Zotlabs/Widget/Hq_controls.php') diff --git a/Zotlabs/Widget/Hq_controls.php b/Zotlabs/Widget/Hq_controls.php index 781e2a0bd..8c36b8d3a 100644 --- a/Zotlabs/Widget/Hq_controls.php +++ b/Zotlabs/Widget/Hq_controls.php @@ -2,6 +2,9 @@ namespace Zotlabs\Widget; +use Zotlabs\Lib\Apps; + + class Hq_controls { function widget($arr) { @@ -21,16 +24,17 @@ class Hq_controls { ] ]; - - $entries['toggle_notes'] = [ - 'label' => t('Toggle personal notes'), - 'id' => 'notes-toggle', - 'href' => '#', - 'class' => 'btn btn-outline-primary', - 'type' => 'button', - 'icon' => 'sticky-note-o', - 'extra' => 'data-toggle="button"' - ]; + if(Apps::system_app_installed(local_channel(), 'Notes')) { + $entries['toggle_notes'] = [ + 'label' => t('Toggle personal notes'), + 'id' => 'notes-toggle', + 'href' => '#', + 'class' => 'btn btn-outline-primary', + 'type' => 'button', + 'icon' => 'sticky-note-o', + 'extra' => 'data-toggle="button"' + ]; + } return replace_macros(get_markup_template('hq_controls.tpl'), [ -- cgit v1.2.3 From 5ca352a6c362ac1b452460ebbb07fbf56bb76417 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 17 Jun 2021 12:10:54 +0000 Subject: allow to add a wrapper class to the hq_controls widget --- Zotlabs/Widget/Hq_controls.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Zotlabs/Widget/Hq_controls.php') diff --git a/Zotlabs/Widget/Hq_controls.php b/Zotlabs/Widget/Hq_controls.php index 8c36b8d3a..8b532defe 100644 --- a/Zotlabs/Widget/Hq_controls.php +++ b/Zotlabs/Widget/Hq_controls.php @@ -7,7 +7,7 @@ use Zotlabs\Lib\Apps; class Hq_controls { - function widget($arr) { + function widget($options) { if (! local_channel()) return; @@ -38,7 +38,8 @@ class Hq_controls { return replace_macros(get_markup_template('hq_controls.tpl'), [ - '$entries' => $entries + '$entries' => $entries, + '$wrapper_class' => $options['class'] ] ); } -- cgit v1.2.3 From f4f9ccc3b234eaadf29b3f5c8bec6e19de0aa761 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 18 Jun 2021 08:55:49 +0000 Subject: css fixes --- Zotlabs/Widget/Hq_controls.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Zotlabs/Widget/Hq_controls.php') diff --git a/Zotlabs/Widget/Hq_controls.php b/Zotlabs/Widget/Hq_controls.php index 8b532defe..9504b8f9e 100644 --- a/Zotlabs/Widget/Hq_controls.php +++ b/Zotlabs/Widget/Hq_controls.php @@ -17,7 +17,7 @@ class Hq_controls { 'label' => t('Toggle post editor'), 'id' => 'jot-toggle', 'href' => '#', - 'class' => 'btn btn-outline-primary', + 'class' => 'btn', 'type' => 'button', 'icon' => 'pencil', 'extra' => 'data-toggle="button"' @@ -29,7 +29,7 @@ class Hq_controls { 'label' => t('Toggle personal notes'), 'id' => 'notes-toggle', 'href' => '#', - 'class' => 'btn btn-outline-primary', + 'class' => 'btn', 'type' => 'button', 'icon' => 'sticky-note-o', 'extra' => 'data-toggle="button"' @@ -39,7 +39,8 @@ class Hq_controls { return replace_macros(get_markup_template('hq_controls.tpl'), [ '$entries' => $entries, - '$wrapper_class' => $options['class'] + '$wrapper_class' => $options['wrapper_class'], + '$entry_class' => $options['entry_class'] ] ); } -- cgit v1.2.3 From 167db22e15c72c32cd67ce1a2b242dc4527e0b64 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 24 Jun 2021 19:31:19 +0000 Subject: slightly refactor for desktop notifications and fix minor issues --- Zotlabs/Widget/Hq_controls.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'Zotlabs/Widget/Hq_controls.php') diff --git a/Zotlabs/Widget/Hq_controls.php b/Zotlabs/Widget/Hq_controls.php index 9504b8f9e..91335fd76 100644 --- a/Zotlabs/Widget/Hq_controls.php +++ b/Zotlabs/Widget/Hq_controls.php @@ -15,9 +15,8 @@ class Hq_controls { $entries = [ 'toggle_editor' => [ 'label' => t('Toggle post editor'), - 'id' => 'jot-toggle', 'href' => '#', - 'class' => 'btn', + 'class' => 'btn jot-toggle', 'type' => 'button', 'icon' => 'pencil', 'extra' => 'data-toggle="button"' @@ -27,9 +26,8 @@ class Hq_controls { if(Apps::system_app_installed(local_channel(), 'Notes')) { $entries['toggle_notes'] = [ 'label' => t('Toggle personal notes'), - 'id' => 'notes-toggle', 'href' => '#', - 'class' => 'btn', + 'class' => 'btn notes-toggle', 'type' => 'button', 'icon' => 'sticky-note-o', 'extra' => 'data-toggle="button"' -- cgit v1.2.3