This commit is contained in:
Elliott Pardee 2019-06-03 06:52:10 -04:00
parent 817940f2b7
commit 89a8f22134
25 changed files with 552 additions and 39 deletions

21
.idea/canon_law.iml generated Normal file
View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/canon_law" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="Python 3.7 (canon_law)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TemplatesService">
<option name="TEMPLATE_FOLDERS">
<list>
<option value="$MODULE_DIR$/canon_law/templates" />
</list>
</option>
</component>
<component name="TestRunnerService">
<option name="projectConfiguration" value="Twisted Trial" />
<option name="PROJECT_TEST_RUNNER" value="Twisted Trial" />
</component>
</module>

4
.idea/encodings.xml generated Normal file
View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with NO BOM" />
</project>

View File

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="HtmlUnknownTarget" enabled="false" level="WARNING" enabled_by_default="false" />
</profile>
</component>

7
.idea/misc.xml generated Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (canon_law)" project-jdk-type="Python SDK" />
<component name="PyCharmProfessionalAdvertiser">
<option name="shown" value="true" />
</component>
</project>

8
.idea/modules.xml generated Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/canon_law.iml" filepath="$PROJECT_DIR$/.idea/canon_law.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

14
.idea/webResources.xml generated Normal file
View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="WebResourcesPaths">
<contentEntries>
<entry url="file://$PROJECT_DIR$">
<entryData>
<resourceRoots>
<path value="file://$PROJECT_DIR$/canon_law/static" />
</resourceRoots>
</entryData>
</entry>
</contentEntries>
</component>
</project>

418
.idea/workspace.xml generated Normal file
View File

