Summary:
This is a full UI pass at a cleaner "Config" application. The main idea is to simplify the UI, center it, and have a different feel than other UI, a sort of "manage" UI theme for objects with loads of settings. Also adds a new minimalistic "WHITE_CONFIG" box type which may get re-used in Diffusion settings. This is a 90% pass, I'll have a few follow up diffs. Specifically:
- Build breadcrumbs as a flexible UI to go into headers.
- One click ObjectItemView option, for hover states.
- Sidenav doesn't always select (AphrontFilter issue)
- Mobile touchups, though it's pretty reasonable.
Test Plan:
Click through every page here, edit options, see new navigation UI. Test a few various setup issue layouts including fatals.
{F5163228}
{F5163229}
{F5163230}
{F5163231}
{F5163232}
{F5163233}
{F5163234}
Reviewers: epriestley
Reviewed By: epriestley
Spies: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D18519
59 lines
1.6 KiB
PHP
59 lines
1.6 KiB
PHP
<?php
|
|
|
|
final class PhabricatorConfigApplicationController
|
|
extends PhabricatorConfigController {
|
|
|
|
public function handleRequest(AphrontRequest $request) {
|
|
$viewer = $request->getViewer();
|
|
|
|
$nav = $this->buildSideNavView();
|
|
$nav->selectFilter('application/');
|
|
|
|
$groups = PhabricatorApplicationConfigOptions::loadAll();
|
|
$apps_list = $this->buildConfigOptionsList($groups, 'apps');
|
|
$apps_list = $this->buildConfigBoxView(pht('Applications'), $apps_list);
|
|
|
|
$title = pht('Application Settings');
|
|
$header = $this->buildHeaderView($title);
|
|
|
|
$content = id(new PHUITwoColumnView())
|
|
->setHeader($header)
|
|
->setNavigation($nav)
|
|
->setFixed(true)
|
|
->setMainColumn($apps_list);
|
|
|
|
$crumbs = $this->buildApplicationCrumbs()
|
|
->addTextCrumb($title)
|
|
->setBorder(true);
|
|
|
|
return $this->newPage()
|
|
->setTitle($title)
|
|
->setCrumbs($crumbs)
|
|
->appendChild($content);
|
|
}
|
|
|
|
private function buildConfigOptionsList(array $groups, $type) {
|
|
assert_instances_of($groups, 'PhabricatorApplicationConfigOptions');
|
|
|
|
$list = new PHUIObjectItemListView();
|
|
$list->setBig(true);
|
|
$groups = msort($groups, 'getName');
|
|
foreach ($groups as $group) {
|
|
if ($group->getGroup() == $type) {
|
|
$icon = id(new PHUIIconView())
|
|
->setIcon($group->getIcon())
|
|
->setBackground('bg-violet');
|
|
$item = id(new PHUIObjectItemView())
|
|
->setHeader($group->getName())
|
|
->setHref('/config/group/'.$group->getKey().'/')
|
|
->addAttribute($group->getDescription())
|
|
->setImageIcon($icon);
|
|
$list->addItem($item);
|
|
}
|
|
}
|
|
|
|
return $list;
|
|
}
|
|
|
|
}
|