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
+16 -7
View File
@@ -15,16 +15,21 @@ header_context = {
"focus": "Endurance",
}
footer_context = [{
"contact_email": "info@ishplabs.com ",
"website": "www.ishplabs.com",
"social": "@ishplabs",
"page_number": i + 1,
} for i in range(len(context_list))]
footer_context = [
{
"contact_email": "info@ishplabs.com ",
"website": "www.ishplabs.com",
"social": "@ishplabs",
"page_number": i + 1,
}
for i in range(len(context_list))
]
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):
template = env.get_template(f"page_{i + 1}.html").render(context)
@@ -84,6 +89,10 @@ html_doc = f"""
max-height: 200px;
object-fit: contain;
}}
/* Larger images for specific charts */
.chart-large {{
max-height: 500px !important;
}}
</style>
</head>
<body class="m-0 p-0">
Binary file not shown.
+4 -2
View File
@@ -25,11 +25,13 @@
</div>
<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
src="data:image/png;base64,{{ body_fat_percentage_chart }}"
alt="Body Fat Percentage"
class="w-full h-auto object-contain"
class="w-full h-auto object-contain chart-large"
/>
</div>
</div>
+17 -17
View File
@@ -1,21 +1,21 @@
<div class="w-full page bg-white">
<!-- Main Content -->
<div class="flex flex-col items-center justify-center h-full">
<!-- Fuel Utilization Chart -->
<div class="w-full max-w-5xl">
<img
src="data:image/png;base64,{{ fuel_utilization_chart }}"
alt="Fuel Utilization Report - Institute of Science, Health and Performance"
class="w-full h-auto object-contain chart-large"
/>
</div>
<!-- Main Content -->
<div class="flex flex-col items-center justify-center h-full">
<!-- Fuel Utilization Chart -->
<div class="w-full max-w-5xl">
<img src="data:image/png;base64,{{ fuel_utilization_chart }}"
alt="Fuel Utilization Report - Institute of Science, Health and Performance"
class="w-full h-auto object-contain">
<!-- Chart Information -->
<div class="mt-8 text-center">
<p class="text-gray-700 text-sm">
Client: {{ client_name | default('Keirstyn Moran') }} |
Assessment Date: {{ assessment_date | default('July 29 2025') }}
</p>
</div>
</div>
<!-- Chart Information -->
<div class="mt-8 text-center">
<p class="text-gray-700 text-sm">
Client: {{ client_name | default('Keirstyn Moran') }} |
Assessment Date: {{ assessment_date | default('July 29 2025') }}
</p>
</div>
</div>
</div>