|
|
@ -28,14 +28,14 @@ def events(): |
|
|
|
def exhibitions(): |
|
|
|
return render_template('list.html', title='Exhibitions') |
|
|
|
|
|
|
|
@app.route('/exhibitions/<type>') |
|
|
|
def exhibition_type(type): |
|
|
|
if type == "local-artists-network": |
|
|
|
type = "LAN" |
|
|
|
elif type == "unsettling-the-algorithm": |
|
|
|
type = "UTA" |
|
|
|
@app.route('/exhibitions/<ex_type>') |
|
|
|
def exhibition_type(ex_type): |
|
|
|
if ex_type == "local-artists-network": |
|
|
|
ex_type = "LAN" |
|
|
|
elif ex_type == "unsettling-the-algorithm": |
|
|
|
ex_type = "UTA" |
|
|
|
exhibitions = get_all_content('exhibition') |
|
|
|
return render_template('list-exhibitions.html', title="Exhibitions", content=exhibitions, type=type) |
|
|
|
return render_template('list-exhibitions.html', title="Exhibitions", content=exhibitions, ex_type=ex_type) |
|
|
|
|
|
|
|
@app.route('/conferences') |
|
|
|
def conference(): |
|
|
@ -47,6 +47,11 @@ def event_article(type, title): |
|
|
|
data = get_content_by_title(title, type) |
|
|
|
return render_template('article.html', title=title, content=data) |
|
|
|
|
|
|
|
@app.route('/<type>/<ex_type>/<title>') |
|
|
|
def event_articles(type, title, ex_type): |
|
|
|
data = get_content_by_title(title, type) |
|
|
|
return render_template('article.html', title=title, content=data) |
|
|
|
|
|
|
|
@app.route('/locations') |
|
|
|
def locations(): |
|
|
|
return render_template('locations.html', title='Locations') |
|
|
@ -58,6 +63,7 @@ def get_all_content(type): |
|
|
|
|
|
|
|
def get_content_by_title(title, pre_type): |
|
|
|
type = pre_type[:-1] |
|
|
|
print(type) |
|
|
|
entries = client.entries({'query': title, 'limit': 5}) |
|
|
|
exact_matches = [entry for entry in entries if getattr(entry, f'title_of_{type}') == title] |
|
|
|
content_list = process_content(exact_matches, type) |
|
|
@ -108,7 +114,6 @@ def process_content(entries, type): |
|
|
|
'bookUrl': bookUrl, |
|
|
|
'exh_type': exh_type |
|
|
|
} |
|
|
|
|
|
|
|
content_list.append(content) |
|
|
|
|
|
|
|
# Sort the content list by the 'title' key alphabetically |
|
|
|