Browse Source

last update!

master
Cailean Finn 3 months ago
parent
commit
bbbc8bf9b0
  1. 11
      app.py
  2. BIN
      public/images/support/ac.png
  3. 8
      templates/index.html

11
app.py

@ -16,8 +16,8 @@ client = contentful.Client(SPACE_ID, ACCESS_TOKEN)
@app.route('/')
def index():
sup_img, prio_img = get_support_images()
return render_template('index.html', title='', sup_img_list=sup_img, prio_img=prio_img)
sup_img, prio_img, prio_img_top = get_support_images()
return render_template('index.html', title='', sup_img_list=sup_img, prio_img=prio_img, prio_img_top=prio_img_top)
@app.route('/grph')
def graphics():
@ -144,17 +144,20 @@ def get_support_images():
# List to hold the image file names
image_files = []
prio_image_files = []
prio_image_top_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:
if os.path.splitext(filename)[0].lower() == "dg" or os.path.splitext(filename)[0].lower() == "sw" or os.path.splitext(filename)[0].lower() == "french-emb" or os.path.splitext(filename)[0].lower() == "nn" or os.path.splitext(filename)[0].lower() == "if":
if os.path.splitext(filename)[0].lower() == "dg" or os.path.splitext(filename)[0].lower() == "sw":
prio_image_top_files.append(filename)
elif os.path.splitext(filename)[0].lower() == "french-emb" or os.path.splitext(filename)[0].lower() == "nn" or os.path.splitext(filename)[0].lower() == "if":
prio_image_files.append(filename)
else:
image_files.append(filename)
return image_files, prio_image_files
return image_files, prio_image_files, prio_image_top_files
def format_datetime(dt):

BIN
public/images/support/ac.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

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_top %}
<div class="index-prio-img">
<img src="{{ url_for('static', filename='images/support/' + img) }}">
</div>
{% endfor %}
</div>
<div id="index-support-prio">
{% for img in prio_img %}
<div class="index-prio-img">

Loading…
Cancel
Save