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 = [
|
|
|
|
{'title': '01 Imperium Romanum'},
|
|
|
|
{'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-07 00:02:45 +01:00
|
|
|
@app.route('/llpsi/<path:pensum_id>')
|
2020-11-23 01:15:19 +01:00
|
|
|
def pensum(pensum_id):
|
2020-11-25 21:33:16 +01:00
|
|
|
filename = '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())
|