add homepage notice
This commit is contained in:
parent
e0ad3f0059
commit
debee86627
@ -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']
|
||||
|
@ -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')
|
||||
|
@ -27,4 +27,9 @@
|
||||
{% with messages = get_flashed_messages() %}
|
||||
{% if messages %}<div class="notification is-danger">{{ messages[0] }}</div>{% endif %}
|
||||
{% endwith %}
|
||||
<div id="homepage-notice" class="row" style="margin-top: 100px;">
|
||||
{% if homepage_notice %}
|
||||
{% for notice in homepage_notice %}<p>{{ notice }}</p>{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
Reference in New Issue
Block a user