From c618bfc607498998916f01fd9c6985c2ecd47356 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 24 Feb 2018 19:42:39 +0100 Subject: mark connections where we do not have post_comments permissions with an no entry sign. --- Zotlabs/Module/Connections.php | 8 +++++++- Zotlabs/Module/Viewconnections.php | 8 +++++++- include/text.php | 3 ++- view/css/mod_connections.css | 8 +++++++- view/css/mod_viewconnections.css | 6 ++++++ view/css/widgets.css | 7 +++++++ view/theme/redbasic/css/style.css | 5 +++++ view/tpl/connection_template.tpl | 7 ++++++- view/tpl/contact_template.tpl | 3 +++ view/tpl/micropro_img.tpl | 2 +- 10 files changed, 51 insertions(+), 6 deletions(-) diff --git a/Zotlabs/Module/Connections.php b/Zotlabs/Module/Connections.php index 255731c9c..55e716ace 100644 --- a/Zotlabs/Module/Connections.php +++ b/Zotlabs/Module/Connections.php @@ -245,6 +245,11 @@ class Connections extends \Zotlabs\Web\Controller { ((intval($rr['abook_blocked'])) ? t('Blocked') : ''), ((intval($rr['abook_not_here'])) ? t('Not connected at this location') : '') ); + + $oneway = false; + if(! intval(get_abconfig(local_channel(),$rr['xchan_hash'],'their_perms','post_comments'))) { + $oneway = true; + } foreach($status as $str) { if(!$str) @@ -283,7 +288,8 @@ class Connections extends \Zotlabs\Web\Controller { 'ignore_hover' => t('Ignore connection'), 'ignore' => ((! $rr['abook_ignored']) ? t('Ignore') : false), 'recent_label' => t('Recent activity'), - 'recentlink' => z_root() . '/network/?f=&cid=' . intval($rr['abook_id']) + 'recentlink' => z_root() . '/network/?f=&cid=' . intval($rr['abook_id']), + 'oneway' => $oneway ); } } diff --git a/Zotlabs/Module/Viewconnections.php b/Zotlabs/Module/Viewconnections.php index 1f9c03751..e024f1c5a 100644 --- a/Zotlabs/Module/Viewconnections.php +++ b/Zotlabs/Module/Viewconnections.php @@ -69,8 +69,13 @@ class Viewconnections extends \Zotlabs\Web\Controller { $contacts = array(); foreach($r as $rr) { + + $oneway = false; + if(! intval(get_abconfig(\App::$profile['uid'],$rr['xchan_hash'],'their_perms','post_comments'))) { + $oneway = true; + } - $url = chanlink_hash($rr['xchan_hash']); + $url = chanlink_hash($rr['xchan_hash']); if($url) { $contacts[] = array( 'id' => $rr['abook_id'], @@ -83,6 +88,7 @@ class Viewconnections extends \Zotlabs\Web\Controller { 'sparkle' => '', 'itemurl' => $rr['url'], 'network' => '', + 'oneway' => $oneway ); } } diff --git a/include/text.php b/include/text.php index 35a367d43..6014f7437 100644 --- a/include/text.php +++ b/include/text.php @@ -979,7 +979,7 @@ function contact_block() { // than wishful thinking; even though soapbox channels and feeds will disable it. if(! intval(get_abconfig(App::$profile['uid'],$rr['xchan_hash'],'their_perms','post_comments'))) { - $rr['archived'] = true; + $rr['oneway'] = true; } $micropro[] = micropro($rr,true,'mpfriend'); } @@ -1033,6 +1033,7 @@ function micropro($contact, $redirect = false, $class = '', $textmode = false) { return replace_macros(get_markup_template(($textmode)?'micropro_txt.tpl':'micropro_img.tpl'),array( '$click' => (($contact['click']) ? $contact['click'] : ''), '$class' => $class . (($contact['archived']) ? ' archived' : ''), + '$oneway' => (($contact['oneway']) ? true : false), '$url' => $url, '$photo' => $contact['xchan_photo_s'], '$name' => $contact['xchan_name'], diff --git a/view/css/mod_connections.css b/view/css/mod_connections.css index 00e6e2a70..4c26193b4 100644 --- a/view/css/mod_connections.css +++ b/view/css/mod_connections.css @@ -36,4 +36,10 @@ .connphone { color: green; -} \ No newline at end of file +} + +.contact-photo-wrapper .oneway-overlay { + margin-top: -25px; + margin-left: 53px; + font-size: 20px; +} diff --git a/view/css/mod_viewconnections.css b/view/css/mod_viewconnections.css index 56add4cac..1b0c7ab62 100644 --- a/view/css/mod_viewconnections.css +++ b/view/css/mod_viewconnections.css @@ -31,3 +31,9 @@ .contact-entry-end { clear: both; } + +.contact-entry-photo-wrapper .oneway-overlay { + margin-top: 25px; + margin-left: -25px; + font-size: 20px; +} diff --git a/view/css/widgets.css b/view/css/widgets.css index a32ac045b..9cfcb4a88 100644 --- a/view/css/widgets.css +++ b/view/css/widgets.css @@ -216,3 +216,10 @@ a.wikilist { #notifications { margin-bottom: 1rem; } + +/* contact block */ +.contact-block-div .oneway-overlay { + font-size: 20px; + margin-left: -25px; + margin-top: 25px; +} diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 1611cda60..75992468e 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -1800,3 +1800,8 @@ dl.bb-dl > dd > li { .caption-visible { max-height: 75%; } + +.oneway-overlay { + position: absolute; + text-shadow: -2px 0 1px #fff, 0 2px 1px#fff, 2px 0 1px #fff, 0 -2px 1px #fff; +} diff --git a/view/tpl/connection_template.tpl b/view/tpl/connection_template.tpl index 8e49c9e27..4543a69d0 100755 --- a/view/tpl/connection_template.tpl +++ b/view/tpl/connection_template.tpl @@ -18,7 +18,12 @@
- {{$contact.name}} + + {{$contact.name}} + + {{if $contact.oneway}} + + {{/if}}
{{if $contact.status}} diff --git a/view/tpl/contact_template.tpl b/view/tpl/contact_template.tpl index 3d1bfa4a4..2a2f996f4 100755 --- a/view/tpl/contact_template.tpl +++ b/view/tpl/contact_template.tpl @@ -1,6 +1,9 @@
{{$contact.name}} + {{if $contact.oneway}} + + {{/if}}
{{$contact.name}}
diff --git a/view/tpl/micropro_img.tpl b/view/tpl/micropro_img.tpl index a7c5973f3..7464430b5 100755 --- a/view/tpl/micropro_img.tpl +++ b/view/tpl/micropro_img.tpl @@ -1 +1 @@ -
+ -- cgit v1.2.3