mirror of https://gitlab.com/bashrc2/epicyon
Separate function for profile background
parent
aaf19268ea
commit
2b2fd4fde1
|
@ -68,7 +68,7 @@ from webapp_utils import html_header_with_external_style
|
||||||
from webapp_utils import html_header_with_person_markup
|
from webapp_utils import html_header_with_person_markup
|
||||||
from webapp_utils import html_footer
|
from webapp_utils import html_footer
|
||||||
from webapp_utils import add_emoji_to_display_name
|
from webapp_utils import add_emoji_to_display_name
|
||||||
from webapp_utils import get_banner_file
|
from webapp_utils import get_profile_background_file
|
||||||
from webapp_utils import html_post_separator
|
from webapp_utils import html_post_separator
|
||||||
from webapp_utils import edit_check_box
|
from webapp_utils import edit_check_box
|
||||||
from webapp_utils import edit_text_field
|
from webapp_utils import edit_text_field
|
||||||
|
@ -420,7 +420,7 @@ def _get_profile_header(base_dir: str, http_prefix: str, nickname: str,
|
||||||
image and avatar
|
image and avatar
|
||||||
"""
|
"""
|
||||||
banner_file, _ = \
|
banner_file, _ = \
|
||||||
get_banner_file(base_dir, nickname, domain, theme)
|
get_profile_background_file(base_dir, nickname, domain, theme)
|
||||||
html_str = \
|
html_str = \
|
||||||
'\n\n <figure class="profileHeader">\n' + \
|
'\n\n <figure class="profileHeader">\n' + \
|
||||||
' <a href="/users/' + \
|
' <a href="/users/' + \
|
||||||
|
@ -2304,7 +2304,7 @@ def html_edit_profile(server, translate: {},
|
||||||
|
|
||||||
# filename of the banner shown at the top
|
# filename of the banner shown at the top
|
||||||
banner_file, _ = \
|
banner_file, _ = \
|
||||||
get_banner_file(base_dir, nickname, domain, theme)
|
get_profile_background_file(base_dir, nickname, domain, theme)
|
||||||
|
|
||||||
display_nickname = nickname
|
display_nickname = nickname
|
||||||
is_bot = is_group = follow_dms = remove_twitter = ''
|
is_bot = is_group = follow_dms = remove_twitter = ''
|
||||||
|
|
|
@ -548,8 +548,6 @@ def _get_image_file(base_dir: str, name: str, directory: str,
|
||||||
banner_file = ''
|
banner_file = ''
|
||||||
banner_filename = ''
|
banner_filename = ''
|
||||||
im_name = name
|
im_name = name
|
||||||
if name == 'banner':
|
|
||||||
im_name = 'image'
|
|
||||||
for ext in banner_extensions:
|
for ext in banner_extensions:
|
||||||
banner_file_test = im_name + '.' + ext
|
banner_file_test = im_name + '.' + ext
|
||||||
banner_filename_test = directory + '/' + banner_file_test
|
banner_filename_test = directory + '/' + banner_file_test
|
||||||
|
@ -578,6 +576,15 @@ def get_banner_file(base_dir: str,
|
||||||
return _get_image_file(base_dir, 'banner', account_dir, theme)
|
return _get_image_file(base_dir, 'banner', account_dir, theme)
|
||||||
|
|
||||||
|
|
||||||
|
def get_profile_background_file(base_dir: str,
|
||||||
|
nickname: str, domain: str,
|
||||||
|
theme: str) -> (str, str):
|
||||||
|
"""Gets the image for the profile background
|
||||||
|
"""
|
||||||
|
account_dir = acct_dir(base_dir, nickname, domain)
|
||||||
|
return _get_image_file(base_dir, 'image', account_dir, theme)
|
||||||
|
|
||||||
|
|
||||||
def get_search_banner_file(base_dir: str,
|
def get_search_banner_file(base_dir: str,
|
||||||
nickname: str, domain: str,
|
nickname: str, domain: str,
|
||||||
theme: str) -> (str, str):
|
theme: str) -> (str, str):
|
||||||
|
|
Loading…
Reference in New Issue