Add job partial and controller

This commit is contained in:
Maxime St-Pierre 2018-04-25 21:07:09 -04:00 committed by Jeremy Kauffman
parent 7ee1d30f51
commit 31e61ec888
4 changed files with 42 additions and 25 deletions

View file

@ -109,6 +109,7 @@ class Controller
$router->get(['/press-kit.zip', 'press-kit'], 'ContentActions::executePressKit');
$router->get('/join-us', 'ContentActions::executeJobs');
$router->post('/postcommit', 'OpsActions::executePostCommit');
$router->post('/log-upload', 'OpsActions::executeLogUpload');
$router->get(static::CACHE_CLEAR_PATH, 'OpsActions::executeClearCache');

View file

@ -9,12 +9,14 @@ class ContentActions extends Actions
SLUG_PRESS = 'press',
SLUG_BOUNTY = 'bounty',
SLUG_CREDIT_REPORTS = 'credit-reports',
SLUG_JOBS = 'jobs',
URL_NEWS = '/' . self::SLUG_NEWS,
URL_FAQ = '/' . self::SLUG_FAQ,
URL_PRESS = '/' . self::SLUG_PRESS,
URL_BOUNTY = '/' . self::SLUG_BOUNTY,
URL_CREDIT_REPORTS = '/' . self::SLUG_CREDIT_REPORTS,
URL_JOBS = '/' . self::SLUG_JOBS,
CONTENT_DIR = ROOT_DIR . '/content',
@ -22,7 +24,8 @@ class ContentActions extends Actions
VIEW_FOLDER_FAQ = self::CONTENT_DIR . '/' . self::SLUG_FAQ,
VIEW_FOLDER_BOUNTY = self::CONTENT_DIR . '/' . self::SLUG_BOUNTY,
VIEW_FOLDER_PRESS = self::CONTENT_DIR . '/' . self::SLUG_PRESS,
VIEW_FOLDER_CREDIT_REPORTS = self::CONTENT_DIR . '/' . self::SLUG_CREDIT_REPORTS;
VIEW_FOLDER_CREDIT_REPORTS = self::CONTENT_DIR . '/' . self::SLUG_CREDIT_REPORTS,
VIEW_FOLDER_JOBS = self::CONTENT_DIR . '/' . self::SLUG_JOBS;
public static function executeHome(): array
{
@ -388,4 +391,31 @@ class ContentActions extends Actions
]
]];
}
public static function executeJobs()
{
Response::enableHttpCache();
$jobs = array();
foreach(glob(static::VIEW_FOLDER_JOBS . '/*') as $job){
list($metadata, $jobHTML) = View::parseMarkdown($job);
if($metadata['status'] != 'closed')
{
array_push($jobs, $job);
}
}
return ['content/join-us', ['jobs' => $jobs]];
}
public static function prepareJobPartial(array $vars)
{
list($metadata, $jobHTML) = View::parseMarkdown($vars['job']);
return $vars + ['metadata' => $metadata, 'jobHTML' => $jobHTML];
}
}

View file

@ -0,0 +1,7 @@
<h3>
<?php echo $metadata['title'] ?><span class="badge <?php echo $metadata['status'] == "active" ? "badge-primary" : "badge-info" ?>"><?php echo $metadata['status'] ?></span></h3>
<div class="markdown" <?php echo $jobHTML ?>
</div>
<?php if(isset($metadata['url'])): ?>
<a class="btn btn-alt" href="<?php echo $metadata['url']?>">Apply Here</a>
<?php endif ?>

View file

@ -72,30 +72,9 @@
<h2 id="positions">Positions</h2>
<em>If a position is marked paused, you are still welcome to contact us. For blockchain, protocol, and application engineers, we will be hiring regularly throughout 2018.</em>
<div>
<?php /**
* Jobs partial goes here! Previous job markup left below, can be deleted after ticket is finished.
*/ ?>
<?php /*
<h3 id="blockchain-engineer">Blockchain Engineer <span class="badge badge-primary">Active</span></h3>
<p>
This position involves working directly on the LBRY <a href="https://github.com/lbryio/lbrycrd">blockchain</a>, written in C++.
</p>
<p>
Competence with cryptography, security, and networks is mandatory. Experience with blockchain is beneficial but not required.
</p>
<p>
Blockchain work is like being a goalkeeper: good work goes under-appreciated, but mistakes are catastrophic. You must be the kind of masochist that enjoys this.
</p>
<h3 id="protocol-engineer">Protocol Engineers <span class="badge badge-info">Paused</span></h3>
<p>
The LBRY protocol consists of a <a href="https://lbry.io/api">set of APIs</a> provided via a daemon. This daemon is comprised of several sub-components, and interacts with the blockchain, wallet, and other remote daemons that constitute the LBRY data network.
</p>
<p>
The LBRY <a href="https://github.com/lbryio/lbry">daemon</a> and <a href="https://github.com/lbryio/lbryum">wallet</a> are both written in Python, but maybe you're the one to rewrite them in Go (we're kidding) (probably).
</p>
<p>Competence with security, operating systems, and networks is mandatory. Experience with peer-to-peer technology is beneficial but not required.</p>
*/ ?>
<?php foreach($jobs as $job): ?>
<?php echo View::render('content/_job', ['job' => $job]) ?>
<?php endforeach ?>
</div>
<h2 id="applying">Applying</h2>
<h4 id="how-to-apply">How To Apply</h4>