refactor poorcel mode

remotes/1693176582716663532/tmp_refs/heads/watchparty
Aevann1 2022-10-25 18:07:40 +02:00
parent ac43522570
commit fbeac461ca
7 changed files with 8 additions and 44 deletions

View File

@ -79,7 +79,6 @@ class User(Base):
over_18 = Column(Boolean, default=False)
hidevotedon = Column(Boolean, default=False)
highlightcomments = Column(Boolean, default=True)
poorcel = Column(Boolean, default=False)
slurreplacer = Column(Boolean, default=True)
flairchanged = Column(Integer)
newtab = Column(Boolean, default=False)

View File

@ -211,7 +211,7 @@ def post_id(pid, anything=None, v=None, sub=None):
offset = 0
ids = set()
if v and v.poorcel: threshold = 50
if v and v.poor: threshold = 50
else: threshold = 100
if post.comment_count > threshold+25 and not (v and v.client) and not request.values.get("all"):

View File

@ -46,10 +46,10 @@ def settings_profile_post(v):
updated = 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
v.poorcel = request.values.get("poorcel") == 'true'
session['poor'] = v.poorcel
v.poor = request.values.get("poor") == 'true'
session['poor'] = v.poor
elif request.values.get("hidevotedon", v.hidevotedon) != v.hidevotedon:
updated = True

View File

@ -163,13 +163,6 @@ def user_upvoted_comments(v, username):
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")
@auth_required
def grassed(v):

View File

@ -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 %}

View File

@ -11,19 +11,19 @@
<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="d-lg-flex border-bottom">
<div class="title w-lg-25">
<label for="poorcel">Poorcel Mode</label>
<label for="poor">Poor Mode</label>
</div>
<div class="body w-lg-100">
<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);">
<label class="custom-control-label" for="poorcel"></label>
<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="poor"></label>
</div>
<span class="text-small text-muted">Makes the site much faster for low-end devices.</span>

View File

@ -1007,7 +1007,6 @@ CREATE TABLE public.users (
total_lottery_winnings integer DEFAULT 0 NOT NULL,
offsitementions boolean DEFAULT false NOT NULL,
last_active integer DEFAULT 0 NOT NULL,
poorcel boolean DEFAULT false NOT NULL,
last_viewed_post_notifs integer NOT NULL,
pronouns character varying(11) NOT NULL,
last_viewed_log_notifs integer NOT NULL,
@ -2681,4 +2680,3 @@ ALTER TABLE ONLY public.comment_option_votes
--
-- PostgreSQL database dump complete
--