view project fixes

This commit is contained in:
2026-11-19 20:40:34 +05:45
parent e9e7940410
commit 2718d3d889
2 changed files with 392 additions and 158 deletions
+70 -44
View File
@@ -57,10 +57,35 @@ require __DIR__ . '/includes/header.php';
$skillIcons = !empty($currentProject['skill_icons']) && is_array($currentProject['skill_icons'])
? $currentProject['skill_icons']
: (!empty($currentProject['skills']) && is_array($currentProject['skills']) ? $currentProject['skills'] : []);
$skillIconMap = [];
if (is_array($skillIcons)) {
foreach ($skillIcons as $index => $skillIconEntry) {
if (!is_array($skillIconEntry)) {
continue;
}
$iconLabel = (string) ($skillIconEntry['label'] ?? '');
if ($iconLabel === '') {
$iconLabel = (string) ($projectSkills[$index] ?? '');
}
if ($iconLabel !== '') {
$skillIconMap[$iconLabel] = (string) ($skillIconEntry['icon'] ?? 'sparkles');
}
}
}
$projectSkillItems = [];
foreach ($projectSkills as $skillLabel) {
if (isset($projectSkillItems[$skillLabel])) {
continue;
}
$projectSkillItems[$skillLabel] = [
'label' => $skillLabel,
'icon' => $skillIconMap[$skillLabel] ?? 'sparkles',
];
}
?>
<!-- ===== PROJECT HERO ===== -->
<section class="project-detail__hero section">
<section class="project-detail__hero cert-hero section">
<div class="container">
<div class="project-detail__hero-inner reveal">
<nav class="breadcrumb project-detail__breadcrumb" aria-label="Breadcrumb">
@@ -71,23 +96,16 @@ require __DIR__ . '/includes/header.php';
</ol>
</nav>
<span class="project-detail__badge">Placeholder project</span>
<?php if ($projectCourse !== ''): ?>
<span class="project-detail__course"><?= e($projectCourse) ?></span>
<?php endif; ?>
<h1 class="section__title project-detail__title"><?= e($currentProject['title']) ?></h1>
<h1 class="project-detail__title"><?= e($currentProject['title']) ?></h1>
<?php if (!empty($currentProject['description'])): ?>
<p class="section__lead project-detail__lead"><?= e($currentProject['description']) ?></p>
<p class="project-detail__lead"><?= e($currentProject['description']) ?></p>
<?php endif; ?>
</div>
<div class="project-detail__media reveal">
<img
src="<?= e($currentProject['image']) ?>"
alt="<?= e($currentProject['alt'] ?? $currentProject['title']) ?>"
width="1200"
height="675"
>
</div>
</div>
</section>
@@ -96,23 +114,26 @@ require __DIR__ . '/includes/header.php';
<div class="container">
<div class="project-detail__grid">
<div class="project-detail__main">
<p class="project-detail__disclaimer reveal">Editable placeholder – not an actual student achievement.</p>
<div class="project-detail__disclaimer reveal" role="note">
<span class="project-detail__disclaimer-icon" aria-hidden="true"><?= icon('sparkles') ?></span>
<p>Editable placeholder – not an actual student achievement.</p>
</div>
<?php if (!empty($currentProject['overview'])): ?>
<div class="project-detail__block reveal">
<div class="section__head">
<section class="project-detail__block card reveal">
<div class="project-detail__block-head">
<span class="eyebrow">Project summary</span>
<h2 class="section__title">Overview</h2>
<h2 class="project-detail__block-title">Overview</h2>
</div>
<p class="project-detail__text"><?= e($currentProject['overview']) ?></p>
</div>
</section>
<?php endif; ?>
<?php if (!empty($currentProject['built']) && is_array($currentProject['built'])): ?>
<div class="project-detail__block reveal">
<div class="section__head">
<section class="project-detail__block card reveal">
<div class="project-detail__block-head">
<span class="eyebrow">Student work</span>
<h2 class="section__title">What the students built</h2>
<h2 class="project-detail__block-title">What the students built</h2>
</div>
<ul class="project-detail__list">
<?php foreach ($currentProject['built'] as $item): ?>
@@ -122,38 +143,31 @@ require __DIR__ . '/includes/header.php';
</li>
<?php endforeach; ?>
</ul>
</div>
</section>
<?php endif; ?>
<?php if (!empty($skillIcons) && is_array($skillIcons)): ?>
<div class="project-detail__block reveal">
<div class="section__head">
<?php if (!empty($projectSkillItems)): ?>
<section class="project-detail__block reveal">
<div class="project-detail__block-head">
<span class="eyebrow">Learning outcomes</span>
<h2 class="section__title">Skills learned</h2>
<h2 class="project-detail__block-title">Skills learned</h2>
</div>
<ul class="project-detail__skills">
<?php foreach ($skillIcons as $skill): ?>
<?php
$skillLabel = is_array($skill) ? ($skill['label'] ?? '') : (string) $skill;
$skillIcon = is_array($skill) ? ($skill['icon'] ?? 'sparkles') : 'sparkles';
if ($skillLabel === '') {
continue;
}
?>
<?php foreach ($projectSkillItems as $skill): ?>
<li class="project-detail__skill card">
<span class="project-detail__skill-icon"><?= icon($skillIcon) ?></span>
<span class="project-detail__skill-label"><?= e($skillLabel) ?></span>
<span class="project-detail__skill-icon"><?= icon($skill['icon']) ?></span>
<span class="project-detail__skill-label"><?= e($skill['label']) ?></span>
</li>
<?php endforeach; ?>
</ul>
</div>
</section>
<?php endif; ?>
<?php if (!empty($currentProject['brief']) || !empty($currentProject['process']) || !empty($currentProject['reflection'])): ?>
<div class="project-detail__block reveal">
<div class="section__head">
<section class="project-detail__block reveal">
<div class="project-detail__block-head">
<span class="eyebrow">More than the final output</span>
<h2 class="section__title">Brief / Process / Reflection</h2>
<h2 class="project-detail__block-title">Brief / Process / Reflection</h2>
</div>
<div class="project-detail__thinking-grid">
<?php if (!empty($currentProject['brief'])): ?>
@@ -178,13 +192,16 @@ require __DIR__ . '/includes/header.php';
</article>
<?php endif; ?>
</div>
</div>
</section>
<?php endif; ?>
</div>
<aside class="project-detail__sidebar reveal">
<div class="project-detail__meta card">
<h2 class="project-detail__meta-title">Project details</h2>
<div class="project-detail__block-head">
<span class="eyebrow">At a glance</span>
<h2 class="project-detail__meta-title">Project details</h2>
</div>
<dl class="project-detail__meta-list">
<?php if ($projectCourse !== ''): ?>
<div class="project-detail__meta-item">
@@ -235,7 +252,7 @@ require __DIR__ . '/includes/header.php';
</dl>
</div>
<a class="btn btn--light project-detail__back-link" href="student-work.php#gallery">Back to all projects</a>
<a class="btn btn--primary project-detail__back-link" href="student-work.php#gallery">Back to all projects</a>
</aside>
</div>
</div>
@@ -278,6 +295,15 @@ require __DIR__ . '/includes/header.php';
}));
}
$skillsLine = implode(' · ', $skillsList);
$metaParts = [];
if ($student !== '') {
$metaParts[] = $student;
}
if ($batch !== '') {
$metaParts[] = $batch;
}
$metaParts[] = 'Editable placeholders – not an actual student achievement';
$metaLine = implode(' · ', $metaParts);
?>
<article class="student-card card reveal">
<div class="student-card__media">
@@ -299,7 +325,7 @@ require __DIR__ . '/includes/header.php';
<?php if (!empty($project['description'])): ?>
<p class="student-card__desc"><?= e($project['description']) ?></p>
<?php endif; ?>
<p class="student-card__meta"><?= e($student) ?> · <?= e($batch) ?> · Editable placeholders – not an actual student achievement</p>
<p class="student-card__meta"><?= e($metaLine) ?></p>
<?php if ($skillsLine !== ''): ?>
<p class="student-card__skills"><?= e($skillsLine) ?></p>
<?php endif; ?>