diff --git a/server.py b/server.py index 8c2270a..ab0576d 100755 --- a/server.py +++ b/server.py @@ -205,10 +205,17 @@ def content(): # check for extra config # extraConfigDir = app.config[identifier + CONFIG_POSTFIX] extraConfig = None + markupText = None 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) else: return (EMPTY_STRING, HTTP_NOT_FOUND) @@ -398,7 +405,10 @@ def init(): if type(subpages[identifier]) == dict: app.config[IDENTIFIER_PREFIX + identifier] = subpages[identifier]["template"] 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: app.config[IDENTIFIER_PREFIX + identifier] = subpages[identifier] app.config[IDENTIFIER_PREFIX + identifier + CONFIG_POSTFIX] = None diff --git a/templates/contact.html b/templates/contact.html index 33dc35f..d3a902f 100644 --- a/templates/contact.html +++ b/templates/contact.html @@ -15,67 +15,69 @@ {% include 'navbar.html' %} {% include 'progress_window.html' %} -
-
-

{{ conf['CONTACT_HEADLINE'] }} -

-

-
-
-
- -
-
+
+
+

{{ conf['CONTACT_HEADLINE'] }} +

+

+
+
+ + +
+
+
+ +
+
+
+
+ +
+
+
+ +
+
- + +
-
-
- + +
+
+
+ +
-
+ +
+ Send +
+
+
-
-
-
- -
-
-
- -
-
-
- -
-
-
- -
- Send -
-
-
- - -
-
-
+
+
diff --git a/templates/default_content.html b/templates/default_content.html index f11b328..d8249da 100644 --- a/templates/default_content.html +++ b/templates/default_content.html @@ -5,13 +5,13 @@ {% include 'head.html' %} - + {% include 'navbar.html' %}
- {{ markupText }} + {{ markupText | safe }}