mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-23 17:47:26 +00:00
strip roadmap
This commit is contained in:
parent
a89eb37aee
commit
60c77616d1
4 changed files with 21 additions and 168 deletions
|
@ -235,26 +235,8 @@ class ContentActions extends Actions
|
|||
{
|
||||
$cache = !Request::getParam('nocache');
|
||||
|
||||
/*
|
||||
* below will include past changes on the roadmap, considering dropping entirely
|
||||
*/
|
||||
|
||||
// $githubItems = Github::listRoadmapChangesets($cache);
|
||||
// $projectMaxVersions = [];
|
||||
// foreach ($githubItems as $group => $items) {
|
||||
// if ($items) {
|
||||
// $firstItem = reset($items);
|
||||
// $project = $firstItem['project'];
|
||||
// if (!isset($projectMaxVersions[$project]) || $firstItem['sort_key'] > $projectMaxVersions[$project]) {
|
||||
// $projectMaxVersions[$project] = $firstItem['sort_key'];
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
$items = ['2019' => Github::listRoadmapItems($cache)]; // + $githubItems;
|
||||
return ['content/roadmap', [
|
||||
'projectMaxVersions' => [],
|
||||
'items' => $items
|
||||
'items' => Github::listRoadmapItems($cache)
|
||||
]];
|
||||
}
|
||||
|
||||
|
|
73
lib/thirdparty/Github.class.php
vendored
73
lib/thirdparty/Github.class.php
vendored
|
@ -80,11 +80,6 @@ class Github
|
|||
{
|
||||
$twoHoursInSeconds = 7200;
|
||||
$headers = ['Accept: application/vnd.github.v3.html+json'];
|
||||
// if (Config::get(Config::GITHUB_APP_CLIENT_ID) && Config::get(Config::GITHUB_APP_CLIENT_SECRET))
|
||||
// {
|
||||
// $params['client_id'] = Config::get(Config::GITHUB_APP_CLIENT_ID);
|
||||
// $params['client_secret'] = Config::Get(Config::GITHUB_APP_CLIENT_SECRET);
|
||||
// }
|
||||
if (Config::get(Config::GITHUB_PERSONAL_AUTH_TOKEN)) {
|
||||
$headers[] = 'Authorization: token ' . Config::get(Config::GITHUB_PERSONAL_AUTH_TOKEN);
|
||||
}
|
||||
|
@ -98,7 +93,7 @@ class Github
|
|||
|
||||
public static function listRoadmapItems($cache = true)
|
||||
{
|
||||
$apiResponse = IS_PRODUCTION ?
|
||||
$apiResponse = Config::get(Config::GITHUB_PERSONAL_AUTH_TOKEN) ?
|
||||
static::get('/repos/lbryio/internal-issues/issues?labels=2019&filter=all') :
|
||||
include ROOT_DIR . '/data/dummy/githubroadmap.php';
|
||||
|
||||
|
@ -122,70 +117,4 @@ class Github
|
|||
});
|
||||
return $issues;
|
||||
}
|
||||
|
||||
public static function listRoadmapChangesets($cache = true)
|
||||
{
|
||||
$sets = [];
|
||||
$allReleases = [];
|
||||
|
||||
$projects = ['lbry' => 'LBRY Protocol', 'lbry-desktop' => 'LBRY App'];
|
||||
|
||||
foreach ($projects as $project => $projectLabel) {
|
||||
$page = 1;
|
||||
do {
|
||||
$releases = static::get('/repos/lbryio/' . $project . '/releases', ['page' => $page], $cache);
|
||||
$page++;
|
||||
$allReleases = array_merge($allReleases, array_map(function ($release) use ($project, $projectLabel) {
|
||||
return $release + ['project' => $projectLabel];
|
||||
}, array_filter($releases, function ($release) {
|
||||
return isset($release['tag_name']) && isset($release['published_at']) && $release['published_at'];
|
||||
})));
|
||||
} while (count($releases) >= 30);
|
||||
}
|
||||
|
||||
/**
|
||||
* This logic is likely overly convoluted at this point. It used to group releases by project before going
|
||||
* to strictly by time. - Jeremy
|
||||
*/
|
||||
|
||||
foreach ($allReleases as $release) {
|
||||
$group = null;
|
||||
$matches = null;
|
||||
if (preg_match('/^v(\d+)\.(\d+)\./', $release['tag_name'] ?? '', $matches)) {
|
||||
$group = $release['project'] . ' v' . $matches[1] . '.' . $matches[2];
|
||||
}
|
||||
if ($group) {
|
||||
$sets[$group][] = array_intersect_key($release, [
|
||||
'prerelease' => null, 'tag_name' => null, 'published_at' => null, 'project' => null
|
||||
]) + [
|
||||
'created_at' => strtotime($release['created_at']),
|
||||
'date' => date('Y-m-d', strtotime($release['created_at'])),
|
||||
//I thought published_at, but GitHub displays created_at and published_at is out of sync sometimes (0.3.2, 0.3.3)
|
||||
'name' => $release['name'] ?: $release['tag_name'],
|
||||
'url' => $release['html_url'],
|
||||
'major_version' => (int)$matches[1],
|
||||
'minor_version' => (int)$matches[2],
|
||||
'patch_version' => (int)isset($matches[3]) ? $matches[3] : 0,
|
||||
'sort_key' => (int)$matches[1] * 1000000 + (int)$matches[2] * 1000 + (int)($matches[3] ?? 0),
|
||||
'version' => $matches[1] . '.' . $matches[2] . '.' . (isset($matches[3]) ? $matches[3] : ''),
|
||||
'body' => $release['body_html']
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
uasort($sets, function ($sA, $sB) {
|
||||
if ($sA[0]['project'] != $sB[0]['project']) {
|
||||
return $sA[0]['project'] < $sB[0]['project'] ? -1 : 1;
|
||||
}
|
||||
return $sB[0]['sort_key'] <=> $sA[0]['sort_key'];
|
||||
});
|
||||
|
||||
foreach ($sets as $group => &$groupSet) {
|
||||
usort($groupSet, function ($rA, $rB) {
|
||||
return $rB['created_at'] <=> $rA['created_at'];
|
||||
});
|
||||
}
|
||||
|
||||
return $sets;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
<?php Response::setMetaDescription(__('roadmap.description')) ?>
|
||||
<?php Response::addJsAsset('/js/roadmap.js') ?>
|
||||
<?php NavActions::setNavUri('/learn') ?>
|
||||
<?php echo View::render('nav/_header', ['isDark' => false]) ?>
|
||||
<?php js_start() ?>
|
||||
lbry.roadmap('#project-roadmap');
|
||||
<?php js_end() ?>
|
||||
<main>
|
||||
<div class="hero hero-quote hero-img hero-img-short spacer1" title="Here Be Dragons" style="background-image: url(/img/here-be-dragons.jpg)">
|
||||
<div class="hero-content-wrapper">
|
||||
|
@ -17,37 +13,8 @@
|
|||
<div style="max-width: 800px; margin: 0 auto">
|
||||
<p>Our top priorities, definitions of success, and target completion dates for key initiatives in <?php echo date('Y') ?> are outlined below.</p>
|
||||
<div class="roadmap-container" id="project-roadmap">
|
||||
<?php foreach ($items as $group => $groupItems): ?>
|
||||
<?php $firstItem = reset($groupItems) ?>
|
||||
<?php $isOpen = !isset($firstItem['project']) || !isset($firstItem['sort_key']) || $firstItem['sort_key'] === $projectMaxVersions[$firstItem['project']] ?>
|
||||
<?php /*
|
||||
<h2 class="roadmap-group-title" <?php echo !$isOpen ? 'style="display: none"' : '' ?>">
|
||||
<span class="roadmap-group-title-label">
|
||||
<?php echo $group ?> <?php echo isset($firstItem['sort_key']) && $firstItem['sort_key'] === $projectMaxVersions[$firstItem['project']] ? '(latest)' : '' ?>
|
||||
</span>
|
||||
</h2> */ ?>
|
||||
<div class="roadmap-group <?php echo !$isOpen ? 'roadmap-group-closed' : '' ?>">
|
||||
<?php $maxItems = isset($firstItem['sort_key']) ? 1 : count($groupItems) ?>
|
||||
<?php $index = 0 ?>
|
||||
<?php if (count($groupItems) > $maxItems): ?>
|
||||
<div class="text-center spacer1"><a href="javascript:;" class="link-primary show-all-roadmap-group-items">Show All Items for <?php echo $group ?></a></div>
|
||||
<?php endif ?>
|
||||
<?php foreach ($groupItems as $item): ?>
|
||||
<?php ++$index ?>
|
||||
<div class="roadmap-item" <?php echo $index != 1 && isset($firstItem['sort_key']) ? 'style="display: none"' : '' ?>>
|
||||
<?php if (isset($item['badge'])): ?>
|
||||
<div>
|
||||
<?php if (isset($item['badge'])): ?>
|
||||
<?php switch ($item['badge']): case "Complete": ?>
|
||||
<span class=" badge badge-primary"><?php echo $item['badge'] ?></span><br/>
|
||||
<?php break; case "In Progress":?>
|
||||
<span class="badge badge-info"><?php echo $item['badge']?></span><br/>
|
||||
<?php break; case "Planned": ?>
|
||||
<span class="badge"><?php echo $item['badge']?></span><br/>
|
||||
<?php break; endswitch;?>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<?php foreach ($items as $item): ?>
|
||||
<div class="roadmap-item">
|
||||
<h3 class="roadmap-item-title">
|
||||
<?php if (isset($item['url']) && $item['url']): ?>
|
||||
<a href="<?php echo $item['url'] ?>" class="link-primary"><?php echo $item['name'] ?></a>
|
||||
|
@ -68,11 +35,6 @@
|
|||
</div>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
<?php /*
|
||||
<div class="text-center"><a href="javascript:;" class="link-primary show-all-roadmap-groups">Show Earlier Releases</a></div>
|
||||
*/ ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo View::render('nav/_learnFooter') ?>
|
||||
</main>
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
lbry.roadmap = function(selector)
|
||||
{
|
||||
var roadmap = $(selector);
|
||||
roadmap.on('click', '.show-all-roadmap-groups', function() {
|
||||
roadmap.find('.roadmap-group-title').show();
|
||||
$(this).remove();
|
||||
});
|
||||
roadmap.on('click', '.show-all-roadmap-group-items', function() {
|
||||
$(this).closest('.roadmap-group').find('.roadmap-item').show();
|
||||
$(this).remove();
|
||||
});
|
||||
roadmap.on('click', '.roadmap-group-title', function() {
|
||||
var target = $(this).next('.roadmap-group');
|
||||
target.toggleClass('roadmap-group-closed').toggleClass('roadmap-group-open');
|
||||
if (target.hasClass('roadmap-group-open'))
|
||||
{
|
||||
target.find('.show-all-roadmap-group-items').click();
|
||||
}
|
||||
});
|
||||
}
|
Loading…
Add table
Reference in a new issue