Browse Source

last update!

master
Cailean Finn 3 months ago
parent
commit
956cb84811
  1. 23
      app.py
  2. 24
      public/css/styles.css
  3. BIN
      public/images/support/CFA-Primary-Logo-Purple.png
  4. BIN
      public/images/support/Fire Station Artists Studio.png
  5. BIN
      public/images/support/Goethe Institut irland.png
  6. BIN
      public/images/support/Science Week Logo (No Date RGB) (1) - Copy.png
  7. BIN
      public/images/support/af.png
  8. 0
      public/images/support/dg.png
  9. BIN
      public/images/support/fablab - Main Logo.png
  10. BIN
      public/images/support/if.png
  11. 0
      public/images/support/nn.png
  12. BIN
      public/images/support/sw.png
  13. 15
      templates/article.html
  14. 8
      templates/index.html

23
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):

24
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;
}

BIN
public/images/support/CFA-Primary-Logo-Purple.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 25 KiB

BIN
public/images/support/Fire Station Artists Studio.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
public/images/support/Goethe Institut irland.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 320 KiB

BIN
public/images/support/Science Week Logo (No Date RGB) (1) - Copy.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 KiB

BIN
public/images/support/af.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

0
public/images/support/digital_hub_0.png → public/images/support/dg.png

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

BIN
public/images/support/fablab - Main Logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
public/images/support/if.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

0
public/images/support/Novembre Numerique.png → public/images/support/nn.png

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

BIN
public/images/support/sw.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

15
templates/article.html

@ -42,6 +42,21 @@
</div>
<div id="article-information"><br>{{ article.information | replace('\n', '<br>') | safe }}</div>
{% if article.title == "Noire" %}
<div id="index-support-prio">
<div class="index-prio-img">
<img src="{{ url_for('static', filename='images/support/if.png') }}">
</div>
<div class="index-prio-img">
<img src="{{ url_for('static', filename='images/support/af.png') }}">
</div>
<div class="index-prio-img">
<img src="{{ url_for('static', filename='images/support/nn.png') }}">
</div>
</div>
{% endif %}
</div>
<div id="article-image">
<div id="container-article"></div>

8
templates/index.html

@ -42,6 +42,14 @@
<a href="https://www.instagram.com/betafest_irl/" target="_blank"><span>↑ instagram</span></a>
</div>
<div id="index-support-prio">
{% for img in prio_img %}
<div class="index-prio-img">
<img src="{{ url_for('static', filename='images/support/' + img) }}">
</div>
{% endfor %}
</div>
<div id="index-support">
{% for img in sup_img_list %}
<div class="index-support-img">

Loading…
Cancel
Save