diff --git a/controller/action/ContentActions.class.php b/controller/action/ContentActions.class.php index d202c8da..66be2eab 100644 --- a/controller/action/ContentActions.class.php +++ b/controller/action/ContentActions.class.php @@ -398,15 +398,18 @@ class ContentActions extends Actions $jobs = array(); - foreach(glob(static::VIEW_FOLDER_JOBS . '/*') as $job){ - + $jobs = array_filter(glob(static::VIEW_FOLDER_JOBS . '/*'), function($job){ list($metadata, $jobHTML) = View::parseMarkdown($job); + + return $metadata['status'] != 'closed'; + }); + + usort($jobs, function($job1, $job2){ + list($metadataA, $jobHTMLA) = View::parseMarkdown($job1); + list($metadataB, $jobHTMLB) = View::parseMarkdown($job2); + return $metadataA['order'] <=> $metadataB['order']; + }); - if($metadata['status'] != 'closed') - { - array_push($jobs, $job); - } - } return ['content/join-us', ['jobs' => $jobs]]; } diff --git a/view/template/content/_job.php b/view/template/content/_job.php index fd744b79..a711697e 100644 --- a/view/template/content/_job.php +++ b/view/template/content/_job.php @@ -1,5 +1,5 @@

-">

+ ">
diff --git a/view/template/content/join-us.php b/view/template/content/join-us.php index 8b5c9442..c040d428 100644 --- a/view/template/content/join-us.php +++ b/view/template/content/join-us.php @@ -74,7 +74,7 @@
$job]) ?> - +

Applying

How To Apply