Browse Source

last update!

master
Cailean Finn 2 weeks 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('/') @app.route('/')
def index(): def index():
sup_img, prio_img = get_support_images() 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) return render_template('index.html', title='', sup_img_list=sup_img, prio_img=prio_img, prio_img_top=prio_img_top)
@app.route('/grph') @app.route('/grph')
def graphics(): def graphics():
@ -144,17 +144,20 @@ def get_support_images():
# List to hold the image file names # List to hold the image file names
image_files = [] image_files = []
prio_image_files = [] prio_image_files = []
prio_image_top_files = []
# Loop through files in the directory # Loop through files in the directory
for filename in os.listdir(image_folder): for filename in os.listdir(image_folder):
# 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:
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) prio_image_files.append(filename)
else: else:
image_files.append(filename) image_files.append(filename)
return image_files, prio_image_files return image_files, prio_image_files, prio_image_top_files
def format_datetime(dt): 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> <a href="https://www.instagram.com/betafest_irl/" target="_blank"><span>↑ instagram</span></a>
</div> </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"> <div id="index-support-prio">
{% for img in prio_img %} {% for img in prio_img %}
<div class="index-prio-img"> <div class="index-prio-img">

Loading…
Cancel
Save