1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-20 12:30:56 +01:00

Convert Alamanc edit forms to new UI

Summary: Adds headers, new layout to edit panels on Almanac.

Test Plan: Pull up each edit panel in sandbox, save form.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D15527
This commit is contained in:
Chad Little 2016-03-26 11:54:55 -07:00
parent 0330ea575d
commit 6ad70d2236
4 changed files with 59 additions and 18 deletions

View file

@ -99,25 +99,35 @@ final class AlmanacBindingEditController
$box = id(new PHUIObjectBoxView()) $box = id(new PHUIObjectBoxView())
->setValidationException($validation_exception) ->setValidationException($validation_exception)
->setHeaderText($title) ->setHeaderText(pht('Binding'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->appendChild($form); ->appendChild($form);
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb($service->getName(), $service_uri); $crumbs->addTextCrumb($service->getName(), $service_uri);
if ($is_new) { if ($is_new) {
$crumbs->addTextCrumb(pht('Create Binding')); $crumbs->addTextCrumb(pht('Create Binding'));
$header = id(new PHUIHeaderView())
->setHeader(pht('Create Binding'))
->setHeaderIcon('fa-plus-square');
} else { } else {
$crumbs->addTextCrumb(pht('Edit Binding')); $crumbs->addTextCrumb(pht('Edit Binding'));
$header = id(new PHUIHeaderView())
->setHeader(pht('Create Binding'))
->setHeaderIcon('fa-pencil');
} }
$crumbs->setBorder(true);
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter(array(
$box,
));
return $this->newPage() return $this->newPage()
->setTitle($title) ->setTitle($title)
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->appendChild( ->appendChild($view);
array(
$box,
));
} }
} }

View file

@ -61,18 +61,25 @@ final class AlmanacConsoleController extends AlmanacController {
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(pht('Console')); $crumbs->addTextCrumb(pht('Console'));
$crumbs->setBorder(true);
$box = id(new PHUIObjectBoxView()) $box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Console'))
->setObjectList($menu); ->setObjectList($menu);
$header = id(new PHUIHeaderView())
->setHeader(pht('Almanac Console'))
->setHeaderIcon('fa-server');
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter(array(
$box,
));
return $this->newPage() return $this->newPage()
->setTitle(pht('Almanac Console')) ->setTitle(pht('Almanac Console'))
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->appendChild( ->appendChild($view);
array(
$box,
));
} }

View file

@ -131,24 +131,36 @@ final class AlmanacInterfaceEditController
$box = id(new PHUIObjectBoxView()) $box = id(new PHUIObjectBoxView())
->setValidationException($validation_exception) ->setValidationException($validation_exception)
->setHeaderText($title) ->setHeaderText(pht('Interface'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setForm($form); ->setForm($form);
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb($device->getName(), $device_uri); $crumbs->addTextCrumb($device->getName(), $device_uri);
if ($is_new) { if ($is_new) {
$crumbs->addTextCrumb(pht('Create Interface')); $crumbs->addTextCrumb(pht('Create Interface'));
$header = id(new PHUIHeaderView())
->setHeader(pht('Create Interface'))
->setHeaderIcon('fa-plus-square');
} else { } else {
$crumbs->addTextCrumb(pht('Edit Interface')); $crumbs->addTextCrumb(pht('Edit Interface'));
$header = id(new PHUIHeaderView())
->setHeader(pht('Edit Interface'))
->setHeaderIcon('fa-pencil');
} }
$crumbs->setBorder(true);
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter(array(
$box,
));
return $this->newPage() return $this->newPage()
->setTitle($title) ->setTitle($title)
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->appendChild( ->appendChild($view);
array(
$box,
));
} }
} }

View file

@ -75,8 +75,12 @@ final class AlmanacServiceEditController
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(pht('Create Service')); $crumbs->addTextCrumb(pht('Create Service'));
$crumbs->setBorder(true);
$title = pht('Choose Service Type'); $title = pht('Choose Service Type');
$header = id(new PHUIHeaderView())
->setHeader(pht('Create Service'))
->setHeaderIcon('fa-plus-square');
$form = id(new AphrontFormView()) $form = id(new AphrontFormView())
->setUser($viewer) ->setUser($viewer)
@ -88,13 +92,21 @@ final class AlmanacServiceEditController
$box = id(new PHUIObjectBoxView()) $box = id(new PHUIObjectBoxView())
->setFormErrors($errors) ->setFormErrors($errors)
->setHeaderText($title) ->setHeaderText(pht('Service'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setForm($form); ->setForm($form);
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter(array(
$box,
));
return $this->newPage() return $this->newPage()
->setTitle($title) ->setTitle($title)
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->appendChild($box); ->appendChild($view);
} }
} }