remotes/1693045480750635534/spooky-22
Aevann1 2022-01-08 08:41:40 +02:00
parent 42c37ecf75
commit 94232d5d90
7 changed files with 99 additions and 7 deletions

View File

@ -164,6 +164,16 @@ ACTIONTYPES={
"icon": "fa-columns",
"color": "bg-muted",
},
"disable_signups": {
"str": "disabled signups",
"icon": "fa-user-slash",
"color": "bg-danger",
},
"enable_signups": {
"str": "enabled signups",
"icon": "fa-user",
"color": "bg-success",
},
"ban_user":{
"str":'banned user {self.target_link}',
"icon":"fa-user-slash",

View File

@ -361,7 +361,7 @@ def admin_home(v):
return render_template("CHRISTMAS/admin/admin_home.html", actions=actions, v=v, x=x)
@app.post("/admin/disablesignups")
@admin_level_required(2)
@admin_level_required(3)
@validate_formkey
def disablesignups(v):
with open('disablesignups', 'r') as f: content = f.read()
@ -369,9 +369,21 @@ def disablesignups(v):
with open('disablesignups', 'w') as f:
if content == "yes":
f.write("no")
return {"message": "Signups enabed!"}
ma = ModAction(
kind="enable_signups",
user_id=v.id,
)
g.db.add(ma)
g.db.commit()
return {"message": "Signups enabled!"}
else:
f.write("yes")
ma = ModAction(
kind="disable_signups",
user_id=v.id,
)
g.db.add(ma)
g.db.commit()
return {"message": "Signups disabled!"}
@app.get("/admin/badge_grant")

View File

@ -22,6 +22,11 @@ def privacy(v):
def emojis(v):
return render_template("marseys.html", v=v, marseys=marseys.items())
@app.get("/terms")
@auth_desired
def terms(v):
return render_template("terms.html", v=v)
@app.get('/sidebar')
@auth_desired
def sidebar(v):

View File

@ -56,9 +56,11 @@
<li><a href="/admin/sidebar">Edit Sidebar</a></li>
</ul>
<div class="custom-control custom-switch">
<input autocomplete="off" type="checkbox" class="custom-control-input" id="disablesignups" name="disablesignups" {% if x == "yes" %}checked{% endif %} onchange="post_toast('/admin/disablesignups');">
<label class="custom-control-label" for="disablesignups">Disable signups</label>
</div>
{% if v.admin_level > 2 %}
<div class="custom-control custom-switch">
<input autocomplete="off" type="checkbox" class="custom-control-input" id="disablesignups" name="disablesignups" {% if x == "yes" %}checked{% endif %} onchange="post_toast('/admin/disablesignups');">
<label class="custom-control-label" for="disablesignups">Disable signups</label>
</div>
{% endif %}
{% endblock %}

View File

@ -88,6 +88,13 @@
<button class="btn btn-primary login w-100 mt-3" id="login_button">Sign in</button>
{% if g.webview %} <div class="custom-control custom-checkbox mt-4">
<input autocomplete="off" type="checkbox" class="custom-control-input" id="termsCheck" required>
<label class="custom-control-label terms" for="termsCheck">I accept the <a
href="/terms" {% if v and v.newtab and not g.webview %}target="_blank"{% endif %}>terms of use</a></label>
</div>
{% endif %}
<div class="text-center text-muted text-small mt-5 mb-3">
Don't have an account? <a href="/signup{{'?redirect='+redirect if redirect else ''}}" class="font-weight-bold toggle-login">Sign up</a>
</div>

View File

@ -112,7 +112,12 @@
<div class="custom-control custom-checkbox mt-4">
<input autocomplete="off" type="checkbox" class="custom-control-input" id="termsCheck" required>
<label class="custom-control-label terms" for="termsCheck">I accept the <a
href="/sidebar" {% if v and v.newtab and not g.webview %}target="_blank"{% endif %}>terms and conditions</a></label>
{% if g.webview %}
href="/terms">terms of use
{% else %}
href="/sidebar">rules
{% endif %}
</a></label>
</div>
{% if hcaptcha %}

View File

@ -0,0 +1,51 @@
{% extends "default.html" %}
{% block title %}
<title>{{'SITE_NAME' | app_config}} Terms of use</title>
{% endblock %}
{% block content %}
<pre>
</pre>
<div class="mx-4 mt-2 mb-6">
<h5 class="text-muted text-uppercase">{{'SITE_NAME'|app_config}} Terms of use</h5>
<div id="rules" class="my-3">
<p>By using Drama you agree to abstain from posting or submitting to any of the following. Additionally, you warrant that anything posted or submitted by you complies with this code of conduct.</p>
<hr>
<h2 class="h3">Legal</h2>
<p><u>Copyright:</u> You may not post anything copyrighted by another party or material not properly licensed to you.</p>
<p><u>United States Law:</u> You may not post anything not legal to publish within or export from the United States of America.</p>
<h2 class="h3" id="safety">Safety</h2>
<p><u>Harrasment:</u> You may not post anything that harasses or encourages of others either online or offline.</p>
<p><u>Personal Information:</u> Posting or publishing personal or confidential information is stricly prohibited.</p>
<p><u>Solicitation:</u> You may not post anything that solicits transactions</p>
<p><u>Malicious material:</u> Anything that is digitally malicious is strictly prohibited from being posted.</p>
<p><u>Impersonation:</u> You many not post anything that impersonates other Drama users, moderators, or administrations.</p>
<p><u>Spam:</u> Spam material is strictly prohibited from being posted on Drama.</p>
<h2 class="h3" id="sensitive-content">Sexuality</h2>
<p><u>Pornographic material:</u> You may not post anything that is pornographic in nature. We value Drama as an Internet-based public square. And we qualify pornographic material as indecent exposure in such a setting.</p>
<p><u>Sexual or sexually suggestive material:</u> Any sexual or sexually suggestive material must be marked "NSFW"</p>
<p><u>Content involving minors:</u> Drama has zero tolerance for sexual or sexually suggestive material involving minors. Any material that violates this rule will result in a permanent ban.</p>
</div>
</div>
{% endblock %}