Remove hot posts button from mobile interface (#38)
This commit also cleans up some remnants of the previous default sort orders.
This commit is contained in:
parent
728260e4ad
commit
0bab69947a
6 changed files with 6 additions and 19 deletions
|
@ -51,7 +51,6 @@ class Submission(Base):
|
|||
flair = Column(String)
|
||||
ban_reason = Column(String)
|
||||
embed_url = Column(String)
|
||||
new = Column(Boolean, default=False)
|
||||
|
||||
author = relationship("User", primaryjoin="Submission.author_id==User.id")
|
||||
oauth_app = relationship("OauthApp", viewonly=True)
|
||||
|
|
|
@ -105,7 +105,7 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None, sub=None):
|
|||
top_comment = c
|
||||
|
||||
if v: defaultsortingcomments = v.defaultsortingcomments
|
||||
else: defaultsortingcomments = "top"
|
||||
else: defaultsortingcomments = "new"
|
||||
sort=request.values.get("sort", defaultsortingcomments)
|
||||
|
||||
if v:
|
||||
|
|
|
@ -179,7 +179,7 @@ def front_all(v, sub=None, subdomain=None):
|
|||
if sub or SITE_NAME != 'rDrama': defaulttime = 'all'
|
||||
else: defaulttime = v.defaulttime
|
||||
else:
|
||||
defaultsorting = "hot"
|
||||
defaultsorting = "new"
|
||||
if sub or SITE_NAME != 'rDrama': defaulttime = 'all'
|
||||
else: defaulttime = defaulttimefilter
|
||||
|
||||
|
|
|
@ -129,9 +129,8 @@ def post_id(pid, anything=None, v=None, sub=None):
|
|||
if request.headers.get("Authorization") or request.headers.get("xhr"): return {"error":"Must be 18+ to view"}, 451
|
||||
return render_template("errors/nsfw.html", v=v)
|
||||
|
||||
if post.new or 'megathread' in post.title.lower(): defaultsortingcomments = 'new'
|
||||
elif v: defaultsortingcomments = v.defaultsortingcomments
|
||||
else: defaultsortingcomments = "top"
|
||||
if v: defaultsortingcomments = v.defaultsortingcomments
|
||||
else: defaultsortingcomments = "new"
|
||||
sort = request.values.get("sort", defaultsortingcomments)
|
||||
|
||||
if post.club and not (v and (v.paid_dues or v.id == post.author_id)): abort(403)
|
||||
|
|
|
@ -11,16 +11,6 @@
|
|||
</div>
|
||||
</a>
|
||||
</button>
|
||||
{% if v and v.defaultsorting == 'new' %}
|
||||
<button class="col px-0 btn btn-dead m-0" style="background: None !important; border: None;">
|
||||
<a href="/?sort=hot&t=all" class="text-decoration-none" role="button">
|
||||
<div class="text-center {% if request.full_path=='/?sort=hot&t=all' %}text-primary{% else %}text-muted{% endif %}">
|
||||
<i class="fas fa-fire text-lg"></i>
|
||||
<div class="text-small">Hot</div>
|
||||
</div>
|
||||
</a>
|
||||
</button>
|
||||
{% else %}
|
||||
<button class="col px-0 btn btn-dead m-0" style="background: None !important; border: None;">
|
||||
<a href="/?sort=new&t=all" class="text-decoration-none" role="button">
|
||||
<div class="text-center {% if request.full_path=='/?sort=new&t=all' %}text-primary{% else %}text-muted{% endif %}">
|
||||
|
@ -29,7 +19,6 @@
|
|||
</div>
|
||||
</a>
|
||||
</button>
|
||||
{% endif %}
|
||||
<button class="col px-2 btn btn-dead m-0" style="background: None !important; border: None;">
|
||||
<a href="/comments" class="text-decoration-none" role="button">
|
||||
<div class="text-center {% if request.path=='/comments' %}text-primary{% else %}text-muted{% endif %}">
|
||||
|
|
|
@ -565,7 +565,7 @@ CREATE TABLE public.users (
|
|||
ban_evade integer DEFAULT 0 NOT NULL,
|
||||
original_username character varying(255),
|
||||
customtitle character varying(1000),
|
||||
defaultsorting character varying(15) DEFAULT 'hot'::character varying NOT NULL,
|
||||
defaultsorting character varying(15) DEFAULT 'new'::character varying NOT NULL,
|
||||
defaulttime character varying(5) NOT NULL,
|
||||
namecolor character varying(6) NOT NULL,
|
||||
titlecolor character varying(6) NOT NULL,
|
||||
|
@ -574,7 +574,7 @@ CREATE TABLE public.users (
|
|||
hidevotedon boolean DEFAULT false NOT NULL,
|
||||
newtab boolean DEFAULT false NOT NULL,
|
||||
flairchanged integer,
|
||||
defaultsortingcomments character varying(15) DEFAULT 'top'::character varying NOT NULL,
|
||||
defaultsortingcomments character varying(15) DEFAULT 'new'::character varying NOT NULL,
|
||||
theme character varying(15) NOT NULL,
|
||||
song character varying(50),
|
||||
slurreplacer boolean DEFAULT true NOT NULL,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue