add contact information to config
This commit is contained in:
@@ -8,7 +8,7 @@ from .constants import (
|
|||||||
PermissionLevel, permission_level_string,
|
PermissionLevel, permission_level_string,
|
||||||
InfoboxKind, InfoboxHTMLClass,
|
InfoboxKind, InfoboxHTMLClass,
|
||||||
REACTION_EMOJI, MOTD_BANNED_TAGS,
|
REACTION_EMOJI, MOTD_BANNED_TAGS,
|
||||||
SIG_BANNED_TAGS,
|
SIG_BANNED_TAGS, STRICT_BANNED_TAGS,
|
||||||
)
|
)
|
||||||
from .lib.babycode import babycode_to_html, EMOJI, BABYCODE_VERSION
|
from .lib.babycode import babycode_to_html, EMOJI, BABYCODE_VERSION
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
@@ -149,6 +149,7 @@ def create_app():
|
|||||||
from app.routes.api import bp as api_bp
|
from app.routes.api import bp as api_bp
|
||||||
from app.routes.posts import bp as posts_bp
|
from app.routes.posts import bp as posts_bp
|
||||||
from app.routes.hyperapi import bp as hyperapi_bp
|
from app.routes.hyperapi import bp as hyperapi_bp
|
||||||
|
from app.routes.guides import bp as guides_bp
|
||||||
app.register_blueprint(app_bp)
|
app.register_blueprint(app_bp)
|
||||||
app.register_blueprint(topics_bp)
|
app.register_blueprint(topics_bp)
|
||||||
app.register_blueprint(threads_bp)
|
app.register_blueprint(threads_bp)
|
||||||
@@ -157,6 +158,7 @@ def create_app():
|
|||||||
app.register_blueprint(api_bp)
|
app.register_blueprint(api_bp)
|
||||||
app.register_blueprint(posts_bp)
|
app.register_blueprint(posts_bp)
|
||||||
app.register_blueprint(hyperapi_bp)
|
app.register_blueprint(hyperapi_bp)
|
||||||
|
app.register_blueprint(guides_bp)
|
||||||
|
|
||||||
app.config['SESSION_COOKIE_SECURE'] = True
|
app.config['SESSION_COOKIE_SECURE'] = True
|
||||||
|
|
||||||
@@ -212,6 +214,10 @@ def create_app():
|
|||||||
def babycode_filter(markup):
|
def babycode_filter(markup):
|
||||||
return babycode_to_html(markup).result
|
return babycode_to_html(markup).result
|
||||||
|
|
||||||
|
@app.template_filter('babycode_strict')
|
||||||
|
def babycode_strict_filter(markup):
|
||||||
|
return babycode_to_html(markup, STRICT_BANNED_TAGS).result
|
||||||
|
|
||||||
@app.template_filter('extract_h2')
|
@app.template_filter('extract_h2')
|
||||||
def extract_h2(content):
|
def extract_h2(content):
|
||||||
import re
|
import re
|
||||||
|
|||||||
@@ -48,11 +48,16 @@ REACTION_EMOJI = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
MOTD_BANNED_TAGS = [
|
MOTD_BANNED_TAGS = [
|
||||||
'img', 'spoiler', '@mention'
|
'img', 'spoiler', '@mention',
|
||||||
]
|
]
|
||||||
|
|
||||||
SIG_BANNED_TAGS = [
|
SIG_BANNED_TAGS = [
|
||||||
'@mention'
|
'@mention',
|
||||||
|
]
|
||||||
|
|
||||||
|
STRICT_BANNED_TAGS = [
|
||||||
|
'img', 'spoiler', '@mention',
|
||||||
|
'big', 'small', 'center', 'right', 'color',
|
||||||
]
|
]
|
||||||
|
|
||||||
def permission_level_string(perm):
|
def permission_level_string(perm):
|
||||||
|
|||||||
@@ -5,8 +5,3 @@ bp = Blueprint("app", __name__, url_prefix = "/")
|
|||||||
@bp.route("/")
|
@bp.route("/")
|
||||||
def index():
|
def index():
|
||||||
return redirect(url_for("topics.all_topics"))
|
return redirect(url_for("topics.all_topics"))
|
||||||
|
|
||||||
|
|
||||||
@bp.route("/babycode")
|
|
||||||
def babycode_guide():
|
|
||||||
return render_template('babycode.html')
|
|
||||||
|
|||||||
13
app/routes/guides.py
Normal file
13
app/routes/guides.py
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
from flask import Blueprint, render_template
|
||||||
|
|
||||||
|
bp = Blueprint('guides', __name__, url_prefix='/guides/')
|
||||||
|
|
||||||
|
|
||||||
|
@bp.get('/babycode')
|
||||||
|
def babycode():
|
||||||
|
return render_template('guides/babycode.html')
|
||||||
|
|
||||||
|
|
||||||
|
@bp.get('/contact')
|
||||||
|
def contact():
|
||||||
|
return render_template('guides/contact.html')
|
||||||
@@ -23,9 +23,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{% block content %}{% endblock %}
|
{% block content %}{% endblock %}
|
||||||
<footer class="darkbg">
|
{% include 'common/footer.html' %}
|
||||||
<span>Pyrom commit <a href="{{ "https://git.poto.cafe/yagich/pyrom/commit/" + __commit }}">{{ __commit[:8] }}</a></span>
|
|
||||||
</footer>
|
|
||||||
</bitty-6-0>
|
</bitty-6-0>
|
||||||
<script src="{{ "/static/js/ui.js" | cachebust }}"></script>
|
<script src="{{ "/static/js/ui.js" | cachebust }}"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
6
app/templates/common/footer.html
Normal file
6
app/templates/common/footer.html
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<footer id="footer">
|
||||||
|
<span>Pyrom commit <a href="{{ "https://git.poto.cafe/yagich/pyrom/commit/" + __commit }}">{{ __commit[:8] }}</a></span>
|
||||||
|
<ul class="horizontal">
|
||||||
|
<li><a href="{{ url_for('guides.contact') }}">Contact</a></li>
|
||||||
|
</ul>
|
||||||
|
</footer>
|
||||||
@@ -99,7 +99,7 @@
|
|||||||
<button data-send="insertBabycodeTag" data-tag="spoiler=" data-break-line="1" data-prefill="hidden content" class="babycode-button contain-svg" type=button id="post-editor-spoiler" title="Insert spoiler" {{"disabled" if "spoiler" in banned_tags else ""}}>{{ icn_spoiler() }}</button>
|
<button data-send="insertBabycodeTag" data-tag="spoiler=" data-break-line="1" data-prefill="hidden content" class="babycode-button contain-svg" type=button id="post-editor-spoiler" title="Insert spoiler" {{"disabled" if "spoiler" in banned_tags else ""}}>{{ icn_spoiler() }}</button>
|
||||||
</span>
|
</span>
|
||||||
<textarea class="babycode-editor" name="{{ ta_name }}" id="babycode-content" placeholder="{{ ta_placeholder }}" {{ "required" if not optional else "" }} autocomplete="off" data-receive="insertBabycodeTag addQuote">{{ prefill }}</textarea>
|
<textarea class="babycode-editor" name="{{ ta_name }}" id="babycode-content" placeholder="{{ ta_placeholder }}" {{ "required" if not optional else "" }} autocomplete="off" data-receive="insertBabycodeTag addQuote">{{ prefill }}</textarea>
|
||||||
<a href="{{ url_for("app.babycode_guide") }}" target="_blank">babycode guide</a>
|
<a href="{{ url_for("guides.babycode") }}" target="_blank">babycode guide</a>
|
||||||
{% if banned_tags %}
|
{% if banned_tags %}
|
||||||
<div>Forbidden tags:</div>
|
<div>Forbidden tags:</div>
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
<!-- kate: remove-trailing-space off; -->
|
|
||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
{% block title %}babycode guide{% endblock %}
|
{% block title %}babycode guide{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
13
app/templates/guides/contact.html
Normal file
13
app/templates/guides/contact.html
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
{% block title %}contact us{% endblock %}
|
||||||
|
{% block content %}
|
||||||
|
<div class="darkbg settings-container">
|
||||||
|
<h1>Contact</h1>
|
||||||
|
{% if config.ADMIN_CONTACT_INFO %}
|
||||||
|
<p>The administrators of {{ config.SITE_NAME }} provide the following contact information:</p>
|
||||||
|
<div>{{ config.ADMIN_CONTACT_INFO | babycode_strict | safe }}</div>
|
||||||
|
{% else %}
|
||||||
|
<p>The administrators of {{ config.SITE_NAME }} did not provide any contact information.</p>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
<div class="darkbg login-container">
|
<div class="darkbg login-container">
|
||||||
<h1>Confirm account deletion</h1>
|
<h1>Confirm account deletion</h1>
|
||||||
<p>Are you sure you want to delete your account on {{ config.SITE_NAME }}? <strong>This action is irreversible.</strong> Your posts and threads will remain accessible to preserve history but will be de-personalized, showing up as authored by a system user. Posts that @mention you will also mention the system user instead.</p>
|
<p>Are you sure you want to delete your account on {{ config.SITE_NAME }}? <strong>This action is irreversible.</strong> Your posts and threads will remain accessible to preserve history but will be de-personalized, showing up as authored by a system user. Posts that @mention you will also mention the system user instead.</p>
|
||||||
<p>If you wish for any and all content relating to you to be removed, you will have to ask {{ config.SITE_NAME }}'s administrators separately.</p>
|
<p>If you wish for any and all content relating to you to be removed, you will have to <a href="{{url_for("guides.contact")}}" target="_blank">contact {{ config.SITE_NAME }}'s administrators separately.</a></p>
|
||||||
<p>If you are sure, please confirm your current password below.</p>
|
<p>If you are sure, please confirm your current password below.</p>
|
||||||
<form method="post">
|
<form method="post">
|
||||||
<label for="password">Confirm password</label>
|
<label for="password">Confirm password</label>
|
||||||
|
|||||||
@@ -6,3 +6,8 @@ DISABLE_SIGNUP = false # if true, no one can sign up.
|
|||||||
|
|
||||||
MODS_CAN_INVITE = true # if true, allows moderators to create invite links. useless unless DISABLE_SIGNUP to be true.
|
MODS_CAN_INVITE = true # if true, allows moderators to create invite links. useless unless DISABLE_SIGNUP to be true.
|
||||||
USERS_CAN_INVITE = false # if true, allows users to create invite links. useless unless DISABLE_SIGNUP to be true.
|
USERS_CAN_INVITE = false # if true, allows users to create invite links. useless unless DISABLE_SIGNUP to be true.
|
||||||
|
|
||||||
|
# contact information, will be shown in /guides/contact
|
||||||
|
# some babycodes allowed
|
||||||
|
# forbidden tags: [spoiler], [img], @mention, [big], [small], [center], [right], [color]
|
||||||
|
ADMIN_CONTACT_INFO = ""
|
||||||
|
|||||||
@@ -89,6 +89,16 @@ a:visited {
|
|||||||
background-color: rgb(143.7039271654, 144.3879625984, 142.8620374016);
|
background-color: rgb(143.7039271654, 144.3879625984, 142.8620374016);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#footer {
|
||||||
|
padding: 10px;
|
||||||
|
margin: 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: end;
|
||||||
|
background-color: rgb(143.7039271654, 144.3879625984, 142.8620374016);
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: baseline;
|
||||||
|
}
|
||||||
|
|
||||||
.darkbg {
|
.darkbg {
|
||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
|
|||||||
@@ -89,6 +89,16 @@ a:visited {
|
|||||||
background-color: #231c23;
|
background-color: #231c23;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#footer {
|
||||||
|
padding: 10px;
|
||||||
|
margin: 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: end;
|
||||||
|
background-color: #231c23;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: baseline;
|
||||||
|
}
|
||||||
|
|
||||||
.darkbg {
|
.darkbg {
|
||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
|
|||||||
@@ -89,6 +89,16 @@ a:visited {
|
|||||||
background-color: #88486d;
|
background-color: #88486d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#footer {
|
||||||
|
padding: 6px;
|
||||||
|
margin: 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: end;
|
||||||
|
background-color: #88486d;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: baseline;
|
||||||
|
}
|
||||||
|
|
||||||
.darkbg {
|
.darkbg {
|
||||||
padding-bottom: 6px;
|
padding-bottom: 6px;
|
||||||
padding-left: 6px;
|
padding-left: 6px;
|
||||||
|
|||||||
@@ -206,6 +206,12 @@ $bottomnav_color: $DARK_1 !default;
|
|||||||
@include navbar($bottomnav_color);
|
@include navbar($bottomnav_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#footer {
|
||||||
|
@include navbar($bottomnav_color);
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: baseline;
|
||||||
|
}
|
||||||
|
|
||||||
$darkbg_color: $DARK_1 !default;
|
$darkbg_color: $DARK_1 !default;
|
||||||
.darkbg {
|
.darkbg {
|
||||||
padding-bottom: $MEDIUM_PADDING;
|
padding-bottom: $MEDIUM_PADDING;
|
||||||
|
|||||||
Reference in New Issue
Block a user