@ -0,0 +1,418 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="3b0d8d9f-018d-465b-a975-dc7d92448e04" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/.idea/inspectionProfiles/Project_Default.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/webResources.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.vscode/settings.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/canon_law/__init__.py" beforeDir="false" afterPath="$PROJECT_DIR$/canon_law/__init__.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/canon_law/api.py" beforeDir="false" afterPath="$PROJECT_DIR$/canon_law/api.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/canon_law/central.py" beforeDir="false" afterPath="$PROJECT_DIR$/canon_law/central.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/canon_law/frontend.py" beforeDir="false" afterPath="$PROJECT_DIR$/canon_law/frontend.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/static/logo.png" beforeDir="false" afterPath="$PROJECT_DIR$/canon_law/static/logo.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/static/style.css" beforeDir="false" afterPath="$PROJECT_DIR$/canon_law/static/style.css" afterDir="false" />
<change beforePath="$PROJECT_DIR$/templates/about.html" beforeDir="false" afterPath="$PROJECT_DIR$/canon_law/templates/about.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/templates/api.html" beforeDir="false" afterPath="$PROJECT_DIR$/canon_law/templates/api.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/templates/base.html" beforeDir="false" afterPath="$PROJECT_DIR$/canon_law/templates/base.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/templates/council.html" beforeDir="false" afterPath="$PROJECT_DIR$/canon_law/templates/council.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/templates/disclaimer.html" beforeDir="false" afterPath="$PROJECT_DIR$/canon_law/templates/disclaimer.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/templates/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/canon_law/templates/index.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/templates/search.html" beforeDir="false" afterPath="$PROJECT_DIR$/canon_law/templates/search.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/templates/unknown_council.html" beforeDir="false" afterPath="$PROJECT_DIR$/canon_law/templates/unknown_council.html" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="CoverageDataManager">
<SUITE FILE_PATH="coverage/canon_law$Flask____Dev.coverage" NAME="Flask // Development Coverage Results" MODIFIED="1553379702730" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/canon_law/central.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="713">
<caret line="31" column="32" selection-start-line="31" selection-start-column="32" selection-end-line="31" selection-end-column="32" />
<folding>
<element signature="e#752#761#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/canon_law/frontend.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1518">
<caret line="70" selection-start-line="70" selection-end-line="70" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/canon_law/templates/api.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="115">
<caret line="5" column="71" selection-start-line="5" selection-start-column="71" selection-end-line="5" selection-end-column="91" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/canon_law/templates/base.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1541">
<caret line="67" column="77" selection-start-line="67" selection-start-column="77" selection-end-line="67" selection-end-column="77" />
<folding>
<element signature="n#style#0;n#span#0;n#footer#0;n#body#0;n#html#0;n#!!top" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/canon_law/templates/about.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="345">
<caret line="15" lean-forward="true" selection-start-line="15" selection-end-line="15" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/canon_law/static/style.css">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1817">
<caret line="79" column="21" selection-start-line="79" selection-start-column="21" selection-end-line="79" selection-end-column="21" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/canon_law/templates/council.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="92">
<caret line="4" column="3" selection-start-line="4" selection-start-column="3" selection-end-line="4" selection-end-column="3" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/canon_law/templates/disclaimer.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="276">
<caret line="12" selection-start-line="12" selection-end-line="12" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/canon_law/__init__.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="690">
<caret line="33" column="34" selection-start-line="33" selection-start-column="34" selection-end-line="33" selection-end-column="34" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/canon_law/api.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="644">
<caret line="28" column="37" selection-start-line="28" selection-start-column="37" selection-end-line="28" selection-end-column="37" />
<folding>
<element signature="e#752#764#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>frontend.council</find>
</findStrings>
<replaceStrings>
<replace>frontend.read_council</replace>
</replaceStrings>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/canon_law/api.py" />
<option value="$PROJECT_DIR$/README.md" />
<option value="$PROJECT_DIR$/canon_law/central.py" />
<option value="$PROJECT_DIR$/canon_law/__init__.py" />
<option value="$PROJECT_DIR$/canon_law/frontend.py" />
<option value="$PROJECT_DIR$/templates/about.html" />
<option value="$PROJECT_DIR$/templates/api.html" />
<option value="$PROJECT_DIR$/templates/council.html" />
<option value="$PROJECT_DIR$/templates/disclaimer.html" />
<option value="$PROJECT_DIR$/canon_law/static/style.css" />
<option value="$PROJECT_DIR$/canon_law/templates/base.html" />
<option value="$PROJECT_DIR$/canon_law/templates/about.html" />
</list>
</option>
</component>
<component name="ProjectFrameBounds" extendedState="6">
<option name="x" value="840" />
<option name="width" value="840" />
<option name="height" value="1020" />
</component>
<component name="ProjectLevelVcsManager">
<ConfirmationsSetting value="2" id="Add" />
</component>
<component name="ProjectView">
<navigator proportions="" version="1">
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="Scope" />
<pane id="ProjectPane">
<subPane>
<expand>
<path>
<item name="canon_law" type="b2602c69:ProjectViewProjectNode" />
<item name="canon_law" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="canon_law" type="b2602c69:ProjectViewProjectNode" />
<item name="canon_law" type="462c0819:PsiDirectoryNode" />
<item name="canon_law" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="canon_law" type="b2602c69:ProjectViewProjectNode" />
<item name="canon_law" type="462c0819:PsiDirectoryNode" />
<item name="canon_law" type="462c0819:PsiDirectoryNode" />
<item name="static" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="canon_law" type="b2602c69:ProjectViewProjectNode" />
<item name="canon_law" type="462c0819:PsiDirectoryNode" />
<item name="canon_law" type="462c0819:PsiDirectoryNode" />
<item name="templates" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
</pane>
</panes>
</component>
<component name="PropertiesComponent">
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../BibleBot" />
<property name="restartRequiresConfirmation" value="false" />
<property name="settings.editor.selected.configurable" value="com.jetbrains.python.configuration.PythonContentEntriesConfigurable" />
</component>
<component name="RecentsManager">
<key name="MoveFile.RECENT_KEYS">
<recent name="C:\Users\Elliott\Desktop\Code\canon_law\canon_law" />
</key>
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="RunManager">
<configuration name="Flask // Development" type="Python.FlaskServer" factoryName="Flask server">
<option name="application" value="canon_law" />
<option name="flaskDebug" value="true" />
<module name="canon_law" />
<option name="target" value="canon_law" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="C:\Users\Elliott\Desktop\Code\canon_law\venv\Scripts\python.exe" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="launchJavascriptDebuger" value="false" />
<method v="2" />
</configuration>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="3b0d8d9f-018d-465b-a975-dc7d92448e04" name="Default Changelist" comment="" />
<created>1553372773667</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1553372773667</updated>
<workItem from="1553376599800" duration="4071000" />
<workItem from="1555969654438" duration="94000" />
<workItem from="1555969912496" duration="712000" />
<workItem from="1556314664685" duration="226000" />
<workItem from="1556314896201" duration="59000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="5162000" />
</component>
<component name="ToolWindowManager">
<frame x="-8" y="-8" width="1696" height="1036" extended-state="6" />
<layout>
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.26605505" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info id="Favorites" order="2" side_tool="true" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" />
<window_info anchor="bottom" id="Run" order="2" weight="0.3295325" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="bottom" id="Version Control" order="7" />
<window_info anchor="bottom" id="Terminal" order="8" weight="0.331813" />
<window_info anchor="bottom" id="Event Log" order="9" side_tool="true" />
<window_info anchor="bottom" id="Python Console" order="10" />
<window_info anchor="bottom" id="Docker" order="11" show_stripe_button="false" />
<window_info anchor="bottom" id="Database Changes" order="12" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
<window_info anchor="right" id="Database" order="3" />
<window_info anchor="right" id="SciView" order="4" />
</layout>
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/canon_law/datasets/1const.txt">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="SPLIT">
<first_editor relative-caret-position="713">
<caret line="31" column="156" selection-start-line="31" selection-start-column="156" selection-end-line="31" selection-end-column="156" />
</first_editor>
<second_editor />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/AppData/Local/Programs/Python/Python37/Lib/logging/__init__.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="6600">
<caret line="1541" column="8" selection-start-line="1541" selection-start-column="8" selection-end-line="1541" selection-end-column="8" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/venv/Lib/site-packages/flask/app.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="4944">
<caret line="615" column="8" selection-start-line="615" selection-start-column="8" selection-end-line="615" selection-end-column="8" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/canon_law/extensions/vylogger.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1497">
<folding>
<element signature="e#752#766#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/canon_law/central.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="713">
<caret line="31" column="32" selection-start-line="31" selection-start-column="32" selection-end-line="31" selection-end-column="32" />
<folding>
<element signature="e#752#761#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/canon_law/frontend.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1518">
<caret line="70" selection-start-line="70" selection-end-line="70" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/canon_law/templates/api.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="115">
<caret line="5" column="71" selection-start-line="5" selection-start-column="71" selection-end-line="5" selection-end-column="91" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/canon_law/templates/base.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1541">
<caret line="67" column="77" selection-start-line="67" selection-start-column="77" selection-end-line="67" selection-end-column="77" />
<folding>
<element signature="n#style#0;n#span#0;n#footer#0;n#body#0;n#html#0;n#!!top" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/canon_law/static/style.css">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1817">
<caret line="79" column="21" selection-start-line="79" selection-start-column="21" selection-end-line="79" selection-end-column="21" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/canon_law/templates/council.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="92">
<caret line="4" column="3" selection-start-line="4" selection-start-column="3" selection-end-line="4" selection-end-column="3" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/canon_law/templates/disclaimer.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="276">
<caret line="12" selection-start-line="12" selection-end-line="12" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/canon_law/__init__.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="690">
<caret line="33" column="34" selection-start-line="33" selection-start-column="34" selection-end-line="33" selection-end-column="34" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/canon_law/api.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="644">
<caret line="28" column="37" selection-start-line="28" selection-start-column="37" selection-end-line="28" selection-end-column="37" />
<folding>
<element signature="e#752#764#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/canon_law/templates/about.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="345">
<caret line="15" lean-forward="true" selection-start-line="15" selection-end-line="15" />
</state>
</provider>
</entry>
</component>
</project>

