forked from rDrama/rDrama
refactor poorcel mode
parent
ac43522570
commit
fbeac461ca
|
@ -79,7 +79,6 @@ class User(Base):
|
||||||
over_18 = Column(Boolean, default=False)
|
over_18 = Column(Boolean, default=False)
|
||||||
hidevotedon = Column(Boolean, default=False)
|
hidevotedon = Column(Boolean, default=False)
|
||||||
highlightcomments = Column(Boolean, default=True)
|
highlightcomments = Column(Boolean, default=True)
|
||||||
poorcel = Column(Boolean, default=False)
|
|
||||||
slurreplacer = Column(Boolean, default=True)
|
slurreplacer = Column(Boolean, default=True)
|
||||||
flairchanged = Column(Integer)
|
flairchanged = Column(Integer)
|
||||||
newtab = Column(Boolean, default=False)
|
newtab = Column(Boolean, default=False)
|
||||||
|
|
|
@ -211,7 +211,7 @@ def post_id(pid, anything=None, v=None, sub=None):
|
||||||
offset = 0
|
offset = 0
|
||||||
ids = set()
|
ids = set()
|
||||||
|
|
||||||
if v and v.poorcel: threshold = 50
|
if v and v.poor: threshold = 50
|
||||||
else: threshold = 100
|
else: threshold = 100
|
||||||
|
|
||||||
if post.comment_count > threshold+25 and not (v and v.client) and not request.values.get("all"):
|
if post.comment_count > threshold+25 and not (v and v.client) and not request.values.get("all"):
|
||||||
|
|
|
@ -46,10 +46,10 @@ def settings_profile_post(v):
|
||||||
updated = True
|
updated = True
|
||||||
v.slurreplacer = request.values.get("slurreplacer") == 'true'
|
v.slurreplacer = request.values.get("slurreplacer") == 'true'
|
||||||
|
|
||||||
elif request.values.get("poorcel", v.poor) != v.poor:
|
elif request.values.get("poor", v.poor) != v.poor:
|
||||||
updated = True
|
updated = True
|
||||||
v.poorcel = request.values.get("poorcel") == 'true'
|
v.poor = request.values.get("poor") == 'true'
|
||||||
session['poor'] = v.poorcel
|
session['poor'] = v.poor
|
||||||
|
|
||||||
elif request.values.get("hidevotedon", v.hidevotedon) != v.hidevotedon:
|
elif request.values.get("hidevotedon", v.hidevotedon) != v.hidevotedon:
|
||||||
updated = True
|
updated = True
|
||||||
|
|
|
@ -163,13 +163,6 @@ def user_upvoted_comments(v, username):
|
||||||
return user_voted(v, username, Comment, CommentVote, 1, "voted_comments.html", True)
|
return user_voted(v, username, Comment, CommentVote, 1, "voted_comments.html", True)
|
||||||
|
|
||||||
|
|
||||||
@app.get("/poorcels")
|
|
||||||
@auth_required
|
|
||||||
def poorcels(v):
|
|
||||||
users = g.db.query(User).filter_by(poorcel=True).all()
|
|
||||||
return render_template("poorcels.html", v=v, users=users)
|
|
||||||
|
|
||||||
|
|
||||||
@app.get("/grassed")
|
@app.get("/grassed")
|
||||||
@auth_required
|
@auth_required
|
||||||
def grassed(v):
|
def grassed(v):
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
{% extends "default.html" %}
|
|
||||||
{% block content %}
|
|
||||||
<pre>
|
|
||||||
|
|
||||||
|
|
||||||
</pre>
|
|
||||||
<h5>Poorcels</h5>
|
|
||||||
<pre></pre>
|
|
||||||
<div class="overflow-x-auto"><table class="table table-striped mb-5">
|
|
||||||
<thead class="bg-primary text-white">
|
|
||||||
<tr>
|
|
||||||
<th>#</th>
|
|
||||||
<th>Name</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody id="followers-table">
|
|
||||||
{% for user in users %}
|
|
||||||
<tr>
|
|
||||||
<td>{{loop.index}}</td>
|
|
||||||
<td>{% include "user_in_table.html" %}</td>
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
{% endblock %}
|
|
|
@ -11,19 +11,19 @@
|
||||||
|
|
||||||
<div class="settings">
|
<div class="settings">
|
||||||
|
|
||||||
<h2 class="h5" name="referral">Poorcel Mode</h2>
|
<h2 class="h5" name="referral">Poor Mode</h2>
|
||||||
|
|
||||||
<div class="settings-section rounded">
|
<div class="settings-section rounded">
|
||||||
<div class="d-lg-flex border-bottom">
|
<div class="d-lg-flex border-bottom">
|
||||||
<div class="title w-lg-25">
|
<div class="title w-lg-25">
|
||||||
<label for="poorcel">Poorcel Mode</label>
|
<label for="poor">Poor Mode</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="body w-lg-100">
|
<div class="body w-lg-100">
|
||||||
|
|
||||||
<div class="custom-control custom-switch">
|
<div class="custom-control custom-switch">
|
||||||
<input autocomplete="off" type="checkbox" class="custom-control-input" id="poorcel" name="poorcel"{% if v.poor %} checked{% endif %} onchange="post_toast(this,'/settings/profile?poorcel='+document.getElementById('poorcel').checked);">
|
<input autocomplete="off" type="checkbox" class="custom-control-input" id="poor" name="poor"{% if v.poor %} checked{% endif %} onchange="post_toast(this,'/settings/profile?poor='+document.getElementById('poor').checked);">
|
||||||
<label class="custom-control-label" for="poorcel"></label>
|
<label class="custom-control-label" for="poor"></label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<span class="text-small text-muted">Makes the site much faster for low-end devices.</span>
|
<span class="text-small text-muted">Makes the site much faster for low-end devices.</span>
|
||||||
|
|
|
@ -1007,7 +1007,6 @@ CREATE TABLE public.users (
|
||||||
total_lottery_winnings integer DEFAULT 0 NOT NULL,
|
total_lottery_winnings integer DEFAULT 0 NOT NULL,
|
||||||
offsitementions boolean DEFAULT false NOT NULL,
|
offsitementions boolean DEFAULT false NOT NULL,
|
||||||
last_active integer DEFAULT 0 NOT NULL,
|
last_active integer DEFAULT 0 NOT NULL,
|
||||||
poorcel boolean DEFAULT false NOT NULL,
|
|
||||||
last_viewed_post_notifs integer NOT NULL,
|
last_viewed_post_notifs integer NOT NULL,
|
||||||
pronouns character varying(11) NOT NULL,
|
pronouns character varying(11) NOT NULL,
|
||||||
last_viewed_log_notifs integer NOT NULL,
|
last_viewed_log_notifs integer NOT NULL,
|
||||||
|
@ -2681,4 +2680,3 @@ ALTER TABLE ONLY public.comment_option_votes
|
||||||
--
|
--
|
||||||
-- PostgreSQL database dump complete
|
-- PostgreSQL database dump complete
|
||||||
--
|
--
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue