From: Hypolite Petovan Date: Fri, 20 Jan 2023 17:13:17 +0000 (-0500) Subject: Fix connection acknowledgement not appearing on contact page X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=dcfb8bb73ee7096efb841c4de0951575b073e204;p=friendica.git Fix connection acknowledgement not appearing on contact page - Remove obsolete template variables - Move contact_edit vier template to base template --- diff --git a/src/Module/Contact/Profile.php b/src/Module/Contact/Profile.php index 15eebd3603..e13fbd584c 100644 --- a/src/Module/Contact/Profile.php +++ b/src/Module/Contact/Profile.php @@ -197,7 +197,7 @@ class Profile extends BaseModule Contact\User::setIgnored($contact['id'], DI::userSession()->getLocalUserId(), true); $message = $this->t('Contact has been ignored'); } - + // @TODO: add $this->localRelationship->save($localRelationship); DI::sysmsg()->addInfo($message); } @@ -213,7 +213,7 @@ class Profile extends BaseModule Contact\User::setCollapsed($contact['id'], DI::userSession()->getLocalUserId(), true); $message = $this->t('Contact has been collapsed'); } - + // @TODO: add $this->localRelationship->save($localRelationship); DI::sysmsg()->addInfo($message); } @@ -239,9 +239,6 @@ class Profile extends BaseModule '$baseurl' => $this->baseUrl->get(true), ]); - $contact['blocked'] = Contact\User::isBlocked($contact['id'], DI::userSession()->getLocalUserId()); - $contact['readonly'] = Contact\User::isIgnored($contact['id'], DI::userSession()->getLocalUserId()); - switch ($localRelationship->rel) { case Contact::FRIEND: $relation_text = $this->t('You are mutual friends with %s', $contact['name']); break; case Contact::FOLLOWER: $relation_text = $this->t('You are sharing with %s', $contact['name']); break; @@ -361,16 +358,13 @@ class Profile extends BaseModule '$last_update' => $last_update, '$udnow' => $this->t('Update now'), '$contact_id' => $contact['id'], - '$block_text' => ($contact['blocked'] ? $this->t('Unblock') : $this->t('Block')), - '$ignore_text' => ($contact['readonly'] ? $this->t('Unignore') : $this->t('Ignore')), + '$pending' => $localRelationship->pending ? $this->t('Awaiting connection acknowledge') : '', + '$blocked' => $localRelationship->blocked ? $this->t('Currently blocked') : '', + '$ignored' => $localRelationship->ignored ? $this->t('Currently ignored') : '', + '$collapsed' => $localRelationship->collapsed ? $this->t('Currently collapsed') : '', + '$archived' => ($contact['archive'] ? $this->t('Currently archived') : ''), '$insecure' => (in_array($contact['network'], [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::MAIL, Protocol::DIASPORA]) ? '' : $insecure), - '$info' => $localRelationship->info, '$cinfo' => ['info', '', $localRelationship->info, ''], - '$blocked' => ($contact['blocked'] ? $this->t('Currently blocked') : ''), - '$ignored' => ($contact['readonly'] ? $this->t('Currently ignored') : ''), - '$collapsed' => (Contact\User::isCollapsed($contact['id'], DI::userSession()->getLocalUserId()) ? $this->t('Currently collapsed') : ''), - '$archived' => ($contact['archive'] ? $this->t('Currently archived') : ''), - '$pending' => ($contact['pending'] ? $this->t('Awaiting connection acknowledge') : ''), '$hidden' => ['hidden', $this->t('Hide this contact from others'), $localRelationship->hidden, $this->t('Replies/likes to your public posts may still be visible')], '$notify_new_posts' => ['notify_new_posts', $this->t('Notification for new posts'), ($localRelationship->notifyNewPosts), $this->t('Send a notification of every new post of this contact')], '$fetch_further_information' => $fetch_further_information, diff --git a/view/templates/contact_edit.tpl b/view/templates/contact_edit.tpl index 97f7a6526f..a9105d696c 100644 --- a/view/templates/contact_edit.tpl +++ b/view/templates/contact_edit.tpl @@ -1,3 +1,4 @@ +
{{* Insert Tab-Nav *}} @@ -12,7 +13,7 @@ {{* This is the Action menu where contact related actions like 'ignore', 'hide' can be performed *}}
- {{$contact_action_button}} +
@@ -34,9 +34,9 @@ {{if $poll_enabled}}
  • {{$lastupdtext}} {{$last_update}}
    - {{if $poll_interval}} - {{$updpub}} {{$poll_interval nofilter}} - {{/if}} + {{if $poll_interval}} + {{$updpub}} {{$poll_interval nofilter}} + {{/if}}
  • {{/if}} @@ -45,13 +45,12 @@ {{if $blocked && !$pending}}
  • {{$blocked}}
  • {{/if}} {{if $pending}}
  • {{$pending}}
  • {{/if}} {{if $ignored}}
  • {{$ignored}}
  • {{/if}} - {{if $collapsed}}
  • {{$collapsed}}
  • {{/if}} {{if $archived}}
  • {{$archived}}
  • {{/if}}
    {{* End of contact-edit-status-wrapper *}} {{* Some information about the contact from the profile *}} -
    {{$profileurllabel}}
    {{$profileurl}}
    +
    {{$profileurllabel}}
    {{$profileurl}}
    {{if $location}}
    {{$location_label}}
    {{$location nofilter}}
    {{/if}} {{if $xmpp}}
    {{$xmpp_label}}
    {{$xmpp}}
    {{/if}} {{if $matrix}}
    {{$matrix_label}}
    {{$matrix}}
    {{/if}} @@ -63,40 +62,39 @@
    - {{if $contact_settings_label}} + {{if $contact_settings_label}}
    -
    - {{include file="field_checkbox.tpl" field=$notify_new_posts}} - {{if $fetch_further_information}} - {{include file="field_select.tpl" field=$fetch_further_information}} - {{if $fetch_further_information.2 == 2 || $fetch_further_information.2 == 3}} {{include file="field_textarea.tpl" field=$ffi_keyword_denylist}} {{/if}} - {{/if}} - {{if $allow_remote_self}} - {{include file="field_select.tpl" field=$remote_self}} - {{/if}} - - {{include file="field_checkbox.tpl" field=$hidden}} - -
    -

    {{$lbl_info1}}

    - -
    -
    +
    + + {{include file="field_checkbox.tpl" field=$notify_new_posts}} + + {{if $fetch_further_information}} + {{include file="field_select.tpl" field=$fetch_further_information}} + {{if $fetch_further_information.2 == 2 || $fetch_further_information.2 == 3}} {{include file="field_textarea.tpl" field=$ffi_keyword_denylist}} {{/if}} + {{/if}} + + {{if $allow_remote_self}} + {{include file="field_select.tpl" field=$remote_self}} + {{/if}} - {{if $reason}} + {{include file="field_checkbox.tpl" field=$hidden}} + + {{include file="field_textarea.tpl" field=$cinfo}} + + {{if $reason}}

    {{$lbl_info2}}

    {{$reason}}

    - {{/if}} + {{/if}}
    - - {{/if}} + {{/if}} +
    {{* End of the form *}} diff --git a/view/theme/vier/templates/contact_edit.tpl b/view/theme/vier/templates/contact_edit.tpl deleted file mode 100644 index 82ed71abe2..0000000000 --- a/view/theme/vier/templates/contact_edit.tpl +++ /dev/null @@ -1,103 +0,0 @@ - -
    - - {{* Insert Tab-Nav *}} - {{$tab_str nofilter}} - - -
    -
    - {{* End of contact-edit-links *}} - - - -
    - - {{if $contact_settings_label}} - -
    - - -
    - {{include file="field_checkbox.tpl" field=$notify_new_posts}} - {{if $fetch_further_information}} - {{include file="field_select.tpl" field=$fetch_further_information}} - {{if $fetch_further_information.2 == 2 || $fetch_further_information.2 == 3}} {{include file="field_textarea.tpl" field=$ffi_keyword_denylist}} {{/if}} - {{/if}} - {{if $allow_remote_self}} - {{include file="field_select.tpl" field=$remote_self}} - {{/if}} - - {{include file="field_checkbox.tpl" field=$hidden}} - -
    -

    {{$lbl_info1}}

    - -
    -
    - - {{if $reason}} -
    -

    {{$lbl_info2}}

    -

    {{$reason}}

    -
    -
    - {{/if}} -
    - - {{/if}} - -
    - -
    {{* End of the form *}} -
    {{* End of contact-edit-nav-wrapper *}} -