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