2020-11-22 17:11:23 +01:00
|
|
|
from app import app
|
2020-12-07 00:02:45 +01:00
|
|
|
from flask import render_template, jsonify
|
2020-11-23 01:15:19 +01:00
|
|
|
import os
|
2020-10-15 23:33:52 +02:00
|
|
|
|
2020-12-07 00:02:45 +01:00
|
|
|
capitula = [
|
2021-01-07 17:19:52 +01:00
|
|
|
{'title': '01 Imperium Romanum',
|
|
|
|
'pensa': ['A', 'B'],
|
|
|
|
'exercitia': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]},
|
2020-12-07 00:02:45 +01:00
|
|
|
{'title': '02 Familia Romana'},
|
|
|
|
{'title': '03 Puer Improbus'},
|
|
|
|
{'title': '04 Dominus et Servi'},
|
|
|
|
{'title': '05 Villa et Hortus'},
|
|
|
|
{'title': '06 Via Latina'},
|
|
|
|
{'title': '07 Puella et Rosa'},
|
|
|
|
{'title': '08 Taberna Romana'},
|
|
|
|
{'title': '09 Pastor et Oves'},
|
|
|
|
{'title': '10 Bestiae et Homines'}
|
|
|
|
]
|
2020-10-15 23:33:52 +02:00
|
|
|
|
2020-12-07 00:02:45 +01:00
|
|
|
for capitulum in capitula:
|
|
|
|
capitulum['filename'] = capitulum['title'].replace(' ', '_')
|
2020-10-15 23:33:52 +02:00
|
|
|
|
2020-12-07 00:02:45 +01:00
|
|
|
@app.route('/')
|
|
|
|
@app.route('/index')
|
|
|
|
@app.route('/llpsi')
|
2020-11-22 17:11:23 +01:00
|
|
|
def llpsi():
|
2020-12-07 00:02:45 +01:00
|
|
|
return render_template('index.html', capitula=capitula)
|
2020-11-23 01:15:19 +01:00
|
|
|
|
2020-12-25 00:05:39 +01:00
|
|
|
@app.route('/llpsi/<path:capitulum_id>')
|
|
|
|
def capitulum(capitulum_id):
|
|
|
|
filename = app.root_path + '/templates/Capitula/' + capitulum_id + '.html'
|
|
|
|
with open(filename, 'r') as file:
|
|
|
|
return render_template('Capitulum.html', capitulum_title=capitulum_id.replace('_', ' '), capitulum_content=file.read())
|
|
|
|
|
2021-01-07 17:19:52 +01:00
|
|
|
@app.route('/llpsi/pensum/<path:pensum_id>')
|
2020-11-23 01:15:19 +01:00
|
|
|
def pensum(pensum_id):
|
2020-12-23 23:51:30 +01:00
|
|
|
filename = app.root_path + '/templates/Pensa/' + pensum_id + '.html'
|
2020-11-23 01:15:19 +01:00
|
|
|
with open(filename, 'r') as file:
|
2020-12-07 00:02:45 +01:00
|
|
|
return render_template('Pensum_cloze.html', pensum_title=pensum_id.replace('_', ' '), pensum_content=file.read())
|
2021-01-07 17:19:52 +01:00
|
|
|
|
2021-01-07 22:20:42 +01:00
|
|
|
@app.route('/llpsi/exercitium/<path:exercitium_id>')
|
2021-01-07 17:19:52 +01:00
|
|
|
def exercitium(exercitium_id):
|
|
|
|
filename = app.root_path + '/templates/Exercitia/' + exercitium_id + '.html'
|
|
|
|
with open(filename, 'r') as file:
|
2021-01-07 22:20:42 +01:00
|
|
|
return render_template('Exercitium_cloze.html', exercitium_title=exercitium_id.replace('_', ' '), exercitium_content=file.read())
|