From 97108e0215f87a2f609f586a0e6edbad15336ff5 Mon Sep 17 00:00:00 2001 From: Elliott Pardee Date: Thu, 27 Sep 2018 03:34:33 -0400 Subject: [PATCH] Adding frontend and some content, preparing search. --- .vscode/settings.json | 3 +- canon_law/__init__.py | 2 +- canon_law/api.py | 7 +- canon_law/central.py | 27 +++++- canon_law/databases/db | 2 +- canon_law/datasets/1const.txt | 7 ++ canon_law/datasets/ephesus.txt | 8 ++ canon_law/frontend.py | 64 +++++++++++++- static/logo.png | Bin 383730 -> 33913 bytes static/style.css | 151 ++++++++++++++++++++++++++++++++- templates/about.html | 31 +++++++ templates/api.html | 22 +++++ templates/base.html | 99 +++++++++++++++++---- templates/council.html | 26 ++++++ templates/disclaimer.html | 23 +++++ templates/index.html | 18 +++- templates/search.html | 34 ++++++++ 17 files changed, 496 insertions(+), 28 deletions(-) create mode 100644 canon_law/datasets/1const.txt create mode 100644 canon_law/datasets/ephesus.txt create mode 100644 templates/about.html create mode 100644 templates/api.html create mode 100644 templates/council.html create mode 100644 templates/disclaimer.html create mode 100644 templates/search.html diff --git a/.vscode/settings.json b/.vscode/settings.json index c8d8f59..2768fd6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,4 @@ { - "python.pythonPath": "${workspaceFolder}/venv/bin/python" + "python.pythonPath": "${workspaceFolder}/venv/bin/python", + "html.format.wrapLineLength": 0, } \ No newline at end of file diff --git a/canon_law/__init__.py b/canon_law/__init__.py index c582d0a..3f227d2 100644 --- a/canon_law/__init__.py +++ b/canon_law/__init__.py @@ -19,7 +19,7 @@ import os import flask -from . import central +from canon_law import central def create_app(self): diff --git a/canon_law/api.py b/canon_law/api.py index 01058a4..15c73b6 100644 --- a/canon_law/api.py +++ b/canon_law/api.py @@ -19,11 +19,16 @@ import flask import tinydb -from . import central +from canon_law import central bp = flask.Blueprint("api", __name__, url_prefix="/api") +@bp.route("/") +def index(): + return flask.render_template("api.html") + + @bp.route("/council/") @bp.route("/council//") @bp.route("/council//