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