Files
root 9e2f858343
Deploy to Shared Hosting / Shared hosting deploy (push) Failing after 48s
Tests / PHPUnit (push) Successful in 1m22s
fix job positions
2026-09-03 13:01:36 -04:00

119 lines
3.6 KiB
PHP

<?= $this->extend('layout/careers_layout') ?>
<?= $this->section('styles') ?>
<style>
body {
background-color: var(--sage);
}
.job-posting-copy,
.job-posting-copy p,
.job-posting-copy li {
font-family: "Heebo", sans-serif;
font-size: 1rem;
line-height: 1.7;
}
.job-posting-copy h2,
.job-posting-copy h3 {
font-family: "Inter", sans-serif;
font-weight: 600;
}
</style>
<?= $this->endSection() ?>
<?= $this->section('content') ?>
<?php
$renderPostingText = static function (?string $text): string {
$lines = preg_split('/\r\n|\r|\n/', trim((string) $text));
$html = '';
$paragraph = [];
$list = [];
$flushParagraph = static function () use (&$html, &$paragraph): void {
if ($paragraph === []) {
return;
}
$html .= '<p>' . esc(implode(' ', $paragraph)) . '</p>';
$paragraph = [];
};
$flushList = static function () use (&$html, &$list): void {
if ($list === []) {
return;
}
$html .= '<ul>';
foreach ($list as $item) {
$html .= '<li>' . esc($item) . '</li>';
}
$html .= '</ul>';
$list = [];
};
foreach ($lines as $line) {
$line = trim((string) $line);
if ($line === '') {
$flushParagraph();
$flushList();
continue;
}
if (str_ends_with($line, ':')) {
$flushParagraph();
$flushList();
$html .= '<h3 class="h4 mt-4">' . esc(rtrim($line, ':')) . '</h3>';
continue;
}
if (str_starts_with($line, '- ')) {
$flushParagraph();
$list[] = substr($line, 2);
continue;
}
$flushList();
$paragraph[] = $line;
}
$flushParagraph();
$flushList();
return $html;
};
?>
<div class="container py-5">
<a href="<?= site_url('careers') ?>" class="btn btn-outline-secondary btn-sm mb-4">Back to openings</a>
<div class="row g-4">
<div class="col-lg-8 job-posting-copy">
<h1><?= esc($position['title']) ?></h1>
<p class="text-muted">
<?= esc($position['department'] ?? '') ?>
<?php if (!empty($position['location'])): ?> &middot; <?= esc($position['location']) ?><?php endif; ?>
<?php if (!empty($position['employment_type'])): ?> &middot; <?= esc($position['employment_type']) ?><?php endif; ?>
<?php if (!empty($position['posted_at'])): ?><br><?= esc(date('M j, Y', strtotime((string) $position['posted_at']))) ?><?php endif; ?>
<br><?= esc(number_format((int) ($position['details_click_count'] ?? 0))) ?> views
</p>
<h2 class="h4 mt-4">Description</h2>
<div><?= $renderPostingText($position['description'] ?? '') ?></div>
<h2 class="h4 mt-4">Responsibilities</h2>
<div><?= $renderPostingText($position['responsibilities'] ?? '') ?></div>
<h2 class="h4 mt-4">Requirements</h2>
<div><?= $renderPostingText($position['requirements'] ?? '') ?></div>
</div>
<div class="col-lg-4">
<div class="card">
<div class="card-body">
<h2 class="h5">Apply for this position</h2>
<p class="text-muted">Submit your contact information and resume for review.</p>
<a href="<?= site_url('careers/' . $position['position_id'] . '/apply') ?>" class="btn btn-primary w-100">Apply Now</a>
</div>
</div>
</div>
</div>
</div>
<?= $this->endSection() ?>