diff --git a/controller/Controller.class.php b/controller/Controller.class.php index 6dfdde148..6eeba6867 100644 --- a/controller/Controller.class.php +++ b/controller/Controller.class.php @@ -112,10 +112,13 @@ protected static function getRouterWithRoutes(): \Routing\RouteCollector $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 d79709b7d..37b404471 100644 --- a/controller/action/ContentActions.class.php +++ b/controller/action/ContentActions.class.php @@ -95,7 +95,7 @@ public static function executeFaq(string $slug = null): array 'tutorial' => 'LBRY Tutorials', 'publisher' => 'Publishers and Creators', 'troubleshooting' => 'Help and Troubleshooting', - 'powerusers' => 'LBRY for Power Users', + 'powerusers' => 'LBRY for Power Users', 'wallet' => 'Wallet and Transactions', 'bots' => 'LBRY Bots', 'mining' => 'Mining LBC', @@ -165,12 +165,20 @@ public static function executeBountyRedirect(string $slug = null): array return Controller::redirect('https://lbry.tech/contribute'); } - public static function executeRoadmap() + public static function executeRoadmap(string $year = '2020') { $cache = !Request::getParam('nocache'); + $years = range(2019, 2020); + + $year = $year ?: $years[count($years) - 1]; + 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 857537c8c..ee830ed2f 100644 --- a/lib/thirdparty/Github.class.php +++ b/lib/thirdparty/Github.class.php @@ -43,14 +43,14 @@ protected static function findReleaseAsset(array $release, string $os, string $p $bestAsset = null; foreach ($release['assets'] as $asset) { if (static::isAssetForOs($asset, $os)) { - if (!$bestAsset) { - $bestAsset = $asset; - } else if ($os === Os::OS_LINUX) { - $ext = pathinfo($asset['name'], PATHINFO_EXTENSION); - if ($ext === $preferredExt || (!$preferredExt && $ext === 'AppImage')) { - $bestAsset = $asset; + if (!$bestAsset) { + $bestAsset = $asset; + } elseif ($os === Os::OS_LINUX) { + $ext = pathinfo($asset['name'], PATHINFO_EXTENSION); + if ($ext === $preferredExt || (!$preferredExt && $ext === 'AppImage')) { + $bestAsset = $asset; + } } - } } } @@ -105,20 +105,21 @@ public static function get($endpoint, array $params = [], $cache = true) ); } - 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) { + $issues = array_reduce($apiResponse, function ($issues, $issue) use ($year) { return array_merge($issues, [[ 'name' => $issue['title'], 'quarter_date' => array_reduce($issue['labels'], function ($carry, $label) { if ($carry) { return $carry; } - return $label['name'][0] === 'Q' ? $label['name'] . ' 2019' : ''; + return $label['name'][0] === 'Q' ? ($label['name'] . ' ' . $year) : ''; }, ''), 'body' => $issue['body_html'] ]]); diff --git a/view/template/content/roadmap.php b/view/template/content/roadmap.php index 946c1c203..ae3d89b5f 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 351e2b468..c959b39b5 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 99168b50b..e05022375 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%;