mirror of
https://github.com/FAUSheppy/flask-json-dream-website
synced 2025-12-06 00:01:36 +01:00
implement project page
This commit is contained in:
16
server.py
16
server.py
@@ -205,10 +205,17 @@ def content():
|
|||||||
# check for extra config #
|
# check for extra config #
|
||||||
extraConfigDir = app.config[identifier + CONFIG_POSTFIX]
|
extraConfigDir = app.config[identifier + CONFIG_POSTFIX]
|
||||||
extraConfig = None
|
extraConfig = None
|
||||||
|
markupText = None
|
||||||
if extraConfigDir:
|
if extraConfigDir:
|
||||||
extraConfig = readJsonDir(os.path.join(app.config["CONTENT_DIR"], extraConfigDir))
|
fullpath = os.path.join(app.config["CONTENT_DIR"], extraConfigDir)
|
||||||
|
if os.path.isdir(fullpath):
|
||||||
|
extraConfig = readJsonDir(fullpath)
|
||||||
|
markupText = flask.Markup(flask.render_template(app.config[identifier],
|
||||||
|
extraConfig=extraConfig))
|
||||||
|
else:
|
||||||
|
with open(fullpath) as f:
|
||||||
|
markupText = markdown2.markdown(f.read())
|
||||||
|
|
||||||
markupText = flask.Markup(flask.render_template(app.config[identifier], extraConfig=extraConfig))
|
|
||||||
return flask.render_template("default_content.html", conf=app.config, markupText=markupText)
|
return flask.render_template("default_content.html", conf=app.config, markupText=markupText)
|
||||||
else:
|
else:
|
||||||
return (EMPTY_STRING, HTTP_NOT_FOUND)
|
return (EMPTY_STRING, HTTP_NOT_FOUND)
|
||||||
@@ -398,7 +405,10 @@ def init():
|
|||||||
if type(subpages[identifier]) == dict:
|
if type(subpages[identifier]) == dict:
|
||||||
app.config[IDENTIFIER_PREFIX + identifier] = subpages[identifier]["template"]
|
app.config[IDENTIFIER_PREFIX + identifier] = subpages[identifier]["template"]
|
||||||
configKey = IDENTIFIER_PREFIX + identifier + CONFIG_POSTFIX
|
configKey = IDENTIFIER_PREFIX + identifier + CONFIG_POSTFIX
|
||||||
app.config[configKey] = subpages[identifier]["config-dir"]
|
if "config-dir" in subpages[identifier]:
|
||||||
|
app.config[configKey] = subpages[identifier]["config-dir"]
|
||||||
|
else:
|
||||||
|
app.config[configKey] = subpages[identifier]["markdown"]
|
||||||
else:
|
else:
|
||||||
app.config[IDENTIFIER_PREFIX + identifier] = subpages[identifier]
|
app.config[IDENTIFIER_PREFIX + identifier] = subpages[identifier]
|
||||||
app.config[IDENTIFIER_PREFIX + identifier + CONFIG_POSTFIX] = None
|
app.config[IDENTIFIER_PREFIX + identifier + CONFIG_POSTFIX] = None
|
||||||
|
|||||||
@@ -15,67 +15,69 @@
|
|||||||
<body>
|
<body>
|
||||||
{% include 'navbar.html' %}
|
{% include 'navbar.html' %}
|
||||||
{% include 'progress_window.html' %}
|
{% include 'progress_window.html' %}
|
||||||
<div id="main-container" class="container" style="margin-top: 4vw;">
|
<div id="main-container" class="container" style="margin-top: 4vw;">
|
||||||
<section class="mb-4">
|
<section class="mb-4">
|
||||||
<h2 class="h1-responsive font-weight-bold text-center my-4">{{ conf['CONTACT_HEADLINE'] }}
|
<h2 class="h1-responsive font-weight-bold my-4">{{ conf['CONTACT_HEADLINE'] }}
|
||||||
</h2>
|
</h2>
|
||||||
<p class="text-center w-responsive mx-auto mb-5"> </p>
|
<p class="text-center w-responsive mx-auto mb-5"> </p>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-9 mb-md-0 mb-5">
|
<div class="col-md-9 mb-md-0 mb-5">
|
||||||
<form id="contact-form" name="contact-form">
|
<form id="contact-form" name="contact-form">
|
||||||
<!-- action="contact-api" method="POST" enctype='application/json'> -->
|
<!-- action="contact-api" method="POST" enctype='application/json'> -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
|
<div class="md-form mb-0">
|
||||||
|
<input placeholder="{{ conf['CONTACT_PLACEHOLDER_NAME'] }}"
|
||||||
|
type="text" id="name" name="name" class="form-control">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="md-form mb-0">
|
||||||
|
<input type="text" id="email" name="email" class="form-control"
|
||||||
|
placeholder="{{ conf['CONTACT_PLACEHOLDER_EMAIL'] }}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row mt-2">
|
||||||
|
<div class="col-md-12">
|
||||||
<div class="md-form mb-0">
|
<div class="md-form mb-0">
|
||||||
<input placeholder="{{ conf['CONTACT_PLACEHOLDER_NAME'] }}"
|
<input type="text" id="subject" name="subject" class="form-control"
|
||||||
type="text" id="name" name="name" class="form-control">
|
placeholder="{{ conf['CONTACT_PLACEHOLDER_SUBJECT'] }}">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
|
||||||
<div class="md-form mb-0">
|
<div class="row mt-2">
|
||||||
<input type="text" id="email" name="email" class="form-control"
|
<div class="col-md-12">
|
||||||
placeholder="{{ conf['CONTACT_PLACEHOLDER_EMAIL'] }}">
|
<div class="md-form">
|
||||||
|
<textarea type="text" id="message" name="message" rows="2"
|
||||||
|
placeholder="{{ conf['CONTACT_PLACEHOLDER_TEXTAREA'] }}"
|
||||||
|
class="form-control md-textarea"></textarea>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</form>
|
||||||
|
<div class="text-center text-md-left mt-2">
|
||||||
|
<a class="btn btn-primary" onclick="submitContactForm()">Send</a>
|
||||||
|
</div>
|
||||||
|
<div class="status"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="row mt-2">
|
<div class="border p-3 col-md-3 text-center">
|
||||||
<div class="col-md-12">
|
<ul class="list-unstyled mb-0">
|
||||||
<div class="md-form mb-0">
|
<li><i class="fas fa-envelope mt-4 fa-2x"></i>
|
||||||
<input type="text" id="subject" name="subject" class="form-control"
|
<p>Wir freuen uns auf ihre Nachricht!</p></br>
|
||||||
placeholder="{{ conf['CONTACT_PLACEHOLDER_SUBJECT'] }}">
|
{% if conf['CONTACT_EMAIL'] %}
|
||||||
</div>
|
<p>Selbsverständlich können sie uns auch per Mail kontaktieren.</p></br>
|
||||||
</div>
|
<a href="mailto:{{ conf['CONTACT_EMAIL'] }}">{{ conf['CONTACT_EMAIL'] }}</a>
|
||||||
</div>
|
{% endif %}
|
||||||
|
</li>
|
||||||
<div class="row mt-2">
|
</ul>
|
||||||
<div class="col-md-12">
|
</div>
|
||||||
<div class="md-form">
|
|
||||||
<textarea type="text" id="message" name="message" rows="2"
|
|
||||||
placeholder="{{ conf['CONTACT_PLACEHOLDER_TEXTAREA'] }}"
|
|
||||||
class="form-control md-textarea"></textarea>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
<div class="text-center text-md-left mt-2">
|
|
||||||
<a class="btn btn-primary" onclick="submitContactForm()">Send</a>
|
|
||||||
</div>
|
|
||||||
<div class="status"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
<div class="col-md-3 text-center">
|
|
||||||
<ul class="list-unstyled mb-0">
|
|
||||||
<li><i class="fas fa-envelope mt-4 fa-2x"></i>
|
|
||||||
<p>rejectmail@atlantishq.de</p>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
-->
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -5,13 +5,13 @@
|
|||||||
{% include 'head.html' %}
|
{% include 'head.html' %}
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body class="bg-special" {% if "FORCE_BG_COLOR" in conf %} style="background-color: {{ conf['FORCE_BG_COLOR'] }} !important;" {% endif %}>
|
<body class="bg-special">
|
||||||
|
|
||||||
{% include 'navbar.html' %}
|
{% include 'navbar.html' %}
|
||||||
<div class="container mt-5 mb-5 h-100">
|
<div class="container mt-5 mb-5 h-100">
|
||||||
<div class="row impressum mt-5"></div>
|
<div class="row impressum mt-5"></div>
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
{{ markupText }}
|
{{ markupText | safe }}
|
||||||
<div class="pb-3"></div>
|
<div class="pb-3"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user