aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2017-05-05 16:32:20 +0200
committerMario Vavti <mario@mariovavti.com>2017-05-05 16:33:28 +0200
commit3ccefa20e8b10d0a507c6b002237664e721ca389 (patch)
treef5a171e273d5bc5d5b4d7a15e261f866889ee16f
parentdcc8a94d07cb60b0bc814a30ccdae41a49133649 (diff)
downloadvolse-hubzilla-3ccefa20e8b10d0a507c6b002237664e721ca389.tar.gz
volse-hubzilla-3ccefa20e8b10d0a507c6b002237664e721ca389.tar.bz2
volse-hubzilla-3ccefa20e8b10d0a507c6b002237664e721ca389.zip
collapse sysapps if viewing a remote channel
-rw-r--r--include/nav.php12
-rw-r--r--view/theme/redbasic/css/style.css3
-rwxr-xr-xview/tpl/nav.tpl34
3 files changed, 38 insertions, 11 deletions
diff --git a/include/nav.php b/include/nav.php
index fecf28548..849e19d9a 100644
--- a/include/nav.php
+++ b/include/nav.php
@@ -43,7 +43,7 @@ EOT;
require_once('include/conversation.php');
$is_owner = (((local_channel()) && (App::$profile['profile_uid'] == local_channel())) ? true : false);
- $navapps[] = channel_apps($is_owner, App::$profile['channel_address']);
+ $channel_apps[] = channel_apps($is_owner, App::$profile['channel_address']);
$myident = (($channel) ? $channel['xchan_addr'] : '');
@@ -258,7 +258,7 @@ EOT;
usort($syslist,'Zotlabs\\Lib\\Apps::app_name_compare');
foreach($syslist as $app) {
- $navapps[] = Zlib\Apps::app_render($app,'nav');
+ $nav_apps[] = Zlib\Apps::app_render($app,'nav');
}
$tpl = get_markup_template('nav.tpl');
@@ -276,8 +276,10 @@ EOT;
'$powered_by' => $powered_by,
'$help' => t('@name, #tag, ?doc, content'),
'$pleasewait' => t('Please wait...'),
- '$navapps' => $navapps,
- '$addapps' => t('Add Apps')
+ '$nav_apps' => $nav_apps,
+ '$channel_apps' => $channel_apps,
+ '$addapps' => t('Add Apps'),
+ '$sysapps_toggle' => t('Toggle System Apps')
));
if(x($_SESSION, 'reload_avatar') && $observer) {
@@ -480,4 +482,4 @@ function channel_apps($is_owner = false, $nickname = null) {
'$thumb' => App::$profile['thumb']
]
);
-} \ No newline at end of file
+}
diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css
index 4ab2634ef..faa292fe5 100644
--- a/view/theme/redbasic/css/style.css
+++ b/view/theme/redbasic/css/style.css
@@ -886,7 +886,8 @@ a .drop-icons:hover {
color: #FF0000;
}
-.lockview {
+.lockview,
+.sys-apps-toggle {
cursor: pointer;
}
diff --git a/view/tpl/nav.tpl b/view/tpl/nav.tpl
index c5b378b4f..5c301b4d2 100755
--- a/view/tpl/nav.tpl
+++ b/view/tpl/nav.tpl
@@ -188,10 +188,22 @@
{{/if}}
<li class="nav-item dropdown" id="app-menu">
<a class="nav-link" href="#" data-toggle="dropdown"><i class="fa fa-fw fa-bars"></i></a>
- <div class="dropdown-menu dropdown-menu-right">
- {{foreach $navapps as $navapp}}
- {{$navapp}}
+ <div id="dropdown-menu" class="dropdown-menu dropdown-menu-right">
+ {{if $channel_apps.0}}
+ {{foreach $channel_apps as $channel_app}}
+ {{$channel_app}}
{{/foreach}}
+ <div class="dropdown-header sys-apps-toggle" onclick="$('#dropdown-menu').click(function(e) { e.stopPropagation(); }); openClose('sys_apps');">
+ {{$sysapps_toggle}}
+ </div>
+ <div id="sys_apps" style="display:none;">
+ {{/if}}
+ {{foreach $nav_apps as $nav_app}}
+ {{$nav_app}}
+ {{/foreach}}
+ {{if $channel_apps.0}}
+ </div>
+ {{/if}}
{{if $localuser}}
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="/apps"><i class="generic-icons-nav fa fa-fw fa-plus-circle"></i>{{$addapps}}</a>
@@ -202,9 +214,21 @@
</div>
<div class="collapse d-md-none" id="navbar-collapse-2">
<div class="navbar-nav mr-auto">
- {{foreach $navapps as $navapp}}
- {{$navapp|replace:'dropdown-item':'nav-link'}}
+ {{if $channel_apps.0}}
+ {{foreach $channel_apps as $channel_app}}
+ {{$channel_app|replace:'dropdown-item':'nav-link'}}
{{/foreach}}
+ <div class="dropdown-header sys-apps-toggle" onclick="openClose('sys-apps-collapsed');">
+ {{$sysapps_toggle}}
+ </div>
+ <div id="sys-apps-collapsed" style="display:none;">
+ {{/if}}
+ {{foreach $nav_apps as $nav_app}}
+ {{$nav_app|replace:'dropdown-item':'nav-link'}}
+ {{/foreach}}
+ {{if $channel_apps.0}}
+ </div>
+ {{/if}}
{{if $localuser}}
<div class="dropdown-divider"></div>
<a class="nav-link" href="/apps"><i class="generic-icons-nav fa fa-fw fa-plus-circle"></i>{{$addapps}}</a>