1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-20 04:20:55 +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())
->setValidationException($validation_exception)
->setHeaderText($title)
->setHeaderText(pht('Binding'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->appendChild($form);
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb($service->getName(), $service_uri);
if ($is_new) {
$crumbs->addTextCrumb(pht('Create Binding'));
$header = id(new PHUIHeaderView())
->setHeader(pht('Create Binding'))
->setHeaderIcon('fa-plus-square');
} else {
$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()
->setTitle($title)
->setCrumbs($crumbs)
->appendChild(
array(
$box,
));
->appendChild($view);
}
}

View file

@ -61,18 +61,25 @@ final class AlmanacConsoleController extends AlmanacController {
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(pht('Console'));
$crumbs->setBorder(true);
$box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Console'))
->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()
->setTitle(pht('Almanac Console'))
->setCrumbs($crumbs)
->appendChild(
array(
$box,
));
->appendChild($view);
}

View file

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

View file

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