Files
alrahma_sunday_school/app/Views/jobs/show.php
T
root dbfd72c2f9
Deploy to Shared Hosting / Shared hosting deploy (push) Failing after 48s
Tests / PHPUnit (push) Successful in 1m29s
add open position system
2026-09-02 00:53:55 -04:00

111 lines
3.2 KiB
PHP

<?= $this->extend('layout/main_layout') ?>
<?= $this->section('styles') ?>
<style>
.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; ?>
</p>
<h2 class="h4 mt-4">Description</h2>
<div><?= $renderPostingText($position['description'] ?? '') ?></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() ?>