# HG changeset patch # User Dennis Fink # Date 2015-07-08 23:07:21 # Node ID 1492de7d9826669f06bedbd344d2e24a1c398a62 # Parent 732de39fb3ccb519a3b22c9e317710404fab059d use flask_bootstrap diff --git a/spaceapi/__init__.py b/spaceapi/__init__.py --- a/spaceapi/__init__.py +++ b/spaceapi/__init__.py @@ -4,8 +4,10 @@ import os.path import base64 from flask import Flask +from flask_bootstrap import Bootstrap config_file = os.path.abspath('config.json') +bootstrap = Bootstrap() def create_app(): @@ -34,6 +36,9 @@ def create_app(): app.config.from_json = from_json app.config.from_json(config_file, silent=True) + app.config.setdefault('BOOTSTRAP_SERVE_LOCAL', True) + + bootstrap.init_app(app) @app.after_request def add_headers(response): diff --git a/spaceapi/templates/base.html b/spaceapi/templates/base.html new file mode 100644 --- /dev/null +++ b/spaceapi/templates/base.html @@ -0,0 +1,24 @@ +{% extends "bootstrap/base.html" %} + +{% block metas %} + {{ super() }} + + +{% endblock %} + +{% block body %} +
+ {% block navbar %} + {% endblock %} +
+
+ {% block content %} + {% endblock %} +
+
+ +
+{% endblock %} diff --git a/spaceapi/templates/index.html b/spaceapi/templates/index.html --- a/spaceapi/templates/index.html +++ b/spaceapi/templates/index.html @@ -1,5 +1,6 @@ - - +{% extends "base.html" %} + +{% block content %} {% if status['state']['open'] %}

Yes, we're open!

@@ -7,5 +8,4 @@

Sorry, we're closed!

{% endif %} - - +{% endblock %}