From 0b66970ec922c556f9e89d5278c009f598e622c1 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 5 Feb 2020 16:14:04 +0000 Subject: [PATCH 1/2] Acessibility: Improve navigation and contact approval --- src/Module/Notifications/Introductions.php | 37 +++++-------------- view/templates/notifications/intros.tpl | 8 +++- view/templates/notifications/notification.tpl | 6 +-- view/theme/frio/templates/field_checkbox.tpl | 2 +- view/theme/frio/templates/field_radio.tpl | 2 +- view/theme/frio/templates/nav.tpl | 27 +++++++------- .../frio/templates/notifications/intros.tpl | 28 ++++++++------ 7 files changed, 49 insertions(+), 61 deletions(-) diff --git a/src/Module/Notifications/Introductions.php b/src/Module/Notifications/Introductions.php index 10919a13a..8ca4723cf 100644 --- a/src/Module/Notifications/Introductions.php +++ b/src/Module/Notifications/Introductions.php @@ -95,38 +95,17 @@ class Introductions extends BaseNotifications // Normal connection requests default: - $friend_selected = (($notification->getNetwork() !== Protocol::OSTATUS) ? ' checked="checked" ' : ' disabled '); - $fan_selected = (($notification->getNetwork() === Protocol::OSTATUS) ? ' checked="checked" disabled ' : ''); - - $lbl_knowyou = ''; - $knowyou = ''; - $helptext = ''; - $helptext2 = ''; - $helptext3 = ''; - if ($notification->getNetwork() === Protocol::DFRN) { $lbl_knowyou = DI::l10n()->t('Claims to be known to you: '); $knowyou = ($notification->getKnowYou() ? DI::l10n()->t('yes') : DI::l10n()->t('no')); - $helptext = DI::l10n()->t('Shall your connection be bidirectional or not?'); - $helptext2 = DI::l10n()->t('Accepting %s as a friend allows %s to subscribe to your posts, and you will also receive updates from them in your news feed.', $notification->getName(), $notification->getName()); - $helptext3 = DI::l10n()->t('Accepting %s as a subscriber allows them to subscribe to your posts, but you will not receive updates from them in your news feed.', $notification->getName()); - } elseif ($notification->getNetwork() === Protocol::DIASPORA) { - $helptext = DI::l10n()->t('Shall your connection be bidirectional or not?'); - $helptext2 = DI::l10n()->t('Accepting %s as a friend allows %s to subscribe to your posts, and you will also receive updates from them in your news feed.', $notification->getName(), $notification->getName()); - $helptext3 = DI::l10n()->t('Accepting %s as a sharer allows them to subscribe to your posts, but you will not receive updates from them in your news feed.', $notification->getName()); } - $dfrn_tpl = Renderer::getMarkupTemplate('notifications/netfriend.tpl'); - $dfrn_text = Renderer::replaceMacros($dfrn_tpl, [ - '$intro_id' => $notification->getIntroId(), - '$friend_selected' => $friend_selected, - '$fan_selected' => $fan_selected, - '$approve_as1' => $helptext, - '$approve_as2' => $helptext2, - '$approve_as3' => $helptext3, - '$as_friend' => DI::l10n()->t('Friend'), - '$as_fan' => (($notification->getNetwork() == Protocol::DIASPORA) ? DI::l10n()->t('Sharer') : DI::l10n()->t('Subscriber')), - ]); + $helptext = DI::l10n()->t('Shall your connection be bidirectional or not?'); + $helptext2 = DI::l10n()->t('Accepting %s as a friend allows %s to subscribe to your posts, and you will also receive updates from them in your news feed.', $notification->getName(), $notification->getName()); + $helptext3 = DI::l10n()->t('Accepting %s as a subscriber allows them to subscribe to your posts, but you will not receive updates from them in your news feed.', $notification->getName()); + + $friend = ['duplex', DI::l10n()->t('Friend'), '1', $helptext2, true]; + $follower = ['duplex', DI::l10n()->t('Subscriber'), '0', $helptext3, false]; $contact = DBA::selectFirst('contact', ['network', 'protocol'], ['id' => $notification->getContactId()]); @@ -155,7 +134,6 @@ class Introductions extends BaseNotifications '$header' => $header, '$str_notification_type' => DI::l10n()->t('Notification type:'), '$str_type' => $notification->getType(), - '$dfrn_text' => $dfrn_text, '$dfrn_id' => $notification->getDfrnId(), '$uid' => $notification->getUid(), '$intro_id' => $notification->getIntroId(), @@ -171,6 +149,9 @@ class Introductions extends BaseNotifications '$gender' => $notification->getGender(), '$lbl_gender' => DI::l10n()->t('Gender:'), '$hidden' => ['hidden', DI::l10n()->t('Hide this contact from others'), $notification->isHidden(), ''], + '$lbl_connection_type' => $helptext, + '$friend' => $friend, + '$follower' => $follower, '$url' => $notification->getUrl(), '$zrl' => $notification->getZrl(), '$lbl_url' => DI::l10n()->t('Profile URL'), diff --git a/view/templates/notifications/intros.tpl b/view/templates/notifications/intros.tpl index b04c19c18..21f35dd1b 100644 --- a/view/templates/notifications/intros.tpl +++ b/view/templates/notifications/intros.tpl @@ -20,12 +20,16 @@
{{include file="field_checkbox.tpl" field=$hidden}} +
+
{{$lbl_connection_type}}
+ {{include file="field_radio.tpl" field=$friend}} + {{include file="field_radio.tpl" field=$follower}} +
+ -{{$dfrn_text nofilter}} -
diff --git a/view/templates/notifications/notification.tpl b/view/templates/notifications/notification.tpl index a8de3c793..4ff7bc7a8 100644 --- a/view/templates/notifications/notification.tpl +++ b/view/templates/notifications/notification.tpl @@ -1,4 +1,4 @@ -
- {{$item_text nofilter}} {{$item_ago}} -
\ No newline at end of file +
+ {{$item_text nofilter}} {{$item_ago}} +
diff --git a/view/theme/frio/templates/field_checkbox.tpl b/view/theme/frio/templates/field_checkbox.tpl index d687665e9..f17c48329 100644 --- a/view/theme/frio/templates/field_checkbox.tpl +++ b/view/theme/frio/templates/field_checkbox.tpl @@ -1,7 +1,7 @@
- +
+ {{* The intro actions like approve, ignore, discard intro*}} + + {{* This sections contains special settings for contact approval. We hide it by default and load this section in a bootstrap modal in the case of approval *}}