View File

@ -1,4 +0,0 @@
{
"python.pythonPath": "${workspaceFolder}/venv/bin/python",
"html.format.wrapLineLength": 0,
}

View File

@ -1,4 +1,32 @@
canon_law
==========
# canon_law
A service for referencing Orthodox canon law.
## Self-Host Installation
### Step 1. Python Setup (Linux/MacOS)
```bash
python3 -m venv venv
source venv/bin/activate
pip install -U colorama flask tinydb
```
### Step 1. Python Setup (Windows)
```bat
python3 -m venv venv
.\venv\Scripts\activate
pip install -U colorama flask tinydb
```
### Step 2. Setting Environment Variables
You will need to set your flask environment to `development` or `production`, with the former having an interactive debugger and live reload.
For Linux, you will use `export FLASK_ENV=<option>` where \<option\> is one of settings aforementioned. For Windows, this is `set FLASK_ENV=<option>`.
Finally, set the FLASK_APP environment variable to `canon_law` by doing `export FLASK_APP=canon_law` or `set FLASK_APP=canon_law`, the latter if you are on Windows.
### Step 3. Launch
Do `flask run` and the service should start up. If it doesn't, please [file an issue](https://github.com/vypr/canon_law/issues/new) so I can get to work. :)

5
app.py Normal file
View File

