Merge pull request #11155 from annando/advanced-cleaned

Cleaned advanced contact tab
This commit is contained in:
Hypolite Petovan 2022-01-14 07:58:51 -05:00 committed by GitHub
commit 8abf1dccf0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 99 deletions

View File

@ -73,12 +73,7 @@ class Advanced extends BaseModule
$name = ($_POST['name'] ?? '') ?: $contact['name'];
$nick = $_POST['nick'] ?? '';
$url = $_POST['url'] ?? '';
$alias = $_POST['alias'] ?? '';
$request = $_POST['request'] ?? '';
$confirm = $_POST['confirm'] ?? '';
$notify = $_POST['notify'] ?? '';
$poll = $_POST['poll'] ?? '';
$attag = $_POST['attag'] ?? '';
$photo = $_POST['photo'] ?? '';
$nurl = Strings::normaliseLink($url);
@ -89,12 +84,7 @@ class Advanced extends BaseModule
'nick' => $nick,
'url' => $url,
'nurl' => $nurl,
'alias' => $alias,
'request' => $request,
'confirm' => $confirm,
'notify' => $notify,
'poll' => $poll,
'attag' => $attag,
],
['id' => $contact['id'], 'uid' => local_user()]
);
@ -121,9 +111,6 @@ class Advanced extends BaseModule
$this->page['aside'] = Widget\VCard::getHTML($contact);
$warning = $this->t('<strong>WARNING: This is highly advanced</strong> and if you enter incorrect information your communications with this contact may stop working.');
$info = $this->t('Please use your browser \'Back\' button <strong>now</strong> if you are uncertain what to do on this page.');
$returnaddr = "contact/$cid";
// This data is fetched automatically for most networks.
@ -139,22 +126,15 @@ class Advanced extends BaseModule
$tpl = Renderer::getMarkupTemplate('contact/advanced.tpl');
return Renderer::replaceMacros($tpl, [
'$tab_str' => $tab_str,
'$warning' => $warning,
'$info' => $info,
'$returnaddr' => $returnaddr,
'$return' => $this->t('Return to contact editor'),
'$contact_id' => $contact['id'],
'$lbl_submit' => $this->t('Submit'),
'$name' => ['name', $this->t('Name'), $contact['name'], '', '', $readonly],
'$nick' => ['nick', $this->t('Account Nickname'), $contact['nick'], '', '', $readonly],
'$attag' => ['attag', $this->t('@Tagname - overrides Name/Nickname'), $contact['attag']],
'$url' => ['url', $this->t('Account URL'), $contact['url'], '', '', $readonly],
'$alias' => ['alias', $this->t('Account URL Alias'), $contact['alias'], '', '', $readonly],
'$request' => ['request', $this->t('Friend Request URL'), $contact['request'], '', '', $readonly],
'confirm' => ['confirm', $this->t('Friend Confirm URL'), $contact['confirm'], '', '', $readonly],
'notify' => ['notify', $this->t('Notification Endpoint URL'), $contact['notify'], '', '', $readonly],
'poll' => ['poll', $this->t('Poll/Feed URL'), $contact['poll'], '', '', $readonly],
'$nick' => ['nick', $this->t('Account Nickname'), $contact['nick'], '', '', 'readonly'],
'$url' => ['url', $this->t('Account URL'), $contact['url'], '', '', 'readonly'],
'poll' => ['poll', $this->t('Poll/Feed URL'), $contact['poll'], '', '', ($contact['network'] == Protocol::FEED) ? '' : 'readonly'],
'photo' => ['photo', $this->t('New photo from this URL'), '', '', '', $readonly],
]);
}

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 2021.12-rc\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-01-09 12:31-0500\n"
"POT-Creation-Date: 2022-01-12 21:28+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -402,7 +402,7 @@ msgstr ""
#: mod/events.php:519 mod/message.php:201 mod/message.php:357
#: mod/photos.php:927 mod/photos.php:1031 mod/photos.php:1301
#: mod/photos.php:1342 mod/photos.php:1398 mod/photos.php:1472
#: src/Module/Admin/Item/Source.php:65 src/Module/Contact/Advanced.php:147
#: src/Module/Admin/Item/Source.php:65 src/Module/Contact/Advanced.php:132
#: src/Module/Contact/Poke.php:177 src/Module/Contact/Profile.php:327
#: src/Module/Debug/ActivityPubConversion.php:141
#: src/Module/Debug/Babel.php:313 src/Module/Debug/Localtime.php:64
@ -1127,7 +1127,7 @@ msgid "Bad Request."
msgstr ""
#: mod/redir.php:55 mod/redir.php:129 src/Module/Contact/Advanced.php:70
#: src/Module/Contact/Advanced.php:119 src/Module/Contact/Contacts.php:55
#: src/Module/Contact/Advanced.php:109 src/Module/Contact/Contacts.php:55
#: src/Module/Contact/Conversations.php:78
#: src/Module/Contact/Conversations.php:83
#: src/Module/Contact/Conversations.php:88 src/Module/Contact/Media.php:43
@ -1255,7 +1255,7 @@ msgstr ""
#: src/Module/Admin/Users/Active.php:129 src/Module/Admin/Users/Blocked.php:130
#: src/Module/Admin/Users/Create.php:71 src/Module/Admin/Users/Deleted.php:88
#: src/Module/Admin/Users/Index.php:142 src/Module/Admin/Users/Index.php:162
#: src/Module/Admin/Users/Pending.php:104 src/Module/Contact/Advanced.php:149
#: src/Module/Admin/Users/Pending.php:104 src/Module/Contact/Advanced.php:134
msgid "Name"
msgstr ""
@ -7142,59 +7142,27 @@ msgstr ""
msgid "Visit %s's profile [%s]"
msgstr ""
#: src/Module/Contact/Advanced.php:109
#: src/Module/Contact/Advanced.php:99
msgid "Contact update failed."
msgstr ""
#: src/Module/Contact/Advanced.php:124
msgid ""
"<strong>WARNING: This is highly advanced</strong> and if you enter incorrect "
"information your communications with this contact may stop working."
msgstr ""
#: src/Module/Contact/Advanced.php:125
msgid ""
"Please use your browser 'Back' button <strong>now</strong> if you are "
"uncertain what to do on this page."
msgstr ""
#: src/Module/Contact/Advanced.php:145
#: src/Module/Contact/Advanced.php:130
msgid "Return to contact editor"
msgstr ""
#: src/Module/Contact/Advanced.php:150
#: src/Module/Contact/Advanced.php:135
msgid "Account Nickname"
msgstr ""
#: src/Module/Contact/Advanced.php:151
msgid "@Tagname - overrides Name/Nickname"
msgstr ""
#: src/Module/Contact/Advanced.php:152
#: src/Module/Contact/Advanced.php:136
msgid "Account URL"
msgstr ""
#: src/Module/Contact/Advanced.php:153
msgid "Account URL Alias"
msgstr ""
#: src/Module/Contact/Advanced.php:154
msgid "Friend Request URL"
msgstr ""
#: src/Module/Contact/Advanced.php:155
msgid "Friend Confirm URL"
msgstr ""
#: src/Module/Contact/Advanced.php:156
msgid "Notification Endpoint URL"
msgstr ""
#: src/Module/Contact/Advanced.php:157
#: src/Module/Contact/Advanced.php:137
msgid "Poll/Feed URL"
msgstr ""
#: src/Module/Contact/Advanced.php:158
#: src/Module/Contact/Advanced.php:138
msgid "New photo from this URL"
msgstr ""

