From 7932db90d5fc73ff19a55eeff39ef985108d039b Mon Sep 17 00:00:00 2001 From: forest Date: Sun, 10 May 2020 22:55:16 -0500 Subject: [PATCH] added FAQ, Changelog, and Support static pages --- capsulflask/__init__.py | 6 +- capsulflask/auth.py | 2 +- capsulflask/landing.py | 15 +++ capsulflask/static/style.css | 25 ++++- capsulflask/templates/base.html | 28 +++-- capsulflask/templates/changelog.html | 29 ++++++ capsulflask/templates/faq.html | 147 +++++++++++++++++++++++++++ capsulflask/templates/index.html | 7 +- capsulflask/templates/support.html | 30 ++++++ 9 files changed, 265 insertions(+), 24 deletions(-) create mode 100644 capsulflask/templates/changelog.html create mode 100644 capsulflask/templates/faq.html create mode 100644 capsulflask/templates/support.html diff --git a/capsulflask/__init__.py b/capsulflask/__init__.py index 6e966ba..b2f509c 100644 --- a/capsulflask/__init__.py +++ b/capsulflask/__init__.py @@ -26,11 +26,9 @@ def create_app(): db.init_app(app) - @app.route("/") - def index(): - return render_template("index.html") + from capsulflask import auth, landing, console - from capsulflask import auth + app.register_blueprint(landing.bp) app.register_blueprint(auth.bp) diff --git a/capsulflask/auth.py b/capsulflask/auth.py index 6540a85..c6e3727 100644 --- a/capsulflask/auth.py +++ b/capsulflask/auth.py @@ -37,7 +37,7 @@ def login(): if not email: error = "email is required" - elif not re.match(r"(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)", email): + elif len(email.strip()) < 6 or email.count('@') != 1 or email.count('.') == 0: error = "enter a valid email address" if error is None: diff --git a/capsulflask/landing.py b/capsulflask/landing.py index 9b2c26b..2ae4cee 100644 --- a/capsulflask/landing.py +++ b/capsulflask/landing.py @@ -14,3 +14,18 @@ from capsulflask.db import get_model bp = Blueprint("landing", __name__, url_prefix="/") +@bp.route("/") +def index(): + return render_template("index.html") + +@bp.route("/faq") +def faq(): + return render_template("faq.html") + +@bp.route("/changelog") +def changelog(): + return render_template("changelog.html") + +@bp.route("/support") +def support(): + return render_template("support.html") \ No newline at end of file diff --git a/capsulflask/static/style.css b/capsulflask/static/style.css index 60ba419..615bb0a 100644 --- a/capsulflask/static/style.css +++ b/capsulflask/static/style.css @@ -26,18 +26,24 @@ a:hover, a:active, a:visited { color: #b5bd68; } -header { +nav .nav-row { display: flex; justify-content: space-between; margin: 2rem 0; } +nav .nav-row:last-child { + justify-content: center; +} +nav .nav-row:last-child a, nav .nav-row:last-child div { + margin: 0 1em; +} .flash { color: rgb(173, 74, 8); font-weight: bold; text-align: center; border: 1px dashed rgb(173, 74, 8); - border-radius: 2em; + border-radius: 0.5em; margin-bottom: 2em; padding: 1em; } @@ -45,6 +51,7 @@ header { main { border: 1px dashed #bdc7b8; padding: 1rem; + margin-bottom: 2em; } .hero { @@ -54,7 +61,7 @@ main { } .single-content { - margin: 4rem 0; + margin: 2rem 0; } form { @@ -79,7 +86,7 @@ input { input[type=text] { font: calc(0.40rem + 1vmin) monospace; border: 0; - border-bottom: 2px solid #777e73; + border-bottom: 1px solid #777e73; min-width: 20em; outline: 0; } @@ -100,7 +107,15 @@ h1, h2, h3, h4, h5 { } ul li { - margin-bottom: 1em; + margin: 0.5em 0; +} + +.code { + display: inline-block; + padding: 0.5em 2em; + border-radius: 0.5em; + border: 1px solid #777e73; + background: #bdc7b810; } footer, p { diff --git a/capsulflask/templates/base.html b/capsulflask/templates/base.html index e817204..6bb7b46 100644 --- a/capsulflask/templates/base.html +++ b/capsulflask/templates/base.html @@ -8,24 +8,32 @@ -
-
- Capsul💊 +
+ {% for message in get_flashed_messages() %}
{{ message }}
{% endfor %}
{% block content %}{% endblock %}
+{% block subcontent %}{% endblock %}