Search for following or followers on profile screen

main
Bob Mottram 2022-12-31 22:33:06 +00:00
parent 6cad104d67
commit 21bfb2057f
3 changed files with 26 additions and 2 deletions

View File

@ -1025,7 +1025,8 @@ def html_new_post(edit_post_params: {},
' <input type="text" name="mentions" ' + \ ' <input type="text" name="mentions" ' + \
'list="followingHandles" value="' + mentions_str + '" selected>\n' 'list="followingHandles" value="' + mentions_str + '" selected>\n'
new_post_form += \ new_post_form += \
html_following_data_list(base_dir, nickname, domain, domain_full) html_following_data_list(base_dir, nickname, domain, domain_full,
'following')
new_post_form += '' new_post_form += ''
selected_str = '' selected_str = ''

View File

@ -63,6 +63,7 @@ from filters import is_filtered
from follow import is_follower_of_person from follow import is_follower_of_person
from follow import get_follower_domains from follow import get_follower_domains
from webapp_frontscreen import html_front_screen from webapp_frontscreen import html_front_screen
from webapp_utils import html_following_data_list
from webapp_utils import edit_number_field from webapp_utils import edit_number_field
from webapp_utils import html_keyboard_navigation from webapp_utils import html_keyboard_navigation
from webapp_utils import html_hide_from_screen_reader from webapp_utils import html_hide_from_screen_reader
@ -1098,6 +1099,28 @@ def html_profile(signing_priv_key_pem: str,
profile_str += ' </center>' profile_str += ' </center>'
profile_str += '</div>' profile_str += '</div>'
# search for following or followers
if authorized:
if selected in ('following', 'followers'):
follow_search_str = '<div class="container">\n'
follow_search_str += \
'<form method="POST" action="' + users_path + \
'/searchhandle?page=1">\n'
follow_search_str += \
' <input type="hidden" ' + \
'name="actor" value="' + actor + '">\n'
follow_search_str += \
' <input type="text" name="searchtext" ' + \
'list="' + selected + 'Handles" value="">\n'
follow_search_str += \
html_following_data_list(base_dir, nickname, domain,
domain_full, selected)
follow_search_str += \
' <button type="submit" class="button" ' + \
'name="submitSearch">' + translate['Search'] + '</button>\n'
follow_search_str += '</form>\n</div>\n'
profile_str += follow_search_str
# start of #timeline # start of #timeline
profile_str += '<div id="timeline">\n' profile_str += '<div id="timeline">\n'

View File

@ -1971,7 +1971,7 @@ def get_default_path(media_instance: bool, blogs_instance: bool,
def html_following_data_list(base_dir: str, nickname: str, def html_following_data_list(base_dir: str, nickname: str,
domain: str, domain_full: str, domain: str, domain_full: str,
following_type: str = "following") -> str: following_type: str) -> str:
"""Returns a datalist of handles being followed """Returns a datalist of handles being followed
followingHandles, followersHandles followingHandles, followersHandles
""" """