View File

@ -2,13 +2,6 @@
{{$tab_str nofilter}}
<div class="contact-advanced-error-message">{{$warning nofilter}}</div><br>
<div class="contact-advanced-return">
{{$info nofilter}}<br>
<!-- <a href="{{$returnaddr}}">{{$return}}</a> -->
</div>
<br />
<form id="contact-advanced-form" action="contact/{{$contact_id}}/advanced" method="post">
<!-- <h4>{{$contact_name}}</h4> -->
@ -17,18 +10,8 @@
{{include file="field_input.tpl" field=$nick}}
{{include file="field_input.tpl" field=$attag}}
{{include file="field_input.tpl" field=$url}}
{{include file="field_input.tpl" field=$alias}}
{{include file="field_input.tpl" field=$request}}
{{include file="field_input.tpl" field=$confirm}}
{{include file="field_input.tpl" field=$notify}}
{{include file="field_input.tpl" field=$poll}}
{{include file="field_input.tpl" field=$photo}}

View File

@ -4,13 +4,6 @@
{{$tab_str nofilter}}
<div class="contact-advanced-error-message">{{$warning nofilter}}</div><br>
<div class="contact-advanced-return">
{{$info nofilter}}<br>
<!-- <a href="{{$returnaddr}}">{{$return}}</a> -->
</div>
<br />
<form id="contact-advanced-form" action="contact/{{$contact_id}}/advanced" method="post">
<!-- <h4>{{$contact_name}}</h4> -->
@ -19,18 +12,8 @@
{{include file="field_input.tpl" field=$nick}}
{{include file="field_input.tpl" field=$attag}}
{{include file="field_input.tpl" field=$url}}
{{include file="field_input.tpl" field=$alias}}
{{include file="field_input.tpl" field=$request}}
{{include file="field_input.tpl" field=$confirm}}
{{include file="field_input.tpl" field=$notify}}
{{include file="field_input.tpl" field=$poll}}
{{include file="field_input.tpl" field=$photo}}