Move button

merge-requests/30/head
Bob Mottram 2022-11-30 21:33:14 +00:00
parent eea20c559c
commit bc58077eea
2 changed files with 35 additions and 1 deletions

View File

@ -3007,6 +3007,11 @@ class PubServer(BaseHTTPRequestHandler):
if '&' in options_actor: if '&' in options_actor:
options_actor = options_actor.split('&')[0] options_actor = options_actor.split('&')[0]
# actor for the movedTo
options_actor_moved = options_confirm_params.split('movedToActor=')[1]
if '&' in options_actor_moved:
options_actor_moved = options_actor_moved.split('&')[0]
# url of the avatar # url of the avatar
options_avatar_url = options_confirm_params.split('avatarUrl=')[1] options_avatar_url = options_confirm_params.split('avatarUrl=')[1]
if '&' in options_avatar_url: if '&' in options_avatar_url:
@ -3414,6 +3419,24 @@ class PubServer(BaseHTTPRequestHandler):
self.server.postreq_busy = False self.server.postreq_busy = False
return return
# person options screen, move button
# See html_person_options followStr
if '&submitMove=' in options_confirm_params:
if debug:
print('Moving ' + options_actor_moved)
msg = \
html_confirm_follow(self.server.translate,
base_dir,
users_path,
options_actor_moved,
options_avatar_url).encode('utf-8')
msglen = len(msg)
self._set_headers('text/html', msglen,
cookie, calling_domain, False)
self._write(msg)
self.server.postreq_busy = False
return
# person options screen, unfollow button # person options screen, unfollow button
# See html_person_options followStr # See html_person_options followStr
if '&submitUnfollow=' in options_confirm_params or \ if '&submitUnfollow=' in options_confirm_params or \

View File

@ -217,6 +217,10 @@ def html_person_options(default_timeline: str,
options_link_str = \ options_link_str = \
' <input type="hidden" name="postUrl" value="' + \ ' <input type="hidden" name="postUrl" value="' + \
options_link + '">\n' options_link + '">\n'
if moved_to:
options_link_str += \
' <input type="hidden" name="movedToActor" value="' + \
moved_to + '">\n'
css_filename = base_dir + '/epicyon-options.css' css_filename = base_dir + '/epicyon-options.css'
if os.path.isfile(base_dir + '/options.css'): if os.path.isfile(base_dir + '/options.css'):
css_filename = base_dir + '/options.css' css_filename = base_dir + '/options.css'
@ -309,7 +313,14 @@ def html_person_options(default_timeline: str,
' <p class="optionsText">' + \ ' <p class="optionsText">' + \
translate['New account'] + \ translate['New account'] + \
': <a href="' + moved_to + '">@' + new_handle + '</a>' + \ ': <a href="' + moved_to + '">@' + new_handle + '</a>' + \
blocked_icon_str + '</p>\n' blocked_icon_str
if follow_str == 'Unfollow' and not blocked_icon_str:
options_str += \
'<button type="submit" ' + \
'class="button" name="submitMove' + \
'" accesskey="' + access_keys['moveButton'] + '">' + \
translate['Move'] + '</button>'
options_str += '</p>\n'
elif also_known_as: elif also_known_as:
other_accounts_html = \ other_accounts_html = \
' <p class="optionsText">' + \ ' <p class="optionsText">' + \