Implement a serializer for user preferences (#336)

This commit is contained in:
Jeidnx 2024-12-02 17:29:57 +01:00 committed by GitHub
parent e4fc22cf90
commit d7ec07cd0d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 70 additions and 5 deletions

View file

@ -161,8 +161,16 @@
{% endif %}
<div id="settings_note">
<p><b>Note:</b> settings and subscriptions are saved in browser cookies. Clearing your cookies will reset them.</p><br>
<p>You can restore your current settings and subscriptions after clearing your cookies using <a href="/settings/restore/?theme={{ prefs.theme }}&front_page={{ prefs.front_page }}&layout={{ prefs.layout }}&wide={{ prefs.wide }}&post_sort={{ prefs.post_sort }}&comment_sort={{ prefs.comment_sort }}&show_nsfw={{ prefs.show_nsfw }}&use_hls={{ prefs.use_hls }}&hide_hls_notification={{ prefs.hide_hls_notification }}&hide_awards={{ prefs.hide_awards }}&fixed_navbar={{ prefs.fixed_navbar }}&subscriptions={{ prefs.subscriptions.join("%2B") }}&filters={{ prefs.filters.join("%2B") }}">this link</a>.</p>
<p><b>Note:</b> settings and subscriptions are saved in browser cookies. Clearing your cookies will reset them.</p>
<br>
{% match prefs.to_urlencoded() %}
{% when Ok with (encoded_prefs) %}
<p>You can restore your current settings and subscriptions after clearing your cookies using <a
href="/settings/restore/?{{ encoded_prefs }}">this link</a>.</p>
{% when Err with (err) %}
<p>There was an error creating your restore link: {{ err }}</p>
<p>Please report this issue</p>
{% endmatch %}
</div>
</div>