From ace0a1cb754422da929784b9bd24b4c106d2a66e Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 8 Feb 2017 10:56:03 +0100 Subject: [PATCH 1/2] do not show feature button if the app is shared. css fixes --- Zotlabs/Lib/Apps.php | 1 + view/theme/redbasic/css/style.css | 5 ++++- view/tpl/app.tpl | 7 +++---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php index 6f23b83ee..0297c3e14 100644 --- a/Zotlabs/Lib/Apps.php +++ b/Zotlabs/Lib/Apps.php @@ -357,6 +357,7 @@ class Apps { '$delete' => ((local_channel() && $installed && $mode == 'edit') ? t('Delete') : ''), '$undelete' => ((local_channel() && $installed && $mode == 'edit') ? t('Undelete') : ''), '$deleted' => $papp['deleted'], + '$feature' => ((array_key_exists('categories',$papp)) ? true : false), '$featured' => ((strpos($papp['categories'], 'nav_featured_app') === false) ? false : true), '$navapps' => (($mode == 'nav') ? true : false) )); diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 02ee689ce..52a8abb03 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -2104,6 +2104,9 @@ dl.bb-dl > dd > li { font-size: 80px; color: $toolicon_colour; text-shadow: 3px 3px 3px lightgrey; +} + +.app-detail { text-align: center; } @@ -2112,4 +2115,4 @@ dl.bb-dl > dd > li { margin-top: 20px; margin-left: auto; margin-right: auto; -} \ No newline at end of file +} diff --git a/view/tpl/app.tpl b/view/tpl/app.tpl index 2ecb5a701..ba97ad501 100644 --- a/view/tpl/app.tpl +++ b/view/tpl/app.tpl @@ -11,19 +11,18 @@ {{/if}} - + {{if $install || $update || $delete || $feature}}
- {{if $install || $update || $delete }} {{if $install}}{{/if}} {{if $edit}}{{/if}} {{if $delete}}{{/if}} - {{/if}} - + {{if $feature}}{{/if}}
{{/if}} + {{/if}} {{else}}
  • {{if $icon}}{{else}}{{/if}}{{$app.name}}
  • From eb415fd869b03724b7308320b45b1bdfae6e5142 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 8 Feb 2017 11:17:09 +0100 Subject: [PATCH 2/2] better detection of when to show the feature button and document nav mode for app_render() --- Zotlabs/Lib/Apps.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php index 0297c3e14..1432cbdcf 100644 --- a/Zotlabs/Lib/Apps.php +++ b/Zotlabs/Lib/Apps.php @@ -262,6 +262,7 @@ class Apps { * list: normal mode for viewing an app on the app page * no buttons are shown * edit: viewing the app page in editing mode provides a delete button + * nav: render apps for app-bin */ $installed = false; @@ -357,7 +358,7 @@ class Apps { '$delete' => ((local_channel() && $installed && $mode == 'edit') ? t('Delete') : ''), '$undelete' => ((local_channel() && $installed && $mode == 'edit') ? t('Undelete') : ''), '$deleted' => $papp['deleted'], - '$feature' => ((array_key_exists('categories',$papp)) ? true : false), + '$feature' => (($papp['embed']) ? false : true), '$featured' => ((strpos($papp['categories'], 'nav_featured_app') === false) ? false : true), '$navapps' => (($mode == 'nav') ? true : false) )); @@ -769,6 +770,8 @@ class Apps { if(! $embed) return $ret; + $ret['embed'] = true; + if(array_key_exists('categories',$ret)) unset($ret['categories']);