forked from MarseyWorld/MarseyWorld
master
parent
ac57d13c2e
commit
b5e446b829
|
@ -114,4 +114,4 @@ local.txt
|
|||
*.scssc
|
||||
.idea/*
|
||||
disablesignups
|
||||
/*rules.md
|
||||
/*rules.html
|
|
@ -147,7 +147,7 @@ def monthly(v):
|
|||
def get_rules(v):
|
||||
|
||||
try:
|
||||
with open(f'./{SITE_NAME} rules.md', 'r') as f:
|
||||
with open(f'./{SITE_NAME} rules.html', 'r') as f:
|
||||
rules = f.read()
|
||||
except Exception:
|
||||
rules = None
|
||||
|
@ -162,10 +162,10 @@ def post_rules(v):
|
|||
|
||||
text = request.form.get('rules', '')
|
||||
|
||||
with open(f'./{SITE_NAME} rules.md', 'w+') as f:
|
||||
with open(f'./{SITE_NAME} rules.html', 'w+') as f:
|
||||
f.write(text)
|
||||
|
||||
with open(f'./{SITE_NAME} rules.md', 'r') as f:
|
||||
with open(f'./{SITE_NAME} rules.html', 'r') as f:
|
||||
rules = f.read()
|
||||
|
||||
return render_template('admin/rules.html', v=v, rules=rules)
|
||||
|
|
|
@ -13,13 +13,13 @@ site_name = environ.get("SITE_NAME").strip()
|
|||
@auth_desired
|
||||
def static_rules(v):
|
||||
|
||||
if not path.exists('./rules.md'):
|
||||
if not path.exists(f'./{site_name} rules.html'):
|
||||
if v and v.admin_level == 6:
|
||||
return render_template('norules.html', v=v)
|
||||
else:
|
||||
abort(404)
|
||||
|
||||
with open('./rules.md', 'r') as f:
|
||||
with open(f'./{site_name} rules.html', 'r') as f:
|
||||
rules = f.read()
|
||||
|
||||
return render_template('rules.html', rules=rules, v=v)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{% extends "default.html" %}
|
||||
|
||||
{% block title %}
|
||||
<title>not configured</title>
|
||||
<title>Not configured</title>
|
||||
{% endblock %}
|
||||
|
||||
{% block pagetype %}message{% endblock %}
|
||||
|
|
Loading…
Reference in New Issue