diff --git a/project/__init__.py b/project/__init__.py index a82327b..ebf2a76 100644 --- a/project/__init__.py +++ b/project/__init__.py @@ -14,6 +14,7 @@ def create_app(): app.config['SECRET_KEY'] = conf['app']['SECRET_KEY'] app.config['SQLALCHEMY_DATABASE_URI'] = conf['app']['SQLALCHEMY_DATABASE_URI'] + app.config['HOMEPAGE_NOTICE'] = conf['app']['HOMEPAGE_NOTICE'] app.config['NETWORK_PROXY'] = conf['network']['PROXY'] app.config['OPENAI_API_KEY'] = conf['openai']['API_KEY'] app.config['OPENAI_MODEL_NAME'] = conf['openai']['MODEL_NAME'] diff --git a/project/main.py b/project/main.py index 0fac325..f282e27 100644 --- a/project/main.py +++ b/project/main.py @@ -10,7 +10,11 @@ main = Blueprint('main', __name__) @main.route('/') def index(): - return render_template('index.html', user=current_user) + + notice = current_app.config['HOMEPAGE_NOTICE'] + if notice: + notice = notice.split("\\n") + return render_template('index.html', user=current_user, homepage_notice=notice) @main.route('/profile') diff --git a/project/templates/index.html b/project/templates/index.html index b043252..99c4f30 100644 --- a/project/templates/index.html +++ b/project/templates/index.html @@ -27,4 +27,9 @@ {% with messages = get_flashed_messages() %} {% if messages %}
{{ messages[0] }}
{% endif %} {% endwith %} +
+ {% if homepage_notice %} + {% for notice in homepage_notice %}

{{ notice }}

{% endfor %} + {% endif %} +
{% endblock content %}