Merge pull request #35 from 64617/frost

Default all sorts to new
This commit is contained in:
Ben Rog-Wilhelm 2022-05-08 22:18:50 -05:00 committed by GitHub
commit edfc35bce2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 9 deletions

View file

@ -51,7 +51,7 @@ class Submission(Base):
flair = Column(String)
ban_reason = Column(String)
embed_url = Column(String)
new = Column(Boolean)
new = Column(Boolean, default=False)
author = relationship("User", primaryjoin="Submission.author_id==User.id")
oauth_app = relationship("OauthApp", viewonly=True)

View file

@ -113,8 +113,8 @@ class User(Base):
mfa_secret = deferred(Column(String))
is_private = Column(Boolean, default=False)
stored_subscriber_count = Column(Integer, default=0)
defaultsortingcomments = Column(String, default="top")
defaultsorting = Column(String, default="hot")
defaultsortingcomments = Column(String, default="new")
defaultsorting = Column(String, default="new")
defaulttime = Column(String, default=defaulttimefilter)
is_nofollow = Column(Boolean, default=False)
custom_filter_list = Column(String)

View file

@ -1112,7 +1112,7 @@ def submit_post(v, sub=None):
club=club,
author_id=v.id,
over_18=bool(request.values.get("over_18","")),
new=bool(request.values.get("new","")),
new=True, # always sort as new by default
app_id=v.client.application.id if v.client else None,
is_bot = is_bot,
url=url,

View file

@ -166,11 +166,6 @@
<label class="custom-control-label" for="followers">Notify followers</label>
</div>
<div class="custom-control custom-checkbox">
<input autocomplete="off" type="checkbox" class="custom-control-input" id="new" name="new">
<label class="custom-control-label" for="new">Make the default comment sorting "new"</label>
</div>
<div class="custom-control custom-checkbox">
<input autocomplete="off" type="checkbox" class="custom-control-input" id="nsfw" name="over_18">
<label class="custom-control-label" for="nsfw">+18</label>