Refactor footer context generation and enhance chart image styling for improved layout

This commit is contained in:
bolade
2025-09-26 22:32:39 +01:00
parent 894fbbcee3
commit 604ef375aa
4 changed files with 37 additions and 26 deletions
+12 -3
View File
@@ -15,16 +15,21 @@ header_context = {
"focus": "Endurance", "focus": "Endurance",
} }
footer_context = [{ footer_context = [
{
"contact_email": "info@ishplabs.com ", "contact_email": "info@ishplabs.com ",
"website": "www.ishplabs.com", "website": "www.ishplabs.com",
"social": "@ishplabs", "social": "@ishplabs",
"page_number": i + 1, "page_number": i + 1,
} for i in range(len(context_list))] }
for i in range(len(context_list))
]
header_html = env.get_template("header.html").render(header_context) header_html = env.get_template("header.html").render(header_context)
footer_html_list = [env.get_template("footer.html").render(context) for context in footer_context] footer_html_list = [
env.get_template("footer.html").render(context) for context in footer_context
]
for i, context in enumerate(context_list): for i, context in enumerate(context_list):
template = env.get_template(f"page_{i + 1}.html").render(context) template = env.get_template(f"page_{i + 1}.html").render(context)
@@ -84,6 +89,10 @@ html_doc = f"""
max-height: 200px; max-height: 200px;
object-fit: contain; object-fit: contain;
}} }}
/* Larger images for specific charts */
.chart-large {{
max-height: 500px !important;
}}
</style> </style>
</head> </head>
<body class="m-0 p-0"> <body class="m-0 p-0">
Binary file not shown.
+4 -2
View File
@@ -25,11 +25,13 @@
</div> </div>
<div class="w-full max-w-5xl"> <div class="w-full max-w-5xl">
<h1 class="text-2xl font-bold mb-4 text-center">Body Fat Percent Master Chart</h1> <h1 class="text-2xl font-bold mb-4 text-center">
Body Fat Percent Master Chart
</h1>
<img <img
src="data:image/png;base64,{{ body_fat_percentage_chart }}" src="data:image/png;base64,{{ body_fat_percentage_chart }}"
alt="Body Fat Percentage" alt="Body Fat Percentage"
class="w-full h-auto object-contain" class="w-full h-auto object-contain chart-large"
/> />
</div> </div>
</div> </div>
+4 -4
View File
@@ -1,12 +1,13 @@
<div class="w-full page bg-white"> <div class="w-full page bg-white">
<!-- Main Content --> <!-- Main Content -->
<div class="flex flex-col items-center justify-center h-full"> <div class="flex flex-col items-center justify-center h-full">
<!-- Fuel Utilization Chart --> <!-- Fuel Utilization Chart -->
<div class="w-full max-w-5xl"> <div class="w-full max-w-5xl">
<img src="data:image/png;base64,{{ fuel_utilization_chart }}" <img
src="data:image/png;base64,{{ fuel_utilization_chart }}"
alt="Fuel Utilization Report - Institute of Science, Health and Performance" alt="Fuel Utilization Report - Institute of Science, Health and Performance"
class="w-full h-auto object-contain"> class="w-full h-auto object-contain chart-large"
/>
</div> </div>
<!-- Chart Information --> <!-- Chart Information -->
@@ -17,5 +18,4 @@
</p> </p>
</div> </div>
</div> </div>
</div> </div>