2020 roadmap support

This commit is contained in:
Jeremy Kauffman 2020-02-04 18:33:01 -05:00
parent d80664e0f9
commit 9e648d59ef
6 changed files with 60 additions and 32 deletions

View file

@ -112,10 +112,13 @@ class Controller
$router->get(['/get', 'get'], 'DownloadActions::executeGet');
$router->get(['/getrubin', 'getrubin'], 'DownloadActions::executeGet');
foreach (array_keys(OS::getAll()) as $os) {
$router->get(['/' . $os, 'get-' . $os], 'DownloadActions::executeGet');
}
$router->get('/roadmap', 'ContentActions::executeRoadmap');
$router->get('/roadmap/{year}', 'ContentActions::executeRoadmap');
$router->post('/postcommit', 'OpsActions::executePostCommit');
$router->post('/log-upload', 'OpsActions::executeLogUpload');

View file

@ -165,12 +165,19 @@ class ContentActions extends Actions
return Controller::redirect('https://lbry.tech/contribute');
}
public static function executeRoadmap()
public static function executeRoadmap(string $year = '2000')
{
$cache = !Request::getParam('nocache');
$years = range(2019, 2020);
if (!in_array($year, $years)) {
Controller::redirect('/roadmap');
}
return ['content/roadmap', [
'items' => Github::listRoadmapItems($cache)
'year' => $year,
'years' => $years,
'items' => Github::listRoadmapItems($year, $cache)
]];
}

View file

@ -105,10 +105,11 @@ class Github
);
}
public static function listRoadmapItems($cache = true)
public static function listRoadmapItems($year, $cache = true)
{
$year = $year ?: date('Y');
$apiResponse = Config::get(Config::GITHUB_PERSONAL_AUTH_TOKEN) ?
static::get('/repos/lbryio/internal-issues/issues?labels=2019&filter=all') :
static::get('/repos/lbryio/internal-issues/issues?labels=' . $year . '&filter=all') :
include ROOT_DIR . '/data/dummy/githubroadmap.php';
$issues = array_reduce($apiResponse, function ($issues, $issue) {

View file

@ -10,8 +10,20 @@
<section>
<div class="inner-wrap">
<p>Our top priorities, definitions of success, and target completion dates for key initiatives in <?php echo date('Y') ?> are outlined below.</p>
<p class="align-text--center">Top priorities, definitions of success, status, and target completion dates for key initiatives in
<select id="roadmap-year-select">
<?php foreach ($years as $aYear): ?>
<option value="<?php echo $aYear ?>" <?php echo $aYear == $year ? 'selected="selected"' : '' ?>>
<?php echo $aYear ?>
</option>
<?php endforeach ?>
</select>
<?php js_start() ?>
$('#roadmap-year-select').change(function() { window.location = '/roadmap/' + $(this).val(); });
<?php js_end() ?>
</p>
<div class="roadmap-container" id="project-roadmap">
<?php if (count($items)): ?>
<?php foreach ($items as $item): ?>
<div class="roadmap-item">
<h3 class="roadmap-item-title">
@ -35,6 +47,9 @@
</div>
</div>
<?php endforeach ?>
<?php else: ?>
<div class="notice notice-info">No roadmap items found for this year.</div>
<?php endif ?>
</div>
</div>
</section>

@ -1 +1 @@
Subproject commit 351e2b468fbecfb3e81e6c6fc8ce6c8d25d30772
Subproject commit c959b39b594c410829eb897af97cd6dea9b52d9c

View file

@ -1,11 +1,11 @@
.roadmap-container {
margin: 1.25rem auto 0;
max-width: 800px;
max-width: 840px;
position: relative;
&::after {
width: 1px; height: 100%;
top: 0; left: 2.5rem; // half of date width
top: 0; left: 3rem; // half of date width
background-color: var(--lbry-gray-1);
content: "";
@ -17,14 +17,16 @@
.roadmap-item {
border: 1px solid var(--lbry-gray-1);
margin-bottom: 2rem;
margin-left: 6rem;
margin-left: 8rem;
padding: 1.5rem;
position: relative;
}
.roadmap-item-date {
width: 5rem; height: 5rem;
top: -1px; left: -6rem;
width: 6rem;
height: 6rem;
top: -1px;
left: -8rem;
background-color: var(--lbry-white);
border-radius: 50%;