diff --git a/app.py b/app.py index 73776e9..b03e860 100644 --- a/app.py +++ b/app.py @@ -16,8 +16,8 @@ client = contentful.Client(SPACE_ID, ACCESS_TOKEN) @app.route('/') def index(): - sup_img = get_support_images() - return render_template('index.html', title='', sup_img_list=sup_img) + sup_img, prio_img = get_support_images() + return render_template('index.html', title='', sup_img_list=sup_img, prio_img=prio_img) @app.route('/grph') def graphics(): @@ -70,7 +70,14 @@ def get_all_content(type): def get_content_by_title(title, pre_type): type = pre_type[:-1] entries = client.entries({'query': title, 'limit': 5}) - exact_matches = [entry for entry in entries if getattr(entry, f'title_of_{type}') == title] + exact_matches = [] + for entry in entries: + try: + if getattr(entry, f'title_of_{type}') == title: + exact_matches = [entry] + except: + pass + content_list = process_content(exact_matches, type) return content_list @@ -120,6 +127,8 @@ def process_content(entries, type): 'exh_type': exh_type } content_list.append(content) + print(content) + print("\n") # Sort the content list by the 'title' key alphabetically content_list.sort(key=lambda x: x['title'].lower()) @@ -134,14 +143,18 @@ def get_support_images(): # List to hold the image file names image_files = [] + prio_image_files = [] # Loop through files in the directory for filename in os.listdir(image_folder): # Check if the file is an image (by extension) if os.path.splitext(filename)[1].lower() in valid_extensions: - image_files.append(filename) + if os.path.splitext(filename)[0].lower() == "dg" or os.path.splitext(filename)[0].lower() == "sw": + prio_image_files.append(filename) + else: + image_files.append(filename) - return image_files + return image_files, prio_image_files def format_datetime(dt): diff --git a/public/css/styles.css b/public/css/styles.css index e266599..e0d992c 100644 --- a/public/css/styles.css +++ b/public/css/styles.css @@ -250,11 +250,31 @@ hr { align-items: center; } +#index-support-prio { + flex-direction: row; + display: flex; + gap: 25px; + margin-top: 50px; + flex-wrap: wrap; + justify-content: space-around; + align-items: center; +} + .index-support-img { width: 100px; height: auto; } +.index-prio-img { + width: 300px; + height: auto; +} + +.index-prio-img img{ + width: 100%; + height: auto; +} + .index-support-img img { width: 100%; height: auto; @@ -847,6 +867,10 @@ animation: 2s fadeInUp; #index-support { + order: -3; + } + + #index-support-prio { order: -2; } diff --git a/public/images/support/CFA-Primary-Logo-Purple.png b/public/images/support/CFA-Primary-Logo-Purple.png index 72f6d4a..afe9780 100644 Binary files a/public/images/support/CFA-Primary-Logo-Purple.png and b/public/images/support/CFA-Primary-Logo-Purple.png differ diff --git a/public/images/support/Fire Station Artists Studio.png b/public/images/support/Fire Station Artists Studio.png new file mode 100644 index 0000000..873049e Binary files /dev/null and b/public/images/support/Fire Station Artists Studio.png differ diff --git a/public/images/support/Goethe Institut irland.png b/public/images/support/Goethe Institut irland.png deleted file mode 100644 index 12acb7e..0000000 Binary files a/public/images/support/Goethe Institut irland.png and /dev/null differ diff --git a/public/images/support/Science Week Logo (No Date RGB) (1) - Copy.png b/public/images/support/Science Week Logo (No Date RGB) (1) - Copy.png deleted file mode 100644 index ae82472..0000000 Binary files a/public/images/support/Science Week Logo (No Date RGB) (1) - Copy.png and /dev/null differ diff --git a/public/images/support/af.png b/public/images/support/af.png new file mode 100644 index 0000000..a1e6f7b Binary files /dev/null and b/public/images/support/af.png differ diff --git a/public/images/support/digital_hub_0.png b/public/images/support/dg.png similarity index 100% rename from public/images/support/digital_hub_0.png rename to public/images/support/dg.png diff --git a/public/images/support/fablab - Main Logo.png b/public/images/support/fablab - Main Logo.png new file mode 100644 index 0000000..be42e0b Binary files /dev/null and b/public/images/support/fablab - Main Logo.png differ diff --git a/public/images/support/if.png b/public/images/support/if.png new file mode 100644 index 0000000..44f4862 Binary files /dev/null and b/public/images/support/if.png differ diff --git a/public/images/support/Novembre Numerique.png b/public/images/support/nn.png similarity index 100% rename from public/images/support/Novembre Numerique.png rename to public/images/support/nn.png diff --git a/public/images/support/sw.png b/public/images/support/sw.png new file mode 100644 index 0000000..a6e3bf9 Binary files /dev/null and b/public/images/support/sw.png differ diff --git a/templates/article.html b/templates/article.html index c372773..8bd3f30 100644 --- a/templates/article.html +++ b/templates/article.html @@ -42,6 +42,21 @@

{{ article.information | replace('\n', '
') | safe }}
+ {% if article.title == "Noire" %} +
+ +
+ +
+
+ +
+
+ +
+ +
+ {% endif %}
diff --git a/templates/index.html b/templates/index.html index 9bfb604..4f3ff08 100644 --- a/templates/index.html +++ b/templates/index.html @@ -42,6 +42,14 @@ ↑ instagram
+
+ {% for img in prio_img %} +
+ +
+ {% endfor %} +
+
{% for img in sup_img_list %}