This repository has been archived by the owner on Oct 20, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
views.py
70 lines (47 loc) · 1.84 KB
/
views.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
from flask import g, render_template, abort
from app import app
import articles
@app.route('/')
def index():
g.article = articles.collection['sorted-list'][0]
return render_template('index.html')
@app.route('/dogadjaji')
def archive():
g.articles = articles.collection['sorted-list']
return render_template('archive.html')
@app.route('/istorijat')
def history():
return render_template('history.html')
@app.route('/svestenstvo')
def clergy():
return render_template('clergy.html')
@app.route('/parohije')
def parishes():
return render_template('parishes.html')
@app.route('/bogosluzenje')
def schedule():
return render_template('schedule.html')
@app.route('/mapa')
def map():
return render_template('map.html')
@app.route('/objave/<int:year>')
def year(year):
if year in articles.collection['by-year']:
g.articles = articles.collection['by-year'][year]['sorted-list']
return render_template('year.html')
return abort(404)
@app.route('/objave/<int:year>/<month_name>')
def month(year, month_name):
if year in articles.collection['by-year'] and \
month_name in articles.collection['by-year'][year]['by-month-name']:
g.articles = articles.collection['by-year'][year]['by-month-name'][month_name]['sorted-list']
return render_template('month.html')
return abort(404)
@app.route('/objava/<int:year>/<month_name>/<slug>')
def article(year, month_name, slug):
if year in articles.collection['by-year'] and \
month_name in articles.collection['by-year'][year]['by-month-name'] and \
slug in articles.collection['by-year'][year]['by-month-name'][month_name]['by-slug']:
g.article = articles.collection['by-year'][year]['by-month-name'][month_name]['by-slug'][slug]
return render_template('article.html')
return abort(404)