瀏覽代碼

setting up routes for each book section

main
Simon Bowie 2 年之前
父節點
當前提交
f6f6872734
共有 6 個檔案被更改,包括 72 行新增2 行删除
  1. +12
    -0
      web/app/__init__.py
  2. +21
    -0
      web/app/hidden.py
  3. +6
    -1
      web/app/interventions.py
  4. +1
    -1
      web/app/main.py
  5. +16
    -0
      web/app/making.py
  6. +16
    -0
      web/app/offrecord.py

+ 12
- 0
web/app/__init__.py 查看文件

@@ -31,6 +31,18 @@ def create_app():
from .interventions import interventions as interventions_blueprint
app.register_blueprint(interventions_blueprint)

# blueprint for hidden parts of app (Section 3: Hidden in plain sight)
from .hidden import hidden as hidden_blueprint
app.register_blueprint(hidden_blueprint)

# blueprint for offrecord parts of app (Section 4: Off the record)
from .offrecord import offrecord as offrecord_blueprint
app.register_blueprint(offrecord_blueprint)

# blueprint for making parts of app (Section 5: Making of)
from .making import making as making_blueprint
app.register_blueprint(making_blueprint)

# blueprint for data parts of app
from .data import data as data_blueprint
app.register_blueprint(data_blueprint)

+ 21
- 0
web/app/hidden.py 查看文件

@@ -0,0 +1,21 @@
# @name: hidden.py
# @creation_date: 2022-10-27
# @license: The MIT License <https://opensource.org/licenses/MIT>
# @author: Simon Bowie <ad7588@coventry.ac.uk>
# @purpose: hidden route for Section 3: Hidden in plain sight
# @acknowledgements:

from flask import Blueprint, render_template
import markdown

hidden = Blueprint('hidden', __name__)

# route for hidden page
@hidden.route('/hidden/')
def index():
return render_template('index.html')

# route for active theme page
@hidden.route('/hidden/active/')
def active():
return render_template('index.html')

+ 6
- 1
web/app/interventions.py 查看文件

@@ -2,7 +2,7 @@
# @creation_date: 2022-09-09
# @license: The MIT License <https://opensource.org/licenses/MIT>
# @author: Simon Bowie <ad7588@coventry.ac.uk>
# @purpose: inteventions route for Section 2: Search Interventions
# @purpose: interventions route for Section 2: Search Interventions
# @acknowledgements:

from flask import Blueprint, render_template, request
@@ -11,6 +11,11 @@ from . import ops

interventions = Blueprint('interventions', __name__)

# route for interventions page
@interventions.route('/interventions/')
def index():
return render_template('index.html')

# route for random entry page ('A random entry')
@interventions.route('/interventions/random/')
def random_record():

+ 1
- 1
web/app/main.py 查看文件

@@ -2,7 +2,7 @@
# @creation_date: 2022-09-07
# @license: The MIT License <https://opensource.org/licenses/MIT>
# @author: Simon Bowie <ad7588@coventry.ac.uk>
# @purpose: Main route for index and other miscellaneous pages
# @purpose: Main route for index page, contents, frontmatter, and other miscellaneous pages
# @acknowledgements:
# https://www.digitalocean.com/community/tutorials/how-to-add-authentication-to-your-app-with-flask-login


+ 16
- 0
web/app/making.py 查看文件

@@ -0,0 +1,16 @@
# @name: making.py
# @creation_date: 2022-10-27
# @license: The MIT License <https://opensource.org/licenses/MIT>
# @author: Simon Bowie <ad7588@coventry.ac.uk>
# @purpose: making route for Section 5: Making of
# @acknowledgements:

from flask import Blueprint, render_template
import markdown

making = Blueprint('making', __name__)

# route for making of page
@making.route('/making/')
def index():
return render_template('index.html')

+ 16
- 0
web/app/offrecord.py 查看文件

@@ -0,0 +1,16 @@
# @name: offrecord.py
# @creation_date: 2022-10-27
# @license: The MIT License <https://opensource.org/licenses/MIT>
# @author: Simon Bowie <ad7588@coventry.ac.uk>
# @purpose: offrecord route for Section 4: Off the record
# @acknowledgements:

from flask import Blueprint, render_template
import markdown

offrecord = Blueprint('offrecord', __name__)

# route for off the record page
@offrecord.route('/offrecord/')
def index():
return render_template('index.html')

Loading…
取消
儲存