reconstruct job admin side
Deploy to Shared Hosting / Shared hosting deploy (push) Failing after 49s
Tests / PHPUnit (push) Successful in 1m23s

This commit is contained in:
root
2026-09-03 01:58:54 -04:00
parent 228824182a
commit 6936a822c8
11 changed files with 166 additions and 3 deletions
@@ -398,6 +398,7 @@ class JobPostingController extends BaseController
'department' => trim((string) $this->request->getPost('department')),
'location' => trim((string) $this->request->getPost('location')),
'employment_type' => trim((string) $this->request->getPost('employment_type')),
'responsibilities' => trim((string) $this->request->getPost('responsibilities')),
'requirements' => trim((string) $this->request->getPost('requirements')),
];
}
@@ -427,6 +428,7 @@ class JobPostingController extends BaseController
'department' => (string) ($data['department'] ?? ''),
'location' => (string) ($data['location'] ?? ''),
'employment_type' => (string) ($data['employment_type'] ?? ''),
'responsibilities' => (string) ($data['responsibilities'] ?? ''),
'requirements' => (string) ($data['requirements'] ?? ''),
];
}
@@ -16,6 +16,7 @@ class CreateJobPostings extends Migration
'department' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
'location' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
'employment_type' => ['type' => 'VARCHAR', 'constraint' => 50, 'null' => true],
'responsibilities' => ['type' => 'TEXT', 'null' => true],
'requirements' => ['type' => 'TEXT', 'null' => true],
'version' => ['type' => 'INT', 'constraint' => 11, 'default' => 1],
'is_active' => ['type' => 'TINYINT', 'constraint' => 1, 'default' => 1],
@@ -38,6 +39,7 @@ class CreateJobPostings extends Migration
'department' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
'location' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
'employment_type' => ['type' => 'VARCHAR', 'constraint' => 50, 'null' => true],
'responsibilities' => ['type' => 'TEXT', 'null' => true],
'requirements' => ['type' => 'TEXT', 'null' => true],
'saved_by' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'null' => true],
'saved_at' => ['type' => 'DATETIME', 'null' => true],
@@ -56,6 +58,7 @@ class CreateJobPostings extends Migration
'department' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
'location' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
'employment_type' => ['type' => 'VARCHAR', 'constraint' => 50, 'null' => true],
'responsibilities' => ['type' => 'TEXT', 'null' => true],
'requirements' => ['type' => 'TEXT', 'null' => true],
'status' => ['type' => 'VARCHAR', 'constraint' => 20, 'default' => 'draft'],
'posted_by' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'null' => true],
@@ -12,7 +12,8 @@ class SeedVolunteerJobPostings extends Migration
'position_id' => 'cc23227b-82b1-4bcb-8976-fcd21f0a1e01',
'version_id' => '6a408f24-88db-4c0e-b7f2-26cc2da51e01',
'title' => 'Grade 6 Teacher Volunteer',
'description' => "Al Rahma Sunday School is looking for a dedicated Grade 6 Teacher Volunteer to teach and mentor students in a positive Islamic learning environment. The teacher will help students strengthen their understanding of Islamic studies, Quran, Arabic, manners, and character development.\n\nResponsibilities:\n- Teach Grade 6 Sunday school lessons based on the school curriculum\n- Prepare weekly lesson plans and classroom activities\n- Help students understand Islamic values and apply them in daily life\n- Manage classroom behavior in a respectful and positive way\n- Encourage student participation, discussion, and teamwork\n- Track attendance and student progress\n- Communicate with school administration and parents when needed\n- Support school events, exams, and activities when requested",
'description' => "Al Rahma Sunday School is looking for a dedicated Grade 6 Teacher Volunteer to teach and mentor students in a positive Islamic learning environment. The teacher will help students strengthen their understanding of Islamic studies, Quran, Arabic, manners, and character development.",
'responsibilities' => "- Teach Grade 6 Sunday school lessons based on the school curriculum\n- Prepare weekly lesson plans and classroom activities\n- Help students understand Islamic values and apply them in daily life\n- Manage classroom behavior in a respectful and positive way\n- Encourage student participation, discussion, and teamwork\n- Track attendance and student progress\n- Communicate with school administration and parents when needed\n- Support school events, exams, and activities when requested",
'requirements' => "- Strong commitment to Islamic education and community service\n- Comfortable teaching and guiding middle school students\n- Patient, responsible, organized, and dependable\n- Good communication skills\n- Prior teaching, tutoring, or youth mentoring experience preferred\n- Must be available during Sunday school hours",
],
[
@@ -20,7 +21,8 @@ class SeedVolunteerJobPostings extends Migration
'position_id' => 'cc23227b-82b1-4bcb-8976-fcd21f0a1e02',
'version_id' => '6a408f24-88db-4c0e-b7f2-26cc2da51e02',
'title' => 'Grade 8 Teacher Volunteer',
'description' => "Al Rahma Sunday School is seeking a Grade 8 Teacher Volunteer to support students as they continue developing their Islamic knowledge, personal responsibility, and connection to the Muslim community.\n\nThe Grade 8 teacher will lead classroom lessons, encourage meaningful discussion, and help students build confidence in their faith and character.\n\nResponsibilities:\n- Teach Grade 8 Sunday school curriculum\n- Prepare engaging lessons, discussions, and activities\n- Help students understand Islamic teachings in age-appropriate ways\n- Encourage respectful dialogue, critical thinking, and positive behavior\n- Support students with Quran, Islamic studies, Arabic, and character development\n- Maintain classroom order and a safe learning environment\n- Monitor attendance and student participation\n- Communicate with administration and parents as needed\n- Assist with school programs, projects, or events when requested",
'description' => "Al Rahma Sunday School is seeking a Grade 8 Teacher Volunteer to support students as they continue developing their Islamic knowledge, personal responsibility, and connection to the Muslim community.\n\nThe Grade 8 teacher will lead classroom lessons, encourage meaningful discussion, and help students build confidence in their faith and character.",
'responsibilities' => "- Teach Grade 8 Sunday school curriculum\n- Prepare engaging lessons, discussions, and activities\n- Help students understand Islamic teachings in age-appropriate ways\n- Encourage respectful dialogue, critical thinking, and positive behavior\n- Support students with Quran, Islamic studies, Arabic, and character development\n- Maintain classroom order and a safe learning environment\n- Monitor attendance and student participation\n- Communicate with administration and parents as needed\n- Assist with school programs, projects, or events when requested",
'requirements' => "- Commitment to Islamic values and youth education\n- Ability to connect with middle school students\n- Responsible, patient, respectful, and organized\n- Strong communication and classroom management skills\n- Teaching, tutoring, halaqa, or mentoring experience preferred\n- Must be dependable and available on Sundays",
],
[
@@ -28,7 +30,8 @@ class SeedVolunteerJobPostings extends Migration
'position_id' => 'cc23227b-82b1-4bcb-8976-fcd21f0a1e03',
'version_id' => '6a408f24-88db-4c0e-b7f2-26cc2da51e03',
'title' => 'Youth Teacher / Mentor Volunteer',
'description' => "Al Rahma Sunday School is looking for a Youth Teacher / Mentor Volunteer to work with students ages 16-17. This role focuses on teaching, mentoring, and guiding older teens as they strengthen their Islamic identity, personal responsibility, leadership skills, and connection to the Muslim community.\n\nThe Youth Teacher will lead age-appropriate lessons and discussions that connect Islamic values to real-life topics students face at this stage of life.\n\nResponsibilities:\n- Teach and mentor students ages 16-17\n- Lead discussions on Islamic identity, character, Quran, Seerah, manners, leadership, and real-life challenges\n- Create a respectful classroom environment where students feel comfortable asking questions\n- Encourage critical thinking, responsibility, positive decision-making, and community involvement\n- Prepare weekly lessons, activities, or discussion topics\n- Support students in developing confidence in their faith and values\n- Maintain appropriate teacher-student boundaries and a safe learning environment\n- Track attendance and student participation\n- Communicate with Sunday school administration and parents when needed\n- Support youth projects, events, service activities, or school programs when requested",
'description' => "Al Rahma Sunday School is looking for a Youth Teacher / Mentor Volunteer to work with students ages 16-17. This role focuses on teaching, mentoring, and guiding older teens as they strengthen their Islamic identity, personal responsibility, leadership skills, and connection to the Muslim community.\n\nThe Youth Teacher will lead age-appropriate lessons and discussions that connect Islamic values to real-life topics students face at this stage of life.",
'responsibilities' => "- Teach and mentor students ages 16-17\n- Lead discussions on Islamic identity, character, Quran, Seerah, manners, leadership, and real-life challenges\n- Create a respectful classroom environment where students feel comfortable asking questions\n- Encourage critical thinking, responsibility, positive decision-making, and community involvement\n- Prepare weekly lessons, activities, or discussion topics\n- Support students in developing confidence in their faith and values\n- Maintain appropriate teacher-student boundaries and a safe learning environment\n- Track attendance and student participation\n- Communicate with Sunday school administration and parents when needed\n- Support youth projects, events, service activities, or school programs when requested",
'requirements' => "- Strong commitment to Islamic education and youth development\n- Ability to relate respectfully and effectively with older teens\n- Comfortable leading meaningful discussions with students ages 16-17\n- Patient, dependable, trustworthy, and organized\n- Good communication, leadership, and classroom management skills\n- Prior experience in teaching, mentoring, halaqas, youth programs, or community service preferred\n- Must be available during Sunday school hours",
],
];
@@ -48,6 +51,7 @@ class SeedVolunteerJobPostings extends Migration
'department' => 'Sunday School',
'location' => 'Al Rahma Sunday School',
'employment_type' => 'Volunteer',
'responsibilities' => $posting['responsibilities'],
'requirements' => $posting['requirements'],
];
@@ -0,0 +1,83 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class AddResponsibilitiesToJobPostings extends Migration
{
private array $tables = [
'job_templates',
'job_template_versions',
'job_positions',
];
public function up()
{
foreach ($this->tables as $table) {
if (!$this->db->tableExists($table) || $this->db->fieldExists('responsibilities', $table)) {
continue;
}
$this->forge->addColumn($table, [
'responsibilities' => [
'type' => 'TEXT',
'null' => true,
'after' => 'employment_type',
],
]);
}
$this->backfillResponsibilities();
}
public function down()
{
foreach ($this->tables as $table) {
if ($this->db->tableExists($table) && $this->db->fieldExists('responsibilities', $table)) {
$this->forge->dropColumn($table, 'responsibilities');
}
}
}
private function backfillResponsibilities(): void
{
$primaryKeys = [
'job_templates' => 'template_id',
'job_template_versions' => 'version_id',
'job_positions' => 'position_id',
];
foreach ($primaryKeys as $table => $primaryKey) {
if (!$this->db->tableExists($table) || !$this->db->fieldExists('responsibilities', $table)) {
continue;
}
$rows = $this->db->table($table)
->select($primaryKey . ', description, responsibilities')
->groupStart()
->where('responsibilities', null)
->orWhere('responsibilities', '')
->groupEnd()
->like('description', 'Responsibilities:')
->get()
->getResultArray();
foreach ($rows as $row) {
$description = (string) ($row['description'] ?? '');
$parts = preg_split('/\R\RResponsibilities:\R/', $description, 2);
if (!is_array($parts) || count($parts) !== 2) {
continue;
}
$this->db->table($table)
->where($primaryKey, $row[$primaryKey])
->update([
'description' => trim($parts[0]),
'responsibilities' => trim($parts[1]),
]);
}
}
}
}
@@ -0,0 +1,53 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class BackfillJobPostingResponsibilities extends Migration
{
private array $primaryKeys = [
'job_templates' => 'template_id',
'job_template_versions' => 'version_id',
'job_positions' => 'position_id',
];
public function up()
{
foreach ($this->primaryKeys as $table => $primaryKey) {
if (!$this->db->tableExists($table) || !$this->db->fieldExists('responsibilities', $table)) {
continue;
}
$rows = $this->db->table($table)
->select($primaryKey . ', description, responsibilities')
->groupStart()
->where('responsibilities', null)
->orWhere('responsibilities', '')
->groupEnd()
->like('description', 'Responsibilities:')
->get()
->getResultArray();
foreach ($rows as $row) {
$parts = preg_split('/\R\RResponsibilities:\R/', (string) ($row['description'] ?? ''), 2);
if (!is_array($parts) || count($parts) !== 2) {
continue;
}
$this->db->table($table)
->where($primaryKey, $row[$primaryKey])
->update([
'description' => trim($parts[0]),
'responsibilities' => trim($parts[1]),
]);
}
}
}
public function down()
{
// Data-only migration; do not merge responsibilities back into descriptions on rollback.
}
}
+1
View File
@@ -18,6 +18,7 @@ class JobPositionModel extends Model
'department',
'location',
'employment_type',
'responsibilities',
'requirements',
'status',
'posted_by',
+1
View File
@@ -17,6 +17,7 @@ class JobTemplateModel extends Model
'department',
'location',
'employment_type',
'responsibilities',
'requirements',
'version',
'is_active',
+1
View File
@@ -19,6 +19,7 @@ class JobTemplateVersionModel extends Model
'department',
'location',
'employment_type',
'responsibilities',
'requirements',
'saved_by',
'saved_at',
+4
View File
@@ -20,6 +20,10 @@
<label class="form-label" for="description">Description</label>
<textarea id="description" name="description" class="form-control" rows="6"><?= esc(old('description', $item['description'] ?? '')) ?></textarea>
</div>
<div class="col-12">
<label class="form-label" for="responsibilities">Responsibilities</label>
<textarea id="responsibilities" name="responsibilities" class="form-control" rows="6"><?= esc(old('responsibilities', $item['responsibilities'] ?? '')) ?></textarea>
</div>
<div class="col-12">
<label class="form-label" for="requirements">Requirements</label>
<textarea id="requirements" name="requirements" class="form-control" rows="6"><?= esc(old('requirements', $item['requirements'] ?? '')) ?></textarea>
+2
View File
@@ -92,6 +92,8 @@ $renderPostingText = static function (?string $text): string {
</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>
+9
View File
@@ -245,6 +245,13 @@
background-color: var(--mgmt-thead-bg) !important;
box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}
.content table.no-mgmt-sticky > thead > tr > th,
.content table[data-no-mgmt-sticky] > thead > tr > th {
position: static !important;
top: auto !important;
z-index: auto !important;
box-shadow: none !important;
}
/* Explicitly reset any sticky styles on FullCalendar tables */
.content .fc table thead th { position: static !important; top: auto !important; z-index: auto !important; box-shadow: none !important; }
/* Month-grid uses container-local stickiness */
@@ -483,6 +490,8 @@
// Make header sticky by default (opt-out available)
if (!(t.classList.contains('no-mgmt-sticky') || t.hasAttribute('data-no-mgmt-sticky'))) {
t.classList.add('mgmt-sticky');
} else {
t.classList.remove('mgmt-sticky');
}
// Avoid double headers when DataTables FixedHeader is active; attach FH if DT is present