From b76be2a7ba90f3c50fffa9e2f54ed359259b7b5d Mon Sep 17 00:00:00 2001 From: Francesco Siddi Date: Wed, 13 Nov 2019 18:47:28 +0100 Subject: [PATCH] Add /design-system endpoint This is where the representation of the design system will reside. When the application runs in production (with DEBUG = False) the url will return 404. --- cloud/routes.py | 12 ++++++++++++ src/templates/design_system.pug | 7 +++++++ 2 files changed, 19 insertions(+) create mode 100644 src/templates/design_system.pug diff --git a/cloud/routes.py b/cloud/routes.py index 3081a4b..48ec1d1 100644 --- a/cloud/routes.py +++ b/cloud/routes.py @@ -102,6 +102,18 @@ def _homepage_context() -> dict: random_featured=random_featured) +@blueprint.route('/design-system') +def design_system(): + """Display the design system page. + + This endpoing is intended for development only, and returns a + rendered template only if the app is running in debug mode. + """ + if not current_app.config['DEBUG']: + abort(404) + return render_template('design_system.html') + + @blueprint.route('/login') def login(): from flask import request diff --git a/src/templates/design_system.pug b/src/templates/design_system.pug new file mode 100644 index 0000000..60ac77f --- /dev/null +++ b/src/templates/design_system.pug @@ -0,0 +1,7 @@ +| {% extends 'layout.html' %} + +| {% block body %} +.row.py-2 + .col.text-center + h1 Design System goes here +| {% endblock %}