default comment sorts to new

This commit is contained in:
64617 2022-05-09 10:51:27 +08:00
parent 5b09b72206
commit 7c18978c54
3 changed files with 4 additions and 8 deletions

View file

@ -65,6 +65,7 @@ class Submission(Base):
def __init__(self, *args, **kwargs):
if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time())
if 'new' in kwargs: kwargs['new'] = True # Always default to sort by new
super().__init__(*args, **kwargs)
def __repr__(self):
@ -485,4 +486,4 @@ class Submission(Base):
return False
@lazy
def active_flags(self, v): return len(self.flags(v))
def active_flags(self, v): return len(self.flags(v))

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>
@ -236,4 +231,4 @@
</body>
</html>
</html>