Searchable by doesn't apply to dms

merge-requests/30/head
Bob Mottram 2024-10-12 12:04:56 +01:00
parent 9e433abe4b
commit e6f9fa6740
1 changed files with 24 additions and 23 deletions

View File

@ -991,29 +991,30 @@ def html_new_post(edit_post_params: {},
replies_section += languages_dropdown replies_section += languages_dropdown
# searchable by dropdown # searchable by dropdown
searchables = { if endpoint != 'newdm':
'yourself': translate['Yourself'], searchables = {
'public': translate['Public'], 'yourself': translate['Yourself'],
'followers': translate['Followers'], 'public': translate['Public'],
'mutuals': translate['Mutuals'] 'followers': translate['Followers'],
} 'mutuals': translate['Mutuals']
searchable_by_dropdown = '<select id="themeDropdown" ' + \ }
'name="searchableByDropdown" class="theme">' searchable_by_dropdown = '<select id="themeDropdown" ' + \
if not searchable_by_default: 'name="searchableByDropdown" class="theme">'
searchable_by_default = 'yourself' if not searchable_by_default:
for srch, srch_text in searchables.items(): searchable_by_default = 'yourself'
if srch != searchable_by_default: for srch, srch_text in searchables.items():
searchable_by_dropdown += \ if srch != searchable_by_default:
' <option value="' + srch + '">' + \ searchable_by_dropdown += \
srch_text + '</option>' ' <option value="' + srch + '">' + \
else: srch_text + '</option>'
searchable_by_dropdown += \ else:
' <option value="' + srch + '" selected="">' + \ searchable_by_dropdown += \
srch_text + '</option>' ' <option value="' + srch + '" selected="">' + \
replies_section += \ srch_text + '</option>'
' <label class="labels">🔎 ' + \ replies_section += \
translate['Searchable by'] + '</label>\n' ' <label class="labels">🔎 ' + \
replies_section += searchable_by_dropdown translate['Searchable by'] + '</label>\n'
replies_section += searchable_by_dropdown
# buy link # buy link
buy_link_str = translate['Buy link'] buy_link_str = translate['Buy link']