Change roadmap item display

This commit is contained in:
Maxime St-Pierre 2018-05-02 23:43:56 -04:00
parent 4ccefe9074
commit ddc43e7f81
2 changed files with 14 additions and 14 deletions

View file

@ -14,6 +14,8 @@ class Asana
161514803479899 => ['Blockchain and Wallets', 'https://github.com/lbryio/lbrycrd'], 161514803479899 => ['Blockchain and Wallets', 'https://github.com/lbryio/lbrycrd'],
136290697597644 => ['Integration and Building', null], 136290697597644 => ['Integration and Building', null],
158602294500249 => ['Documentation', null], 158602294500249 => ['Documentation', null],
658477315612493 => ['Complete', null],
658477315612495 => ['In progress', null]
]; ];
$tasks = []; $tasks = [];
@ -21,7 +23,8 @@ class Asana
$tags = [ $tags = [
192699565737944 => 'Open Beta', 192699565737944 => 'Open Beta',
542803886522122 => 'Upcoming', 542803886522122 => 'Upcoming',
542803886522120 => 'Future' 658477315612491 => ' 2018 ',
659021359433311 => ' 2025 '
]; ];
foreach ($tags as $tagId => $tagLabel) foreach ($tags as $tagId => $tagLabel)
@ -39,7 +42,7 @@ class Asana
} }
else else
{ {
$projectName = 'Other'; $projectName = 'Planned';
$projectId = null; $projectId = null;
} }
$tasks[$tagLabel][] = array_intersect_key($fullTask, ['name' => null]) + [ $tasks[$tagLabel][] = array_intersect_key($fullTask, ['name' => null]) + [
@ -59,18 +62,10 @@ class Asana
{ {
usort($groupTasks, function ($tA, $tB) usort($groupTasks, function ($tA, $tB)
{ {
if ($tA['group'] != $tB['group'])
{
return $tA['group'] <= $tB['group'] ? -1 : 1;
}
if ($tA['date'] xor $tB['date']) if ($tA['date'] xor $tB['date'])
{ {
return $tA['date'] ? -1 : 1; return $tA['date'] ? -1 : 1;
} }
if ($tA['project_id'] xor $tB['project_id'])
{
return $tA['project_id'] ? -1 : 1;
}
return $tA['date'] < $tB['date'] ? -1 : 1; return $tA['date'] < $tB['date'] ? -1 : 1;
}); });
} }

View file

@ -49,9 +49,14 @@
<span class="roadmap-item-assignee"><?php echo $item['assignee'] ?></span> <span class="roadmap-item-assignee"><?php echo $item['assignee'] ?></span>
<?php endif ?> <?php endif ?>
<?php if (isset($item['badge'])): ?> <?php if (isset($item['badge'])): ?>
<span class="badge"><?php echo $item['badge'] ?></span><br/> <?php switch($item['badge']): case "Complete": ?>
<?php endif ?> <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> </div>
<?php endif ?> <?php endif ?>
<h3 class="roadmap-item-title"> <h3 class="roadmap-item-title">
@ -72,7 +77,7 @@
<?php echo $item['body'] ?: '<em class="no-results">No description</em>' ?> <?php echo $item['body'] ?: '<em class="no-results">No description</em>' ?>
</div> </div>
</div> </div>
<?php endforeach ?> <?php endforeach ?>
</div> </div>
<?php endforeach ?> <?php endforeach ?>
<div class="text-center"><a href="javascript:;" class="link-primary show-all-roadmap-groups">Show Earlier Releases</a></div> <div class="text-center"><a href="javascript:;" class="link-primary show-all-roadmap-groups">Show Earlier Releases</a></div>