Browse Source

update

graphics
Cailean Finn 3 weeks ago
parent
commit
9617d3bd6d
  1. 3
      app.py
  2. 9
      templates/list-exhibitions.html

3
app.py

@ -63,7 +63,6 @@ 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)
@ -115,7 +114,6 @@ def process_content(entries, type):
'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
content_list.sort(key=lambda x: x['title'].lower()) content_list.sort(key=lambda x: x['title'].lower())
@ -136,7 +134,6 @@ def get_support_images():
# Check if the file is an image (by extension) # Check if the file is an image (by extension)
if os.path.splitext(filename)[1].lower() in valid_extensions: if os.path.splitext(filename)[1].lower() in valid_extensions:
image_files.append(filename) image_files.append(filename)
print(filename)
return image_files return image_files

9
templates/list-exhibitions.html

@ -23,17 +23,17 @@
{% for event in content %} {% for event in content %}
{% if event.exh_type == ex_type %} {% if event.exh_type == ex_type %}
{% if ex_type == "UTA"%} {% if ex_type == "UTA"%}
<a href='/{{ title.lower() }}/unsettling-the-algorithm/{{ event.title }}'> <a href='/{{ title.lower() }}/unsettling-the-algorithm/{{ event.title }}'>
{% endif %} {% endif %}
{% if ex_type == "LAN"%} {% if ex_type == "LAN"%}
<a href='/{{ title.lower() }}/local-artists-network/{{ event.title }}'> <a href='/{{ title.lower() }}/local-artists-network/{{event.title}}'>
{% endif %} {% endif %}
<div class="list"> <div class="list">
<div class="list-image"> <div class="list-image">
<img src="{{ event.image }}" alt="{{ event.title }}" loading="lazy"> <img src="{{ event.image }}" alt="{{event.title}}" loading="lazy">
<div class="list-image-overlay"></div> <div class="list-image-overlay"></div>
</div> </div>
<div class="list-title">{{ event.title }}</div> <div class="list-title">{{event.title}}</div>
<div class="list-artists"> <div class="list-artists">
<p>{{ event.artists | join(', ') }}</p> <p>{{ event.artists | join(', ') }}</p>
</div> </div>
@ -44,7 +44,6 @@
{% if event.times %} {% if event.times %}
<div class="list-date">● {{ event.times | join(', ')}}</div> <div class="list-date">● {{ event.times | join(', ')}}</div>
{% endif %} {% endif %}
<div class="list-date">● {{ event.location[0] }}</div> <div class="list-date">● {{ event.location[0] }}</div>
</div> </div>
</div> </div>

Loading…
Cancel
Save