Bug somewhere
All checks were successful
Build, Push, and Deploy to Nomad / docker-nomad (push) Successful in 39s

This commit is contained in:
Henrik Jess
2024-12-19 15:41:41 +01:00
parent b78fb42ed7
commit 47d0834c12
3 changed files with 96 additions and 31 deletions

View File

@@ -44,17 +44,21 @@ def warning(content):
def slider(options, images):
"""Render a slider using the provided HTML structure."""
import uuid
modal_id = uuid.uuid4().hex.upper()[0:6] # Lets create some uniq modals
width = options.get("width", 500)
height = options.get("height", 375)
html_content = []
html_content.append('<div class="button-stack">')
for i, val in enumerate(images):
if i % 2 == 0:
html_content.append(f"""<button onclick="openModal('modal{i}')" class="stacked-button"> <img src="{val}" class="thumbnail"></button>""".strip())
else:
html_content.append(f"""<button onclick="openModal('modal{i}')" class="stacked-button"> <img src="{val}" class="thumbnail" ></button>""".strip())
html_content.append(f"""<div class="modal" id="modal{i}"> <div class="modal-content"> <h2>Billed {i}</h2> <img src="{val}" width="80%" height="80%"> <button onclick="closeModal('modal{i}')">Close</button><button class="next-btn" onclick="nextModal('modal{i}', 'modal{i+1}')">Next</button></div> </div>""")
html_content.append(f"""<div class="modal" id="modal{i}"> <div class="modal-content"> <h2>Modal {i}</h2> <img src="{val}" width="80%" height="80%"> <button onclick="closeModal('modal{i}')">Close</button><button class="next-btn" onclick="nextModal('modal{i}', 'modal{i+1}')">Next</button></div> </div>""")
html_content.append( '</div>' )
html = '\n'.join( html_content )