Browse Source

emojis added & re-order of categories opp

main
Cailean Finn 6 months ago
parent
commit
4faa9e5f42
  1. 12
      app.py
  2. 4
      templates/newsletter.html

12
app.py

@ -66,7 +66,17 @@ class WikiApp(Flask):
opp['text'] = open_call_entry['extract']
sorted_data = {key: sorted(value, key=lambda x: x['deadline'], reverse=True) for key, value in all_opportunities.items()}
return sorted_data
new_order = ['Open Call', 'Residency', 'Funding', 'Job Opportunity', 'Workshop', 'Studio Vacancy']
category_mapping = {
'Open Call': '📯 Open Calls',
'Residency': '🏠 Residencies',
'Funding': '💰 Funding',
'Job Opportunity': '🦺 Job Opportunities',
'Workshop': '🛠️ Workshops',
'Studio Vacancy': '🔓 Studio Vacancies'
}
reordered_dict = {category_mapping[category]: sorted_data[category] for category in new_order if category in sorted_data}
return reordered_dict
def fetch_all_opportunities(self, pub_date, future_date):
opp_page_list = {}

4
templates/newsletter.html

@ -10,7 +10,7 @@
<div class='event-cont'>
{% for key, value in events.items() %}
<hr>
<h2 class='event-heading'>Spotlight</h2>
<h2 class='event-heading'>🔦 Spotlight</h2>
<hr>
<div class='list-events'>
{% for data in value %}
@ -29,7 +29,7 @@
{% for key, value in events.items() %}
<hr>
<h2 class='event-heading'>Events</h2>
<h2 class='event-heading'>🎪 Events</h2>
<hr>
<div class='list-events'>
{% for data in value %}

Loading…
Cancel
Save