mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 11:26:56 -08:00
adding hide-read-posts setting for user settings
This commit is contained in:
parent
77745fdfec
commit
c59556fab5
4 changed files with 5 additions and 0 deletions
|
@ -698,6 +698,7 @@ class User(UserMixin, db.Model):
|
|||
|
||||
roles = db.relationship('Role', secondary=user_role, lazy='dynamic', cascade="all, delete")
|
||||
|
||||
hide_read_posts = db.Column(db.Boolean, default=False)
|
||||
read_post = db.relationship(
|
||||
'Post', secondary=read_posts,
|
||||
primaryjoin=(read_posts.c.user_id == id),
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
<h5> Visibility </h5>
|
||||
{{ render_field(form.searchable) }}
|
||||
{{ render_field(form.indexable) }}
|
||||
{{ render_field(form.hide_read_posts) }}
|
||||
<h5> Preferences </h5>
|
||||
{{ render_field(form.interface_language) }}
|
||||
{{ render_field(form.markdown_editor) }}
|
||||
|
|
|
@ -43,6 +43,7 @@ class SettingsForm(FlaskForm):
|
|||
markdown_editor = BooleanField(_l('Use markdown editor GUI when writing'))
|
||||
searchable = BooleanField(_l('Show profile in user list'))
|
||||
indexable = BooleanField(_l('My posts appear in search results'))
|
||||
hide_read_posts = BooleanField(_l('Do not display posts with which I have already interacted (opened/upvote/downvote)'))
|
||||
manually_approves_followers = BooleanField(_l('Manually approve followers'))
|
||||
vote_privately = BooleanField(_l('Vote privately'))
|
||||
sorts = [('hot', _l('Hot')),
|
||||
|
|
|
@ -379,6 +379,7 @@ def user_settings():
|
|||
current_user.newsletter = form.newsletter.data
|
||||
current_user.searchable = form.searchable.data
|
||||
current_user.indexable = form.indexable.data
|
||||
current_user.hide_read_posts = form.hide_read_posts.data
|
||||
current_user.default_sort = form.default_sort.data
|
||||
current_user.default_filter = form.default_filter.data
|
||||
current_user.theme = form.theme.data
|
||||
|
@ -405,6 +406,7 @@ def user_settings():
|
|||
form.email_unread.data = current_user.email_unread
|
||||
form.searchable.data = current_user.searchable
|
||||
form.indexable.data = current_user.indexable
|
||||
form.hide_read_posts.data = current_user.hide_read_posts
|
||||
form.default_sort.data = current_user.default_sort
|
||||
form.default_filter.data = current_user.default_filter
|
||||
form.theme.data = current_user.theme
|
||||
|
|
Loading…
Reference in a new issue