2011-01-16 13:51:39 -08:00
|
|
|
<?php
|
|
|
|
|
|
2011-01-22 17:48:55 -08:00
|
|
|
abstract class PhabricatorDirectoryController extends PhabricatorController {
|
2011-01-16 13:51:39 -08:00
|
|
|
|
|
|
|
|
public function buildStandardPageResponse($view, array $data) {
|
2011-01-26 13:21:12 -08:00
|
|
|
$page = $this->buildStandardPageView();
|
2011-01-16 13:51:39 -08:00
|
|
|
|
|
|
|
|
$page->setBaseURI('/');
|
|
|
|
|
$page->setTitle(idx($data, 'title'));
|
2011-05-17 10:59:26 -07:00
|
|
|
|
2011-01-16 13:51:39 -08:00
|
|
|
$page->setGlyph("\xE2\x9A\x92");
|
|
|
|
|
$page->appendChild($view);
|
|
|
|
|
|
|
|
|
|
$response = new AphrontWebpageResponse();
|
|
|
|
|
return $response->setContent($page->render());
|
|
|
|
|
}
|
|
|
|
|
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
public function buildNav() {
|
|
|
|
|
$user = $this->getRequest()->getUser();
|
|
|
|
|
|
|
|
|
|
$nav = new AphrontSideNavFilterView();
|
|
|
|
|
$nav->setBaseURI(new PhutilURI('/'));
|
|
|
|
|
|
2013-01-15 15:41:22 -08:00
|
|
|
$applications = PhabricatorApplication::getAllInstalledApplications();
|
|
|
|
|
|
|
|
|
|
foreach ($applications as $key => $application) {
|
|
|
|
|
if (!$application->shouldAppearInLaunchView()) {
|
|
|
|
|
unset($applications[$key]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$groups = PhabricatorApplication::getApplicationGroups();
|
|
|
|
|
|
|
|
|
|
$applications = msort($applications, 'getApplicationOrder');
|
|
|
|
|
$applications = mgroup($applications, 'getApplicationGroup');
|
|
|
|
|
$applications = array_select_keys($applications, array_keys($groups));
|
|
|
|
|
|
|
|
|
|
$view = array();
|
|
|
|
|
foreach ($applications as $group => $application_list) {
|
|
|
|
|
$status = array();
|
|
|
|
|
foreach ($application_list as $key => $application) {
|
|
|
|
|
$status[$key] = $application->loadStatus($user);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$views = array();
|
|
|
|
|
foreach ($application_list as $key => $application) {
|
|
|
|
|
$views[] = id(new PhabricatorApplicationLaunchView())
|
|
|
|
|
->setApplication($application)
|
|
|
|
|
->setApplicationStatus(idx($status, $key, array()))
|
|
|
|
|
->setUser($user);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
while (count($views) % 4) {
|
|
|
|
|
$views[] = id(new PhabricatorApplicationLaunchView());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$nav->addLabel($groups[$group]);
|
|
|
|
|
$nav->addCustomBlock(
|
|
|
|
|
phutil_render_tag(
|
|
|
|
|
'div',
|
|
|
|
|
array(
|
|
|
|
|
'class' => 'application-tile-group',
|
|
|
|
|
),
|
|
|
|
|
id(new AphrontNullView())->appendChild($views)->render()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$nav->addClass('phabricator-side-menu-home');
|
|
|
|
|
$nav->selectFilter(null);
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
|
|
|
|
|
return $nav;
|
|
|
|
|
}
|
|
|
|
|
|
2011-01-16 13:51:39 -08:00
|
|
|
}
|