Condense school detail page layout for better space efficiency
All checks were successful
Build and Push Docker Images / Build Backend (FastAPI) (push) Successful in 34s
Build and Push Docker Images / Build Frontend (Next.js) (push) Successful in 1m13s
Build and Push Docker Images / Trigger Portainer Update (push) Successful in 1s

- Reduced section padding from 2rem to 1rem-1.25rem
- Reduced margin-bottom from 2rem to 1rem
- Smaller chart height (400px → 280px) and map height (400px → 250px)
- Detailed metrics now in 3-column grid layout
- Condensed font sizes and spacing throughout
- Applied design system colors consistently
- Shortened metric labels (e.g., "Expected Standard" → "Expected")

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Tudor
2026-02-04 12:14:28 +00:00
parent 3cab49a2b3
commit ec61e16c9d
2 changed files with 249 additions and 218 deletions

View File

@@ -4,19 +4,19 @@
/* Header Section */ /* Header Section */
.header { .header {
background: white; background: var(--bg-card, white);
border: 1px solid var(--border-light); border: 1px solid var(--border-color, #e5dfd5);
border-radius: var(--radius-lg); border-radius: 10px;
padding: 2rem; padding: 1.25rem 1.5rem;
margin-bottom: 2rem; margin-bottom: 1rem;
box-shadow: var(--shadow-sm); box-shadow: var(--shadow-soft);
} }
.headerContent { .headerContent {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: flex-start; align-items: flex-start;
gap: 2rem; gap: 1.5rem;
} }
.titleSection { .titleSection {
@@ -24,62 +24,65 @@
} }
.schoolName { .schoolName {
font-size: 2rem; font-size: 1.5rem;
font-weight: 700; font-weight: 700;
color: var(--text-primary); color: var(--text-primary, #1a1612);
margin-bottom: 0.75rem; margin-bottom: 0.5rem;
line-height: 1.2; line-height: 1.2;
font-family: var(--font-playfair), 'Playfair Display', serif;
} }
.meta { .meta {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 1rem; gap: 0.5rem;
margin-bottom: 0.75rem; margin-bottom: 0.5rem;
} }
.metaItem { .metaItem {
font-size: 0.9375rem; font-size: 0.8125rem;
color: var(--text-secondary); color: var(--text-secondary, #5c564d);
display: flex; padding: 0.125rem 0.5rem;
align-items: center; background: var(--bg-secondary, #f3ede4);
gap: 0.25rem; border-radius: 3px;
} }
.address { .address {
font-size: 1rem; font-size: 0.875rem;
color: var(--text-secondary); color: var(--text-muted, #8a847a);
margin: 0; margin: 0;
} }
.actions { .actions {
display: flex; display: flex;
gap: 0.75rem; gap: 0.5rem;
flex-shrink: 0;
} }
.btnAdd, .btnAdd,
.btnRemove { .btnRemove {
padding: 0.75rem 1.5rem; padding: 0.5rem 1rem;
font-size: 0.9375rem; font-size: 0.8125rem;
font-weight: 500; font-weight: 600;
border: none; border: none;
border-radius: var(--radius-md); border-radius: 6px;
cursor: pointer; cursor: pointer;
transition: all var(--transition); transition: all 0.2s ease;
white-space: nowrap; white-space: nowrap;
} }
.btnAdd { .btnAdd {
background: var(--primary); background: var(--accent-coral, #e07256);
color: white; color: white;
} }
.btnAdd:hover { .btnAdd:hover {
background: var(--primary-dark); background: var(--accent-coral-dark, #c45a3f);
transform: translateY(-1px);
} }
.btnRemove { .btnRemove {
background: var(--success); background: var(--accent-teal, #2d7d7d);
color: white; color: white;
} }
@@ -87,223 +90,246 @@
opacity: 0.9; opacity: 0.9;
} }
/* Summary Section */ /* Section Title */
.summary { .sectionTitle {
background: white; font-size: 1.125rem;
border: 1px solid var(--border-light); font-weight: 600;
border-radius: var(--radius-lg); color: var(--text-primary, #1a1612);
padding: 2rem; margin-bottom: 0.875rem;
margin-bottom: 2rem; padding-bottom: 0.5rem;
box-shadow: var(--shadow-sm); border-bottom: 2px solid var(--border-color, #e5dfd5);
font-family: var(--font-playfair), 'Playfair Display', serif;
display: flex;
align-items: center;
gap: 0.375rem;
} }
.sectionTitle { .sectionTitle::before {
font-size: 1.5rem; content: '';
font-weight: 600; display: inline-block;
color: var(--text-primary); width: 3px;
margin-bottom: 1.5rem; height: 1em;
padding-bottom: 0.75rem; background: var(--accent-coral, #e07256);
border-bottom: 2px solid var(--border-light); border-radius: 2px;
}
/* Summary Section */
.summary {
background: var(--bg-card, white);
border: 1px solid var(--border-color, #e5dfd5);
border-radius: 10px;
padding: 1rem 1.25rem;
margin-bottom: 1rem;
box-shadow: var(--shadow-soft);
} }
.metricsGrid { .metricsGrid {
display: grid; display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
gap: 1rem; gap: 0.75rem;
} }
.metricCard { .metricCard {
background: var(--bg-secondary); background: var(--bg-secondary, #f3ede4);
border: 1px solid var(--border-light); border: 1px solid var(--border-color, #e5dfd5);
border-radius: var(--radius-md); border-radius: 6px;
padding: 1.25rem; padding: 0.75rem;
text-align: center; text-align: center;
} }
.metricLabel { .metricLabel {
font-size: 0.875rem; font-size: 0.6875rem;
color: var(--text-secondary); color: var(--text-muted, #8a847a);
margin-bottom: 0.5rem; margin-bottom: 0.25rem;
font-weight: 500; font-weight: 500;
text-transform: uppercase;
letter-spacing: 0.03em;
} }
.metricValue { .metricValue {
font-size: 1.75rem; font-size: 1.25rem;
font-weight: 700; font-weight: 700;
color: var(--text-primary); color: var(--text-primary, #1a1612);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
gap: 0.5rem; gap: 0.25rem;
} }
.metricTrend { .metricTrend {
font-size: 1.25rem; font-size: 1rem;
color: var(--secondary); color: var(--accent-teal, #2d7d7d);
} }
/* Charts Section */ /* Charts Section */
.chartsSection { .chartsSection {
background: white; background: var(--bg-card, white);
border: 1px solid var(--border-light); border: 1px solid var(--border-color, #e5dfd5);
border-radius: var(--radius-lg); border-radius: 10px;
padding: 2rem; padding: 1rem 1.25rem;
margin-bottom: 2rem; margin-bottom: 1rem;
box-shadow: var(--shadow-sm); box-shadow: var(--shadow-soft);
} }
.chartContainer { .chartContainer {
width: 100%; width: 100%;
height: 400px; height: 280px;
position: relative; position: relative;
} }
/* Detailed Metrics */ /* Detailed Metrics - Compact Grid Layout */
.detailedMetrics { .detailedMetrics {
background: white; background: var(--bg-card, white);
border: 1px solid var(--border-light); border: 1px solid var(--border-color, #e5dfd5);
border-radius: var(--radius-lg); border-radius: 10px;
padding: 2rem; padding: 1rem 1.25rem;
margin-bottom: 2rem; margin-bottom: 1rem;
box-shadow: var(--shadow-sm); box-shadow: var(--shadow-soft);
}
.metricGroupsGrid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 1rem;
} }
.metricGroup { .metricGroup {
margin-bottom: 2rem;
}
.metricGroup:last-child {
margin-bottom: 0; margin-bottom: 0;
} }
.metricGroupTitle { .metricGroupTitle {
font-size: 1.125rem; font-size: 0.875rem;
font-weight: 600; font-weight: 600;
color: var(--text-primary); color: var(--text-primary, #1a1612);
margin-bottom: 1rem; margin-bottom: 0.5rem;
padding-bottom: 0.375rem;
border-bottom: 1px solid var(--border-color, #e5dfd5);
display: flex; display: flex;
align-items: center; align-items: center;
gap: 0.5rem; gap: 0.375rem;
} }
.metricTable { .metricTable {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 0.75rem; gap: 0.375rem;
} }
.metricRow { .metricRow {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 0.75rem 1rem; padding: 0.375rem 0.625rem;
background: var(--bg-secondary); background: var(--bg-secondary, #f3ede4);
border-radius: var(--radius-md); border-radius: 4px;
} }
.metricName { .metricName {
font-size: 0.9375rem; font-size: 0.75rem;
color: var(--text-secondary); color: var(--text-secondary, #5c564d);
} }
.metricRow .metricValue { .metricRow .metricValue {
font-size: 1rem; font-size: 0.875rem;
font-weight: 600; font-weight: 600;
color: var(--text-primary); color: var(--accent-teal, #2d7d7d);
} }
/* Absence Section */ /* Absence Section */
.absenceSection { .absenceSection {
background: white; background: var(--bg-card, white);
border: 1px solid var(--border-light); border: 1px solid var(--border-color, #e5dfd5);
border-radius: var(--radius-lg); border-radius: 10px;
padding: 2rem; padding: 1rem 1.25rem;
margin-bottom: 2rem; margin-bottom: 1rem;
box-shadow: var(--shadow-sm); box-shadow: var(--shadow-soft);
} }
.absenceGrid { .absenceGrid {
display: grid; display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 1rem; gap: 0.75rem;
} }
.absenceCard { .absenceCard {
background: var(--bg-secondary); background: var(--bg-secondary, #f3ede4);
border: 1px solid var(--border-light); border: 1px solid var(--border-color, #e5dfd5);
border-radius: var(--radius-md); border-radius: 6px;
padding: 1.5rem; padding: 0.75rem 1rem;
text-align: center; text-align: center;
} }
.absenceLabel { .absenceLabel {
font-size: 0.9375rem; font-size: 0.75rem;
color: var(--text-secondary); color: var(--text-muted, #8a847a);
margin-bottom: 0.75rem; margin-bottom: 0.25rem;
font-weight: 500; font-weight: 500;
} }
.absenceValue { .absenceValue {
font-size: 1.5rem; font-size: 1.125rem;
font-weight: 700; font-weight: 700;
color: var(--text-primary); color: var(--text-primary, #1a1612);
} }
/* Map Section */ /* Map Section */
.mapSection { .mapSection {
background: white; background: var(--bg-card, white);
border: 1px solid var(--border-light); border: 1px solid var(--border-color, #e5dfd5);
border-radius: var(--radius-lg); border-radius: 10px;
padding: 2rem; padding: 1rem 1.25rem;
margin-bottom: 2rem; margin-bottom: 1rem;
box-shadow: var(--shadow-sm); box-shadow: var(--shadow-soft);
} }
.mapContainer { .mapContainer {
width: 100%; width: 100%;
height: 400px; height: 250px;
border-radius: var(--radius-md); border-radius: 8px;
overflow: hidden; overflow: hidden;
border: 1px solid var(--border-light); border: 1px solid var(--border-color, #e5dfd5);
} }
/* History Section */ /* History Section */
.historySection { .historySection {
background: white; background: var(--bg-card, white);
border: 1px solid var(--border-light); border: 1px solid var(--border-color, #e5dfd5);
border-radius: var(--radius-lg); border-radius: 10px;
padding: 2rem; padding: 1rem 1.25rem;
margin-bottom: 2rem; margin-bottom: 1rem;
box-shadow: var(--shadow-sm); box-shadow: var(--shadow-soft);
} }
.tableWrapper { .tableWrapper {
overflow-x: auto; overflow-x: auto;
margin-top: 1rem; margin-top: 0.5rem;
} }
.dataTable { .dataTable {
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
font-size: 0.9375rem; font-size: 0.8125rem;
} }
.dataTable thead { .dataTable thead {
background: var(--bg-secondary); background: var(--bg-secondary, #f3ede4);
} }
.dataTable th { .dataTable th {
padding: 1rem; padding: 0.625rem 0.75rem;
text-align: left; text-align: left;
font-weight: 600; font-weight: 600;
color: var(--text-primary); font-size: 0.6875rem;
border-bottom: 2px solid var(--border-medium); text-transform: uppercase;
letter-spacing: 0.03em;
color: var(--text-primary, #1a1612);
border-bottom: 2px solid var(--border-color, #e5dfd5);
} }
.dataTable td { .dataTable td {
padding: 1rem; padding: 0.5rem 0.75rem;
border-bottom: 1px solid var(--border-light); border-bottom: 1px solid var(--border-color, #e5dfd5);
color: var(--text-secondary); color: var(--text-secondary, #5c564d);
} }
.dataTable tbody tr:last-child td { .dataTable tbody tr:last-child td {
@@ -311,19 +337,19 @@
} }
.dataTable tbody tr:hover { .dataTable tbody tr:hover {
background: var(--bg-secondary); background: var(--bg-secondary, #f3ede4);
} }
.yearCell { .yearCell {
font-weight: 600; font-weight: 600;
color: var(--text-primary); color: var(--accent-gold, #c9a227);
} }
/* Responsive Design */ /* Responsive Design */
@media (max-width: 768px) { @media (max-width: 768px) {
.headerContent { .headerContent {
flex-direction: column; flex-direction: column;
gap: 1.5rem; gap: 1rem;
} }
.actions { .actions {
@@ -336,32 +362,36 @@
} }
.schoolName { .schoolName {
font-size: 1.5rem; font-size: 1.25rem;
} }
.meta { .meta {
flex-direction: column; flex-direction: column;
gap: 0.5rem; gap: 0.375rem;
} }
.metricsGrid { .metricsGrid {
grid-template-columns: repeat(2, 1fr);
}
.metricGroupsGrid {
grid-template-columns: 1fr; grid-template-columns: 1fr;
} }
.chartContainer { .chartContainer {
height: 300px; height: 220px;
} }
.mapContainer { .mapContainer {
height: 300px; height: 200px;
} }
.dataTable { .dataTable {
font-size: 0.875rem; font-size: 0.75rem;
} }
.dataTable th, .dataTable th,
.dataTable td { .dataTable td {
padding: 0.75rem 0.5rem; padding: 0.5rem 0.375rem;
} }
} }

View File

@@ -157,91 +157,92 @@ export function SchoolDetailView({ schoolInfo, yearlyData, absenceData }: School
{latestResults && ( {latestResults && (
<section className={styles.detailedMetrics}> <section className={styles.detailedMetrics}>
<h2 className={styles.sectionTitle}>Detailed Metrics</h2> <h2 className={styles.sectionTitle}>Detailed Metrics</h2>
<div className={styles.metricGroupsGrid}>
{/* Reading Metrics */} {/* Reading Metrics */}
<div className={styles.metricGroup}> <div className={styles.metricGroup}>
<h3 className={styles.metricGroupTitle}>📖 Reading</h3> <h3 className={styles.metricGroupTitle}>Reading</h3>
<div className={styles.metricTable}> <div className={styles.metricTable}>
{latestResults.reading_expected_pct !== null && ( {latestResults.reading_expected_pct !== null && (
<div className={styles.metricRow}> <div className={styles.metricRow}>
<span className={styles.metricName}>Expected Standard</span> <span className={styles.metricName}>Expected</span>
<span className={styles.metricValue}>{formatPercentage(latestResults.reading_expected_pct)}</span> <span className={styles.metricValue}>{formatPercentage(latestResults.reading_expected_pct)}</span>
</div> </div>
)} )}
{latestResults.reading_high_pct !== null && ( {latestResults.reading_high_pct !== null && (
<div className={styles.metricRow}> <div className={styles.metricRow}>
<span className={styles.metricName}>Higher Standard</span> <span className={styles.metricName}>Higher</span>
<span className={styles.metricValue}>{formatPercentage(latestResults.reading_high_pct)}</span> <span className={styles.metricValue}>{formatPercentage(latestResults.reading_high_pct)}</span>
</div> </div>
)} )}
{latestResults.reading_progress !== null && ( {latestResults.reading_progress !== null && (
<div className={styles.metricRow}> <div className={styles.metricRow}>
<span className={styles.metricName}>Progress Score</span> <span className={styles.metricName}>Progress</span>
<span className={styles.metricValue}>{formatProgress(latestResults.reading_progress)}</span> <span className={styles.metricValue}>{formatProgress(latestResults.reading_progress)}</span>
</div> </div>
)} )}
{latestResults.reading_avg_score !== null && ( {latestResults.reading_avg_score !== null && (
<div className={styles.metricRow}> <div className={styles.metricRow}>
<span className={styles.metricName}>Average Scaled Score</span> <span className={styles.metricName}>Avg Score</span>
<span className={styles.metricValue}>{latestResults.reading_avg_score.toFixed(1)}</span> <span className={styles.metricValue}>{latestResults.reading_avg_score.toFixed(1)}</span>
</div> </div>
)} )}
</div>
</div> </div>
</div>
{/* Writing Metrics */} {/* Writing Metrics */}
<div className={styles.metricGroup}> <div className={styles.metricGroup}>
<h3 className={styles.metricGroupTitle}> Writing</h3> <h3 className={styles.metricGroupTitle}>Writing</h3>
<div className={styles.metricTable}> <div className={styles.metricTable}>
{latestResults.writing_expected_pct !== null && ( {latestResults.writing_expected_pct !== null && (
<div className={styles.metricRow}> <div className={styles.metricRow}>
<span className={styles.metricName}>Expected Standard</span> <span className={styles.metricName}>Expected</span>
<span className={styles.metricValue}>{formatPercentage(latestResults.writing_expected_pct)}</span> <span className={styles.metricValue}>{formatPercentage(latestResults.writing_expected_pct)}</span>
</div> </div>
)} )}
{latestResults.writing_high_pct !== null && ( {latestResults.writing_high_pct !== null && (
<div className={styles.metricRow}> <div className={styles.metricRow}>
<span className={styles.metricName}>Higher Standard</span> <span className={styles.metricName}>Higher</span>
<span className={styles.metricValue}>{formatPercentage(latestResults.writing_high_pct)}</span> <span className={styles.metricValue}>{formatPercentage(latestResults.writing_high_pct)}</span>
</div> </div>
)} )}
{latestResults.writing_progress !== null && ( {latestResults.writing_progress !== null && (
<div className={styles.metricRow}> <div className={styles.metricRow}>
<span className={styles.metricName}>Progress Score</span> <span className={styles.metricName}>Progress</span>
<span className={styles.metricValue}>{formatProgress(latestResults.writing_progress)}</span> <span className={styles.metricValue}>{formatProgress(latestResults.writing_progress)}</span>
</div> </div>
)} )}
</div>
</div> </div>
</div>
{/* Maths Metrics */} {/* Maths Metrics */}
<div className={styles.metricGroup}> <div className={styles.metricGroup}>
<h3 className={styles.metricGroupTitle}>Mathematics</h3> <h3 className={styles.metricGroupTitle}>Maths</h3>
<div className={styles.metricTable}> <div className={styles.metricTable}>
{latestResults.maths_expected_pct !== null && ( {latestResults.maths_expected_pct !== null && (
<div className={styles.metricRow}> <div className={styles.metricRow}>
<span className={styles.metricName}>Expected Standard</span> <span className={styles.metricName}>Expected</span>
<span className={styles.metricValue}>{formatPercentage(latestResults.maths_expected_pct)}</span> <span className={styles.metricValue}>{formatPercentage(latestResults.maths_expected_pct)}</span>
</div> </div>
)} )}
{latestResults.maths_high_pct !== null && ( {latestResults.maths_high_pct !== null && (
<div className={styles.metricRow}> <div className={styles.metricRow}>
<span className={styles.metricName}>Higher Standard</span> <span className={styles.metricName}>Higher</span>
<span className={styles.metricValue}>{formatPercentage(latestResults.maths_high_pct)}</span> <span className={styles.metricValue}>{formatPercentage(latestResults.maths_high_pct)}</span>
</div> </div>
)} )}
{latestResults.maths_progress !== null && ( {latestResults.maths_progress !== null && (
<div className={styles.metricRow}> <div className={styles.metricRow}>
<span className={styles.metricName}>Progress Score</span> <span className={styles.metricName}>Progress</span>
<span className={styles.metricValue}>{formatProgress(latestResults.maths_progress)}</span> <span className={styles.metricValue}>{formatProgress(latestResults.maths_progress)}</span>
</div> </div>
)} )}
{latestResults.maths_avg_score !== null && ( {latestResults.maths_avg_score !== null && (
<div className={styles.metricRow}> <div className={styles.metricRow}>
<span className={styles.metricName}>Average Scaled Score</span> <span className={styles.metricName}>Avg Score</span>
<span className={styles.metricValue}>{latestResults.maths_avg_score.toFixed(1)}</span> <span className={styles.metricValue}>{latestResults.maths_avg_score.toFixed(1)}</span>
</div> </div>
)} )}
</div>
</div> </div>
</div> </div>
</section> </section>