From 9e648d59efc0602cd67d9f34c6ddf1e992a4284a Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Tue, 4 Feb 2020 18:33:01 -0500 Subject: [PATCH] 2020 roadmap support --- controller/Controller.class.php | 5 +- controller/action/ContentActions.class.php | 11 ++++- lib/thirdparty/Github.class.php | 5 +- view/template/content/roadmap.php | 57 ++++++++++++++-------- web/scss/color | 2 +- web/scss/pages/_roadmap.scss | 12 +++-- 6 files changed, 60 insertions(+), 32 deletions(-) diff --git a/controller/Controller.class.php b/controller/Controller.class.php index 6dfdde14..6eeba686 100644 --- a/controller/Controller.class.php +++ b/controller/Controller.class.php @@ -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(['/' . $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'); diff --git a/controller/action/ContentActions.class.php b/controller/action/ContentActions.class.php index d79709b7..d415cc3a 100644 --- a/controller/action/ContentActions.class.php +++ b/controller/action/ContentActions.class.php @@ -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) ]]; } diff --git a/lib/thirdparty/Github.class.php b/lib/thirdparty/Github.class.php index 857537c8..8b6ef160 100644 --- a/lib/thirdparty/Github.class.php +++ b/lib/thirdparty/Github.class.php @@ -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) { diff --git a/view/template/content/roadmap.php b/view/template/content/roadmap.php index 946c1c20..ae3d89b5 100644 --- a/view/template/content/roadmap.php +++ b/view/template/content/roadmap.php @@ -10,31 +10,46 @@
-

Our top priorities, definitions of success, and target completion dates for key initiatives in are outlined below.

+

Top priorities, definitions of success, status, and target completion dates for key initiatives in + + + $('#roadmap-year-select').change(function() { window.location = '/roadmap/' + $(this).val(); }); + +

- -
-

- - - - - -

- -
- - + + +
+

+ + - - -

+ + + -
- No description' ?> +
+ + + + + +
+ +
+ No description' ?> +
-
- + + +
No roadmap items found for this year.
+
diff --git a/web/scss/color b/web/scss/color index 351e2b46..c959b39b 160000 --- a/web/scss/color +++ b/web/scss/color @@ -1 +1 @@ -Subproject commit 351e2b468fbecfb3e81e6c6fc8ce6c8d25d30772 +Subproject commit c959b39b594c410829eb897af97cd6dea9b52d9c diff --git a/web/scss/pages/_roadmap.scss b/web/scss/pages/_roadmap.scss index 99168b50..e0502237 100644 --- a/web/scss/pages/_roadmap.scss +++ b/web/scss/pages/_roadmap.scss @@ -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%;