adding flexible title from settings file

This commit is contained in:
crunk 2023-11-26 18:15:22 +01:00
parent fc750a1e14
commit 0c21688c00
4 changed files with 6 additions and 9 deletions

View File

@ -22,6 +22,7 @@ def create_app():
APP.config["UPLOAD_FOLDER"] = "tmpupload"
APP.config["LIBRARY_FILENAME"] = settings["libaryfilename"]
APP.config["IMAGE_FOLDER"] = "static/images"
APP.config["TITLE"] = settings["title"]
scheduler = flask_apscheduler.APScheduler()
scheduler.api_enabled = False
scheduler.init_app(APP)

View File

@ -37,6 +37,7 @@ def index():
publicatons = csvparser.getpublications()
template = render_template(
"index.html",
title=APP.config["TITLE"],
publications=publicatons,
pubtypes=pubtypes,
pubyears=pubyears,
@ -49,7 +50,7 @@ def index():
def upload():
"""Upload route, a page to upload a book to the csv"""
uploadform = PublicationForm()
csvparser = CsvParser(APP.config["libaryfilename"], APP.config[""])
csvparser = CsvParser(APP.config["LIBRARY_FILENAME"], APP.config["IMAGE_FOLDER"])
if request.method == "POST":
if uploadform.validate_on_submit() and checksecret(
uploadform.secret.data
@ -59,7 +60,7 @@ def upload():
return redirect(str(id), code=303)
else:
return render_template("upload.html", uploadform=uploadform)
return render_template("upload.html", uploadform=uploadform)
return render_template("upload.html", title=APP.config["TITLE"], uploadform=uploadform)
@APP.route("/<publicationID>", methods=["GET", "POST"])

View File

@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Library collection</title>
<title>{{title}}</title>
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/style.css')}}">
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/dropdown.css')}}">
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/bookmark.css')}}">
@ -16,7 +16,7 @@
</head>
<body>
<div id="cloud"></div>
<a href="/"><h1 id="library">LIBRARY COLLECTION</h1></a>
<a href="/"><h1 id="library">{{title}}</h1></a>
{% block main %}
{% endblock main %}
</body>

View File

@ -72,11 +72,6 @@
{{ uploadform.license }}
</fieldset>
<fieldset class="uploadform-field">
{{ uploadform.licenseshort.label }}
{{ uploadform.licenseshort }}
</fieldset>
<fieldset class="uploadform-field">
{{ uploadform.highlights.label }}
{{ uploadform.highlights }}