@ -0,0 +1,5 @@
from canon_law import __init__ as handler
if __name__ == "__main__":
app = handler.create_app()
app.run()

View File

@ -22,8 +22,8 @@ import flask
from canon_law import central
def create_app(self):
app = flask.Flask("rudder_api", instance_relative_config=True)
def create_app():
app = flask.Flask("canon_law", instance_relative_config=True)
try:
os.makedirs(app.instance_path)
@ -34,6 +34,4 @@ def create_app(self):
app.register_blueprint(api.bp)
app.register_blueprint(frontend.bp)
app.logger = central.logger
return app

View File

@ -43,7 +43,7 @@ def council(name=None, option=None, canon=None):
query = tinydb.Query()
results = central.db.search(query.name == name)
if results == []:
if not results:
return flask.jsonify({
"ok": False,
"msg": f"No database entry for '{name}'."
@ -77,7 +77,7 @@ def council(name=None, option=None, canon=None):
canons = results[0]["canons"]
if canon > 0 and canon < len(canons):
if 0 < canon < len(canons):
return flask.jsonify({
"ok": True,
"obj": canons[canon - 1]

View File

@ -19,10 +19,10 @@
import os
import tinydb
dir_path = os.path.dirname(os.path.realpath(__file__))
from canon_law.extensions.vylogger import VyLogger
dir_path = os.path.dirname(os.path.realpath(__file__))
logger = VyLogger("default")
db = tinydb.TinyDB(f"{dir_path}/databases/db")

View File

@ -42,7 +42,7 @@ def index():
@bp.route("/c/<council>/")
def council(council=None):
def read_council(council=None):
if council in page_titles.keys():
title = page_titles[council]

View File

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

@ -75,9 +75,9 @@ input { padding: 10px; }
header .dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
background-color: #e0e0e0;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2);
z-index: 1;
}
@ -90,19 +90,16 @@ header .dropdown-content a {
}
header .dropdown-content a:hover { color: black !important; }
header .dropdown-content a:hover { background-color: #f1f1f1; }
header .dropdown-content a:hover { background-color: #c8c8c8; }
header .dropdown:hover .dropdown-content { display: block; }
header .separator:hover {
background-color: #f9f9f9 !important;
background-color: #e0e0e0 !important;
cursor: default;
}
.main {
margin-top: 10px;
margin-left: 25%;
margin-right: 25%;
margin-bottom: 50px;
margin: 10px 25% 50px;
/* hacky way of making the footer stick to the bottom */
/* only because i don't think it appropriate to add a surrounding div to everything */
@ -136,12 +133,12 @@ table {
}
table, th, td {
border: 1px solid #e0e0e0;
border: 1px solid #c8c8c8;
border-collapse: collapse;
}
th, td { padding: 15px; }
tr:nth-child(even) { background-color: #fcfcfc; }
tr:nth-child(even) { background-color: #e0e0e0; }
small { font-size: 11px; }

View File

@ -3,10 +3,10 @@
{% block title %}about{% endblock %}
{% block main %}
<img src="{{ url_for('static', filename='logo.png') }}" height="200px">
<img src="{{ url_for('static', filename='logo.png') }}" height="200px" alt="canon_law logo">
<h1>about</h1>
<p>
canonlaw.vyprxyz is a open-source endeavor by <a href="https://vypr.xyz">Elliott Pardee</a> to provide a way to reference canon law quickly.
canonlaw.vypr.xyz is a open-source endeavor by <a href="https://vypr.xyz">Elliott Pardee</a> to provide a way to reference canon law quickly.
<br><br>

View File

@ -3,7 +3,7 @@
{% block title %}api{% endblock %}
{% block main %}
<img src="{{ url_for('static', filename='logo.png') }}" height="200px">
<img src="{{ url_for('static', filename='logo.png') }}" height="200px" alt="canon_law logo">
<h1>coming soon</h1>
<p>
This page will be the future documentation of our API, but it isn't quite ready yet.

View File

@ -29,16 +29,16 @@ Sometimes a man must look for nothing to find everything.
<h1><a href="{{ url_for('frontend.index') }}">canonlaw.vypr.xyz</a></h1>
<ul>
<li><a href="{{ url_for('frontend.index') }}">home</a></li>
<li><a href="{{ url_for('frontend.council', council='apostles') }}">canons of the apostles</a></li>
<li><a href="{{ url_for('frontend.read_council', council='apostles') }}">canons of the apostles</a></li>
<li class="dropdown">
<a class="dropbtn">ecumenical councils</a>
<div class="dropdown-content">
<a href="{{ url_for('frontend.council', council='1nicea') }}">first council of nicea (325)</a>
<a href="{{ url_for('frontend.council', council='1const') }}">first council of constantinople (381)</a>
<a href="{{ url_for('frontend.council', council='ephesus') }}">council of ephesus (431)</a>
<a href="{{ url_for('frontend.council', council='chalcedon') }}">council of chalcedon (451)</a>
<a href="{{ url_for('frontend.council', council='2const') }}">second council of constantinople (553)</a>
<a href="{{ url_for('frontend.council', council='3const') }}">third council of constantinople (680-681)</a>
<a href="{{ url_for('frontend.read_council', council='1nicea') }}">first council of nicea (325)</a>
<a href="{{ url_for('frontend.read_council', council='1const') }}">first council of constantinople (381)</a>
<a href="{{ url_for('frontend.read_council', council='ephesus') }}">council of ephesus (431)</a>
<a href="{{ url_for('frontend.read_council', council='chalcedon') }}">council of chalcedon (451)</a>
<a href="{{ url_for('frontend.read_council', council='2const') }}">second council of constantinople (553)</a>
<a href="{{ url_for('frontend.read_council', council='3const') }}">third council of constantinople (680-681)</a>
<a href="#">council of trullo (quinisext) (692)</a>
<a href="#">second council of nicea (787)</a>
<a href="#" class="separator">
@ -65,7 +65,7 @@ Sometimes a man must look for nothing to find everything.
</div>
<footer>
canonlaw.vypr.xyz is made with ❤️ by <a href="https://vypr.xyz">Elliott Pardee</a>.
canonlaw.vypr.xyz is made with <span style="color: #b01712">❤️</span> by <a href="https://vypr.xyz">Elliott Pardee</a>.
<br>
<a href="{{ url_for('frontend.about') }}">about</a> &middot; <a href="{{ url_for('frontend.disclaimer') }}">disclaimer</a> &middot; <a href="https://github.com/Oikonomia/canon_law">source code</a> &middot; <a href="#">additional resources</a>
</footer>

View File

@ -3,7 +3,7 @@
{% block title %}{{ title }}{% endblock %}
{% block main %}
<img src="{{ url_for('static', filename='logo.png') }}" height="200px">
<img src="{{ url_for('static', filename='logo.png') }}" height="200px" alt="canon_law logo">
<h1>{{ title }}</h1>
{% if not obj.no_canons %}
{% autoescape false %}

View File

@ -3,7 +3,7 @@
{% block title %}disclaimer{% endblock %}
{% block main %}
<img src="{{ url_for('static', filename='logo.png') }}" height="200px">
<img src="{{ url_for('static', filename='logo.png') }}" height="200px" alt="canon_law logo">
<h1>disclaimer</h1>
<p>
canonlaw.vypr.xyz is not officially endorsed by any canonical Orthodox body or member of clergy and is not meant
@ -17,6 +17,11 @@
<br><br>
canonlaw.vypr.xyz is a service that is provided free-of-charge. canonlaw.vypr.xyz is a non-profit, educational
service and receives no form of donations or income.
<br><br>
If you have questions, concerns, or feedback about this website or would simply like to contact us, email <a href="mailto:me@vypr.xyz?subject=canonlaw - ">me@vypr.xyz</a>
with the subject prefixed with "canonlaw -". Your email will be answered promptly.
</p>