gf
This commit is contained in:
parent
bd28d10ac8
commit
d3167f09bd
4 changed files with 7 additions and 7 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -114,4 +114,4 @@ local.txt
|
||||||
*.scssc
|
*.scssc
|
||||||
.idea/*
|
.idea/*
|
||||||
disablesignups
|
disablesignups
|
||||||
/*rules.md
|
/*rules.html
|
|
@ -147,7 +147,7 @@ def monthly(v):
|
||||||
def get_rules(v):
|
def get_rules(v):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with open(f'./{SITE_NAME} rules.md', 'r') as f:
|
with open(f'./{SITE_NAME} rules.html', 'r') as f:
|
||||||
rules = f.read()
|
rules = f.read()
|
||||||
except Exception:
|
except Exception:
|
||||||
rules = None
|
rules = None
|
||||||
|
@ -162,10 +162,10 @@ def post_rules(v):
|
||||||
|
|
||||||
text = request.form.get('rules', '')
|
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)
|
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()
|
rules = f.read()
|
||||||
|
|
||||||
return render_template('admin/rules.html', v=v, rules=rules)
|
return render_template('admin/rules.html', v=v, rules=rules)
|
||||||
|
|
|
@ -13,13 +13,13 @@ site_name = environ.get("SITE_NAME").strip()
|
||||||
@auth_desired
|
@auth_desired
|
||||||
def static_rules(v):
|
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:
|
if v and v.admin_level == 6:
|
||||||
return render_template('norules.html', v=v)
|
return render_template('norules.html', v=v)
|
||||||
else:
|
else:
|
||||||
abort(404)
|
abort(404)
|
||||||
|
|
||||||
with open('./rules.md', 'r') as f:
|
with open(f'./{site_name} rules.html', 'r') as f:
|
||||||
rules = f.read()
|
rules = f.read()
|
||||||
|
|
||||||
return render_template('rules.html', rules=rules, v=v)
|
return render_template('rules.html', rules=rules, v=v)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{% extends "default.html" %}
|
{% extends "default.html" %}
|
||||||
|
|
||||||
{% block title %}
|
{% block title %}
|
||||||
<title>not configured</title>
|
<title>Not configured</title>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block pagetype %}message{% endblock %}
|
{% block pagetype %}message{% endblock %}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue