Number of preview posts on profile screen

merge-requests/30/head
Bob Mottram 2022-11-26 12:31:02 +00:00
parent c334db95c7
commit b66fa45039
1 changed files with 7 additions and 5 deletions

View File

@ -1072,8 +1072,8 @@ def html_profile(signing_priv_key_pem: str,
translate['Get the source code'] + '" src="/icons/agpl.png" /></a>' translate['Get the source code'] + '" src="/icons/agpl.png" /></a>'
if selected == 'posts': if selected == 'posts':
max_profile_posts = get_max_profile_posts(base_dir, nickname, domain, max_profile_posts = \
20) get_max_profile_posts(base_dir, nickname, domain, 20)
min_images_for_accounts = [] min_images_for_accounts = []
profile_str += \ profile_str += \
_html_profile_posts(recent_posts_cache, max_profile_posts, _html_profile_posts(recent_posts_cache, max_profile_posts,
@ -1092,7 +1092,8 @@ def html_profile(signing_priv_key_pem: str,
signing_priv_key_pem, signing_priv_key_pem,
cw_lists, lists_enabled, cw_lists, lists_enabled,
timezone, bold_reading, {}, timezone, bold_reading, {},
min_images_for_accounts) + license_str min_images_for_accounts,
max_profile_posts) + license_str
if not is_group: if not is_group:
if selected == 'following': if selected == 'following':
profile_str += \ profile_str += \
@ -1167,13 +1168,14 @@ def _html_profile_posts(recent_posts_cache: {}, max_recent_posts: int,
cw_lists: {}, lists_enabled: str, cw_lists: {}, lists_enabled: str,
timezone: str, bold_reading: bool, timezone: str, bold_reading: bool,
dogwhistles: {}, dogwhistles: {},
min_images_for_accounts: []) -> str: min_images_for_accounts: [],
max_profile_posts: int) -> str:
"""Shows posts on the profile screen """Shows posts on the profile screen
These should only be public posts These should only be public posts
""" """
separator_str = html_post_separator(base_dir, None) separator_str = html_post_separator(base_dir, None)
profile_str = '' profile_str = ''
max_items = 4 max_items = max_profile_posts
ctr = 0 ctr = 0
curr_page = 1 curr_page = 1
box_name = 'outbox' box_name = 'outbox'