Update EditEngine for two column
Summary: Cleans up EditEngine, adds new layout to EditEngine and descendents Test Plan: Test creating a new form, reordering, marking and unmarking defaults. View new forms. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D15531
This commit is contained in:
@@ -156,7 +156,7 @@ return array(
|
|||||||
'rsrc/css/phui/phui-status.css' => '37309046',
|
'rsrc/css/phui/phui-status.css' => '37309046',
|
||||||
'rsrc/css/phui/phui-tag-view.css' => '6bbd83e2',
|
'rsrc/css/phui/phui-tag-view.css' => '6bbd83e2',
|
||||||
'rsrc/css/phui/phui-timeline-view.css' => '6e342216',
|
'rsrc/css/phui/phui-timeline-view.css' => '6e342216',
|
||||||
'rsrc/css/phui/phui-two-column-view.css' => '9c43b599',
|
'rsrc/css/phui/phui-two-column-view.css' => '691fec04',
|
||||||
'rsrc/css/phui/workboards/phui-workboard-color.css' => 'ac6fe6a7',
|
'rsrc/css/phui/workboards/phui-workboard-color.css' => 'ac6fe6a7',
|
||||||
'rsrc/css/phui/workboards/phui-workboard.css' => 'e6d89647',
|
'rsrc/css/phui/workboards/phui-workboard.css' => 'e6d89647',
|
||||||
'rsrc/css/phui/workboards/phui-workcard.css' => '3646fb96',
|
'rsrc/css/phui/workboards/phui-workcard.css' => '3646fb96',
|
||||||
@@ -846,7 +846,7 @@ return array(
|
|||||||
'phui-tag-view-css' => '6bbd83e2',
|
'phui-tag-view-css' => '6bbd83e2',
|
||||||
'phui-theme-css' => '027ba77e',
|
'phui-theme-css' => '027ba77e',
|
||||||
'phui-timeline-view-css' => '6e342216',
|
'phui-timeline-view-css' => '6e342216',
|
||||||
'phui-two-column-view-css' => '9c43b599',
|
'phui-two-column-view-css' => '691fec04',
|
||||||
'phui-workboard-color-css' => 'ac6fe6a7',
|
'phui-workboard-color-css' => 'ac6fe6a7',
|
||||||
'phui-workboard-view-css' => 'e6d89647',
|
'phui-workboard-view-css' => 'e6d89647',
|
||||||
'phui-workcard-view-css' => '3646fb96',
|
'phui-workcard-view-css' => '3646fb96',
|
||||||
|
|||||||
@@ -13,4 +13,8 @@ final class AlmanacBindingPropertyEditEngine
|
|||||||
return $object->getURI();
|
return $object->getURI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getObjectName() {
|
||||||
|
return pht('Property');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,6 +53,10 @@ final class AlmanacDeviceEditEngine
|
|||||||
return pht('Create Device');
|
return pht('Create Device');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getObjectName() {
|
||||||
|
return pht('Device');
|
||||||
|
}
|
||||||
|
|
||||||
protected function getEditorURI() {
|
protected function getEditorURI() {
|
||||||
return '/almanac/device/edit/';
|
return '/almanac/device/edit/';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,4 +13,8 @@ final class AlmanacDevicePropertyEditEngine
|
|||||||
return $object->getURI();
|
return $object->getURI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getObjectName() {
|
||||||
|
return pht('Property');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,6 +53,10 @@ final class AlmanacNamespaceEditEngine
|
|||||||
return pht('Create Namespace');
|
return pht('Create Namespace');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getObjectName() {
|
||||||
|
return pht('Namespace');
|
||||||
|
}
|
||||||
|
|
||||||
protected function getEditorURI() {
|
protected function getEditorURI() {
|
||||||
return '/almanac/namespace/edit/';
|
return '/almanac/namespace/edit/';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,6 +53,10 @@ final class AlmanacNetworkEditEngine
|
|||||||
return pht('Create Network');
|
return pht('Create Network');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getObjectName() {
|
||||||
|
return pht('Network');
|
||||||
|
}
|
||||||
|
|
||||||
protected function getEditorURI() {
|
protected function getEditorURI() {
|
||||||
return '/almanac/network/edit/';
|
return '/almanac/network/edit/';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,6 +65,10 @@ final class AlmanacServiceEditEngine
|
|||||||
return pht('Create Service');
|
return pht('Create Service');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getObjectName() {
|
||||||
|
return pht('Service');
|
||||||
|
}
|
||||||
|
|
||||||
protected function getEditorURI() {
|
protected function getEditorURI() {
|
||||||
return '/almanac/service/edit/';
|
return '/almanac/service/edit/';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,4 +13,8 @@ final class AlmanacServicePropertyEditEngine
|
|||||||
return $object->getURI();
|
return $object->getURI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getObjectName() {
|
||||||
|
return pht('Property');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ final class PhabricatorBadgesEditEngine
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function getObjectEditTitleText($object) {
|
protected function getObjectEditTitleText($object) {
|
||||||
return pht('Edit %s', $object->getName());
|
return pht('Edit Badge: %s', $object->getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getObjectEditShortText($object) {
|
protected function getObjectEditShortText($object) {
|
||||||
@@ -45,6 +45,10 @@ final class PhabricatorBadgesEditEngine
|
|||||||
return pht('Create Badge');
|
return pht('Create Badge');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getObjectName() {
|
||||||
|
return pht('Badge');
|
||||||
|
}
|
||||||
|
|
||||||
protected function getCommentViewHeaderText($object) {
|
protected function getCommentViewHeaderText($object) {
|
||||||
return pht('Add Comment');
|
return pht('Add Comment');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,6 +75,10 @@ final class DrydockBlueprintEditEngine
|
|||||||
return pht('Create Blueprint');
|
return pht('Create Blueprint');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getObjectName() {
|
||||||
|
return pht('Blueprint');
|
||||||
|
}
|
||||||
|
|
||||||
protected function getEditorURI() {
|
protected function getEditorURI() {
|
||||||
return '/drydock/blueprint/edit/';
|
return '/drydock/blueprint/edit/';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,6 +54,10 @@ final class HarbormasterBuildPlanEditEngine
|
|||||||
return pht('Create Build Plan');
|
return pht('Create Build Plan');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getObjectName() {
|
||||||
|
return pht('Build Plan');
|
||||||
|
}
|
||||||
|
|
||||||
protected function getEditorURI() {
|
protected function getEditorURI() {
|
||||||
return '/harbormaster/plan/edit/';
|
return '/harbormaster/plan/edit/';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ final class ManiphestEditEngine
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function getObjectEditTitleText($object) {
|
protected function getObjectEditTitleText($object) {
|
||||||
return pht('Edit %s %s', $object->getMonogram(), $object->getTitle());
|
return pht('Edit Task: %s', $object->getTitle());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getObjectEditShortText($object) {
|
protected function getObjectEditShortText($object) {
|
||||||
@@ -45,6 +45,10 @@ final class ManiphestEditEngine
|
|||||||
return pht('Create Task');
|
return pht('Create Task');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getObjectName() {
|
||||||
|
return pht('Task');
|
||||||
|
}
|
||||||
|
|
||||||
protected function getEditorURI() {
|
protected function getEditorURI() {
|
||||||
return $this->getApplication()->getApplicationURI('task/edit/');
|
return $this->getApplication()->getApplicationURI('task/edit/');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,6 +53,10 @@ final class NuanceQueueEditEngine
|
|||||||
return pht('Create Queue');
|
return pht('Create Queue');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getObjectName() {
|
||||||
|
return pht('Queue');
|
||||||
|
}
|
||||||
|
|
||||||
protected function getEditorURI() {
|
protected function getEditorURI() {
|
||||||
return '/nuance/queue/edit/';
|
return '/nuance/queue/edit/';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,6 +74,10 @@ final class NuanceSourceEditEngine
|
|||||||
return pht('Create Source');
|
return pht('Create Source');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getObjectName() {
|
||||||
|
return pht('Source');
|
||||||
|
}
|
||||||
|
|
||||||
protected function getEditorURI() {
|
protected function getEditorURI() {
|
||||||
return '/nuance/source/edit/';
|
return '/nuance/source/edit/';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ final class PhabricatorOwnersPackageEditEngine
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function getObjectEditTitleText($object) {
|
protected function getObjectEditTitleText($object) {
|
||||||
return pht('Edit Package %s', $object->getName());
|
return pht('Edit Package: %s', $object->getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getObjectEditShortText($object) {
|
protected function getObjectEditShortText($object) {
|
||||||
@@ -46,6 +46,10 @@ final class PhabricatorOwnersPackageEditEngine
|
|||||||
return pht('Create Package');
|
return pht('Create Package');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getObjectName() {
|
||||||
|
return pht('Package');
|
||||||
|
}
|
||||||
|
|
||||||
protected function getObjectViewURI($object) {
|
protected function getObjectViewURI($object) {
|
||||||
$id = $object->getID();
|
$id = $object->getID();
|
||||||
return "/owners/package/{$id}/";
|
return "/owners/package/{$id}/";
|
||||||
|
|||||||
@@ -46,6 +46,10 @@ final class PhabricatorPasteEditEngine
|
|||||||
return pht('Create Paste');
|
return pht('Create Paste');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getObjectName() {
|
||||||
|
return pht('Paste');
|
||||||
|
}
|
||||||
|
|
||||||
protected function getCommentViewHeaderText($object) {
|
protected function getCommentViewHeaderText($object) {
|
||||||
return pht('Eat Paste');
|
return pht('Eat Paste');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,6 +46,10 @@ final class PhameBlogEditEngine
|
|||||||
return pht('Create Blog');
|
return pht('Create Blog');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getObjectName() {
|
||||||
|
return pht('Blog');
|
||||||
|
}
|
||||||
|
|
||||||
protected function getObjectCreateCancelURI($object) {
|
protected function getObjectCreateCancelURI($object) {
|
||||||
return $this->getApplication()->getApplicationURI('blog/');
|
return $this->getApplication()->getApplicationURI('blog/');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,6 +60,10 @@ final class PhamePostEditEngine
|
|||||||
return pht('Create Post');
|
return pht('Create Post');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getObjectName() {
|
||||||
|
return pht('Post');
|
||||||
|
}
|
||||||
|
|
||||||
protected function getObjectViewURI($object) {
|
protected function getObjectViewURI($object) {
|
||||||
return $object->getViewURI();
|
return $object->getViewURI();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ final class PhabricatorProjectEditEngine
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function getObjectEditTitleText($object) {
|
protected function getObjectEditTitleText($object) {
|
||||||
return pht('Edit %s', $object->getName());
|
return pht('Edit Project: %s', $object->getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getObjectEditShortText($object) {
|
protected function getObjectEditShortText($object) {
|
||||||
@@ -67,6 +67,10 @@ final class PhabricatorProjectEditEngine
|
|||||||
return pht('Create Project');
|
return pht('Create Project');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getObjectName() {
|
||||||
|
return pht('Project');
|
||||||
|
}
|
||||||
|
|
||||||
protected function getObjectViewURI($object) {
|
protected function getObjectViewURI($object) {
|
||||||
if ($this->getIsCreate()) {
|
if ($this->getIsCreate()) {
|
||||||
return $object->getURI();
|
return $object->getURI();
|
||||||
|
|||||||
@@ -108,6 +108,10 @@ final class PhabricatorProfilePanelEditEngine
|
|||||||
return pht('Edit Menu Item');
|
return pht('Edit Menu Item');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getObjectName() {
|
||||||
|
return pht('Menu Item');
|
||||||
|
}
|
||||||
|
|
||||||
protected function getObjectCreateCancelURI($object) {
|
protected function getObjectCreateCancelURI($object) {
|
||||||
return $this->getPanelEngine()->getConfigureURI();
|
return $this->getPanelEngine()->getConfigureURI();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ final class PhabricatorEditEngineConfigurationDefaultsController
|
|||||||
->addCancelButton($cancel_uri));
|
->addCancelButton($cancel_uri));
|
||||||
|
|
||||||
$info = id(new PHUIInfoView())
|
$info = id(new PHUIInfoView())
|
||||||
->setSeverity(PHUIInfoView::SEVERITY_NOTICE)
|
->setSeverity(PHUIInfoView::SEVERITY_WARNING)
|
||||||
->setErrors(
|
->setErrors(
|
||||||
array(
|
array(
|
||||||
pht('You are editing the default values for this form.'),
|
pht('You are editing the default values for this form.'),
|
||||||
@@ -94,18 +94,30 @@ final class PhabricatorEditEngineConfigurationDefaultsController
|
|||||||
|
|
||||||
|
|
||||||
$box = id(new PHUIObjectBoxView())
|
$box = id(new PHUIObjectBoxView())
|
||||||
->setHeaderText($title)
|
->setHeaderText(pht('Form'))
|
||||||
->setInfoView($info)
|
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||||
->setForm($form);
|
->setForm($form);
|
||||||
|
|
||||||
$crumbs = $this->buildApplicationCrumbs();
|
$crumbs = $this->buildApplicationCrumbs();
|
||||||
$crumbs->addTextCrumb(pht('Form %d', $config->getID()), $cancel_uri);
|
$crumbs->addTextCrumb(pht('Form %d', $config->getID()), $cancel_uri);
|
||||||
$crumbs->addTextCrumb(pht('Edit Defaults'));
|
$crumbs->addTextCrumb(pht('Edit Defaults'));
|
||||||
|
$crumbs->setBorder(true);
|
||||||
|
|
||||||
|
$header = id(new PHUIHeaderView())
|
||||||
|
->setHeader(pht('Edit Form Defaults'))
|
||||||
|
->setHeaderIcon('fa-pencil');
|
||||||
|
|
||||||
|
$view = id(new PHUITwoColumnView())
|
||||||
|
->setHeader($header)
|
||||||
|
->setFooter(array(
|
||||||
|
$info,
|
||||||
|
$box,
|
||||||
|
));
|
||||||
|
|
||||||
return $this->newPage()
|
return $this->newPage()
|
||||||
->setTitle($title)
|
->setTitle($title)
|
||||||
->setCrumbs($crumbs)
|
->setCrumbs($crumbs)
|
||||||
->appendChild($box);
|
->appendChild($view);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,27 +17,35 @@ final class PhabricatorEditEngineConfigurationViewController
|
|||||||
|
|
||||||
$is_concrete = (bool)$config->getID();
|
$is_concrete = (bool)$config->getID();
|
||||||
|
|
||||||
$actions = $this->buildActionView($config);
|
$curtain = $this->buildCurtainView($config);
|
||||||
|
$properties = $this->buildPropertyView($config);
|
||||||
$properties = $this->buildPropertyView($config)
|
|
||||||
->setActionList($actions);
|
|
||||||
|
|
||||||
$header = id(new PHUIHeaderView())
|
$header = id(new PHUIHeaderView())
|
||||||
->setUser($viewer)
|
->setUser($viewer)
|
||||||
->setPolicyObject($config)
|
->setPolicyObject($config)
|
||||||
->setHeader(pht('Edit Form: %s', $config->getDisplayName()));
|
->setHeader(pht('Edit Form: %s', $config->getDisplayName()))
|
||||||
|
->setHeaderIcon('fa-pencil');
|
||||||
|
|
||||||
$box = id(new PHUIObjectBoxView())
|
if ($config->getIsDisabled()) {
|
||||||
->setHeader($header)
|
$name = pht('Disabled');
|
||||||
->addPropertyList($properties);
|
$icon = 'fa-ban';
|
||||||
|
$color = 'indigo';
|
||||||
|
} else {
|
||||||
|
$name = pht('Enabled');
|
||||||
|
$icon = 'fa-check';
|
||||||
|
$color = 'green';
|
||||||
|
}
|
||||||
|
$header->setStatus($icon, $color, $name);
|
||||||
|
|
||||||
$field_list = $this->buildFieldList($config);
|
$field_list = $this->buildFieldList($config);
|
||||||
|
|
||||||
$crumbs = $this->buildApplicationCrumbs();
|
$crumbs = $this->buildApplicationCrumbs();
|
||||||
|
$crumbs->setBorder(true);
|
||||||
|
|
||||||
if ($is_concrete) {
|
if ($is_concrete) {
|
||||||
$crumbs->addTextCrumb(pht('Form %d', $config->getID()));
|
$title = pht('Form %d', $config->getID());
|
||||||
|
$crumbs->addTextCrumb($title);
|
||||||
} else {
|
} else {
|
||||||
|
$title = pht('Builtin');
|
||||||
$crumbs->addTextCrumb(pht('Builtin'));
|
$crumbs->addTextCrumb(pht('Builtin'));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,17 +59,21 @@ final class PhabricatorEditEngineConfigurationViewController
|
|||||||
$timeline = null;
|
$timeline = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->newPage()
|
$view = id(new PHUITwoColumnView())
|
||||||
->setCrumbs($crumbs)
|
->setHeader($header)
|
||||||
->appendChild(
|
->setCurtain($curtain)
|
||||||
array(
|
->setMainColumn(array(
|
||||||
$box,
|
|
||||||
$field_list,
|
$field_list,
|
||||||
$timeline,
|
$timeline,
|
||||||
));
|
));
|
||||||
|
|
||||||
|
return $this->newPage()
|
||||||
|
->setTitle($title)
|
||||||
|
->setCrumbs($crumbs)
|
||||||
|
->appendChild($view);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function buildActionView(
|
private function buildCurtainView(
|
||||||
PhabricatorEditEngineConfiguration $config) {
|
PhabricatorEditEngineConfiguration $config) {
|
||||||
$viewer = $this->getViewer();
|
$viewer = $this->getViewer();
|
||||||
$engine = $config->getEngine();
|
$engine = $config->getEngine();
|
||||||
@@ -72,9 +84,7 @@ final class PhabricatorEditEngineConfigurationViewController
|
|||||||
$config,
|
$config,
|
||||||
PhabricatorPolicyCapability::CAN_EDIT);
|
PhabricatorPolicyCapability::CAN_EDIT);
|
||||||
|
|
||||||
$view = id(new PhabricatorActionListView())
|
$curtain = $this->newCurtainView($config);
|
||||||
->setUser($viewer);
|
|
||||||
|
|
||||||
$form_key = $config->getIdentifier();
|
$form_key = $config->getIdentifier();
|
||||||
|
|
||||||
$base_uri = "/transactions/editengine/{$engine_key}";
|
$base_uri = "/transactions/editengine/{$engine_key}";
|
||||||
@@ -83,7 +93,7 @@ final class PhabricatorEditEngineConfigurationViewController
|
|||||||
if (!$is_concrete) {
|
if (!$is_concrete) {
|
||||||
$save_uri = "{$base_uri}/save/{$form_key}/";
|
$save_uri = "{$base_uri}/save/{$form_key}/";
|
||||||
|
|
||||||
$view->addAction(
|
$curtain->addAction(
|
||||||
id(new PhabricatorActionView())
|
id(new PhabricatorActionView())
|
||||||
->setName(pht('Make Editable'))
|
->setName(pht('Make Editable'))
|
||||||
->setIcon('fa-pencil')
|
->setIcon('fa-pencil')
|
||||||
@@ -94,7 +104,7 @@ final class PhabricatorEditEngineConfigurationViewController
|
|||||||
$can_edit = false;
|
$can_edit = false;
|
||||||
} else {
|
} else {
|
||||||
$edit_uri = "{$base_uri}/edit/{$form_key}/";
|
$edit_uri = "{$base_uri}/edit/{$form_key}/";
|
||||||
$view->addAction(
|
$curtain->addAction(
|
||||||
id(new PhabricatorActionView())
|
id(new PhabricatorActionView())
|
||||||
->setName(pht('Edit Form Configuration'))
|
->setName(pht('Edit Form Configuration'))
|
||||||
->setIcon('fa-pencil')
|
->setIcon('fa-pencil')
|
||||||
@@ -105,7 +115,7 @@ final class PhabricatorEditEngineConfigurationViewController
|
|||||||
|
|
||||||
$use_uri = $engine->getEditURI(null, "form/{$form_key}/");
|
$use_uri = $engine->getEditURI(null, "form/{$form_key}/");
|
||||||
|
|
||||||
$view->addAction(
|
$curtain->addAction(
|
||||||
id(new PhabricatorActionView())
|
id(new PhabricatorActionView())
|
||||||
->setName(pht('Use Form'))
|
->setName(pht('Use Form'))
|
||||||
->setIcon('fa-th-list')
|
->setIcon('fa-th-list')
|
||||||
@@ -113,7 +123,7 @@ final class PhabricatorEditEngineConfigurationViewController
|
|||||||
|
|
||||||
$defaults_uri = "{$base_uri}/defaults/{$form_key}/";
|
$defaults_uri = "{$base_uri}/defaults/{$form_key}/";
|
||||||
|
|
||||||
$view->addAction(
|
$curtain->addAction(
|
||||||
id(new PhabricatorActionView())
|
id(new PhabricatorActionView())
|
||||||
->setName(pht('Change Default Values'))
|
->setName(pht('Change Default Values'))
|
||||||
->setIcon('fa-paint-brush')
|
->setIcon('fa-paint-brush')
|
||||||
@@ -123,7 +133,7 @@ final class PhabricatorEditEngineConfigurationViewController
|
|||||||
|
|
||||||
$reorder_uri = "{$base_uri}/reorder/{$form_key}/";
|
$reorder_uri = "{$base_uri}/reorder/{$form_key}/";
|
||||||
|
|
||||||
$view->addAction(
|
$curtain->addAction(
|
||||||
id(new PhabricatorActionView())
|
id(new PhabricatorActionView())
|
||||||
->setName(pht('Change Field Order'))
|
->setName(pht('Change Field Order'))
|
||||||
->setIcon('fa-sort-alpha-asc')
|
->setIcon('fa-sort-alpha-asc')
|
||||||
@@ -133,7 +143,7 @@ final class PhabricatorEditEngineConfigurationViewController
|
|||||||
|
|
||||||
$lock_uri = "{$base_uri}/lock/{$form_key}/";
|
$lock_uri = "{$base_uri}/lock/{$form_key}/";
|
||||||
|
|
||||||
$view->addAction(
|
$curtain->addAction(
|
||||||
id(new PhabricatorActionView())
|
id(new PhabricatorActionView())
|
||||||
->setName(pht('Lock / Hide Fields'))
|
->setName(pht('Lock / Hide Fields'))
|
||||||
->setIcon('fa-lock')
|
->setIcon('fa-lock')
|
||||||
@@ -151,7 +161,7 @@ final class PhabricatorEditEngineConfigurationViewController
|
|||||||
$disable_icon = 'fa-ban';
|
$disable_icon = 'fa-ban';
|
||||||
}
|
}
|
||||||
|
|
||||||
$view->addAction(
|
$curtain->addAction(
|
||||||
id(new PhabricatorActionView())
|
id(new PhabricatorActionView())
|
||||||
->setName($disable_name)
|
->setName($disable_name)
|
||||||
->setIcon($disable_icon)
|
->setIcon($disable_icon)
|
||||||
@@ -169,7 +179,7 @@ final class PhabricatorEditEngineConfigurationViewController
|
|||||||
$defaultcreate_icon = 'fa-plus';
|
$defaultcreate_icon = 'fa-plus';
|
||||||
}
|
}
|
||||||
|
|
||||||
$view->addAction(
|
$curtain->addAction(
|
||||||
id(new PhabricatorActionView())
|
id(new PhabricatorActionView())
|
||||||
->setName($defaultcreate_name)
|
->setName($defaultcreate_name)
|
||||||
->setIcon($defaultcreate_icon)
|
->setIcon($defaultcreate_icon)
|
||||||
@@ -187,7 +197,7 @@ final class PhabricatorEditEngineConfigurationViewController
|
|||||||
|
|
||||||
$isedit_uri = "{$base_uri}/defaultedit/{$form_key}/";
|
$isedit_uri = "{$base_uri}/defaultedit/{$form_key}/";
|
||||||
|
|
||||||
$view->addAction(
|
$curtain->addAction(
|
||||||
id(new PhabricatorActionView())
|
id(new PhabricatorActionView())
|
||||||
->setName($isedit_name)
|
->setName($isedit_name)
|
||||||
->setIcon($isedit_icon)
|
->setIcon($isedit_icon)
|
||||||
@@ -195,7 +205,7 @@ final class PhabricatorEditEngineConfigurationViewController
|
|||||||
->setWorkflow(true)
|
->setWorkflow(true)
|
||||||
->setDisabled(!$can_edit));
|
->setDisabled(!$can_edit));
|
||||||
|
|
||||||
return $view;
|
return $curtain;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function buildPropertyView(
|
private function buildPropertyView(
|
||||||
@@ -203,8 +213,7 @@ final class PhabricatorEditEngineConfigurationViewController
|
|||||||
$viewer = $this->getViewer();
|
$viewer = $this->getViewer();
|
||||||
|
|
||||||
$properties = id(new PHUIPropertyListView())
|
$properties = id(new PHUIPropertyListView())
|
||||||
->setUser($viewer)
|
->setUser($viewer);
|
||||||
->setObject($config);
|
|
||||||
|
|
||||||
return $properties;
|
return $properties;
|
||||||
}
|
}
|
||||||
@@ -226,7 +235,7 @@ final class PhabricatorEditEngineConfigurationViewController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$info = id(new PHUIInfoView())
|
$info = id(new PHUIInfoView())
|
||||||
->setSeverity(PHUIInfoView::SEVERITY_NOTICE)
|
->setSeverity(PHUIInfoView::SEVERITY_WARNING)
|
||||||
->setErrors(
|
->setErrors(
|
||||||
array(
|
array(
|
||||||
pht('This is a preview of the current form configuration.'),
|
pht('This is a preview of the current form configuration.'),
|
||||||
@@ -234,10 +243,10 @@ final class PhabricatorEditEngineConfigurationViewController
|
|||||||
|
|
||||||
$box = id(new PHUIObjectBoxView())
|
$box = id(new PHUIObjectBoxView())
|
||||||
->setHeaderText(pht('Form Preview'))
|
->setHeaderText(pht('Form Preview'))
|
||||||
->setInfoView($info)
|
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||||
->setForm($form);
|
->setForm($form);
|
||||||
|
|
||||||
return $box;
|
return array($info, $box);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -188,6 +188,12 @@ abstract class PhabricatorEditEngine
|
|||||||
abstract protected function getObjectCreateShortText();
|
abstract protected function getObjectCreateShortText();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @task text
|
||||||
|
*/
|
||||||
|
abstract protected function getObjectName();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @task text
|
* @task text
|
||||||
*/
|
*/
|
||||||
@@ -988,8 +994,10 @@ abstract class PhabricatorEditEngine
|
|||||||
|
|
||||||
if ($this->getIsCreate()) {
|
if ($this->getIsCreate()) {
|
||||||
$header_text = $this->getFormHeaderText($object);
|
$header_text = $this->getFormHeaderText($object);
|
||||||
|
$header_icon = 'fa-plus-square';
|
||||||
} else {
|
} else {
|
||||||
$header_text = $this->getObjectEditTitleText($object);
|
$header_text = $this->getObjectEditTitleText($object);
|
||||||
|
$header_icon = 'fa-pencil';
|
||||||
}
|
}
|
||||||
|
|
||||||
$show_preview = !$request->isAjax();
|
$show_preview = !$request->isAjax();
|
||||||
@@ -1036,25 +1044,34 @@ abstract class PhabricatorEditEngine
|
|||||||
}
|
}
|
||||||
|
|
||||||
$header = id(new PHUIHeaderView())
|
$header = id(new PHUIHeaderView())
|
||||||
->setHeader($header_text);
|
->setHeader($header_text)
|
||||||
|
->setHeaderIcon($header_icon);
|
||||||
|
|
||||||
if ($action_button) {
|
if ($action_button) {
|
||||||
$header->addActionLink($action_button);
|
$header->addActionLink($action_button);
|
||||||
}
|
}
|
||||||
|
|
||||||
$crumbs = $this->buildCrumbs($object, $final = true);
|
$crumbs = $this->buildCrumbs($object, $final = true);
|
||||||
|
$crumbs->setBorder(true);
|
||||||
|
|
||||||
$box = id(new PHUIObjectBoxView())
|
$box = id(new PHUIObjectBoxView())
|
||||||
->setUser($viewer)
|
->setUser($viewer)
|
||||||
->setHeader($header)
|
->setHeaderText($this->getObjectName())
|
||||||
->setValidationException($validation_exception)
|
->setValidationException($validation_exception)
|
||||||
|
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||||
->appendChild($form);
|
->appendChild($form);
|
||||||
|
|
||||||
|
$view = id(new PHUITwoColumnView())
|
||||||
|
->setHeader($header)
|
||||||
|
->setFooter(array(
|
||||||
|
$box,
|
||||||
|
$previews,
|
||||||
|
));
|
||||||
|
|
||||||
return $controller->newPage()
|
return $controller->newPage()
|
||||||
->setTitle($header_text)
|
->setTitle($header_text)
|
||||||
->setCrumbs($crumbs)
|
->setCrumbs($crumbs)
|
||||||
->appendChild($box)
|
->appendChild($view);
|
||||||
->appendChild($previews);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function newEditResponse(
|
protected function newEditResponse(
|
||||||
|
|||||||
@@ -70,6 +70,10 @@ final class PhabricatorEditEngineConfigurationEditEngine
|
|||||||
return pht('Create Form');
|
return pht('Create Form');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getObjectName() {
|
||||||
|
return pht('Form');
|
||||||
|
}
|
||||||
|
|
||||||
protected function getObjectViewURI($object) {
|
protected function getObjectViewURI($object) {
|
||||||
$id = $object->getID();
|
$id = $object->getID();
|
||||||
return $this->getURI("view/{$id}/");
|
return $this->getURI("view/{$id}/");
|
||||||
|
|||||||
@@ -116,24 +116,27 @@ final class PhabricatorEditEngineConfigurationSearchEngine
|
|||||||
|
|
||||||
$id = $config->getID();
|
$id = $config->getID();
|
||||||
if ($id) {
|
if ($id) {
|
||||||
$item->setObjectName(pht('Form %d', $id));
|
$item->addIcon('fa-file-text-o bluegrey', pht('Form %d', $id));
|
||||||
$key = $id;
|
$key = $id;
|
||||||
} else {
|
} else {
|
||||||
$item->setObjectName(pht('Builtin'));
|
$item->addIcon('fa-file-text bluegrey', pht('Builtin'));
|
||||||
$key = $config->getBuiltinKey();
|
$key = $config->getBuiltinKey();
|
||||||
}
|
}
|
||||||
$item->setHref("/transactions/editengine/{$engine_key}/view/{$key}/");
|
$item->setHref("/transactions/editengine/{$engine_key}/view/{$key}/");
|
||||||
|
|
||||||
if ($config->getIsDefault()) {
|
if ($config->getIsDefault()) {
|
||||||
$item->addIcon('fa-plus', pht('Default'));
|
$item->addAttribute(pht('Default Create Form'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($config->getIsEdit()) {
|
if ($config->getIsEdit()) {
|
||||||
$item->addIcon('fa-pencil', pht('Edit Form'));
|
$item->addAttribute(pht('Edit Form'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($config->getIsDisabled()) {
|
if ($config->getIsDisabled()) {
|
||||||
$item->addIcon('fa-ban', pht('Disabled'));
|
$item->setDisabled(true);
|
||||||
|
$item->setStatusIcon('fa-ban grey', pht('Disabled'));
|
||||||
|
} else {
|
||||||
|
$item->setStatusIcon('fa-file-text-o green', pht('Enabled'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$list->addItem($item);
|
$list->addItem($item);
|
||||||
|
|||||||
@@ -104,4 +104,47 @@ final class PhabricatorEditEngineConfigurationTransaction
|
|||||||
return parent::getTitle();
|
return parent::getTitle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getColor() {
|
||||||
|
$author_phid = $this->getAuthorPHID();
|
||||||
|
|
||||||
|
$old = $this->getOldValue();
|
||||||
|
$new = $this->getNewValue();
|
||||||
|
|
||||||
|
$type = $this->getTransactionType();
|
||||||
|
switch ($type) {
|
||||||
|
case PhabricatorTransactions::TYPE_CREATE:
|
||||||
|
return 'green';
|
||||||
|
case self::TYPE_DISABLE:
|
||||||
|
if ($new) {
|
||||||
|
return 'indigo';
|
||||||
|
} else {
|
||||||
|
return 'green';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return parent::getColor();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getIcon() {
|
||||||
|
$author_phid = $this->getAuthorPHID();
|
||||||
|
|
||||||
|
$old = $this->getOldValue();
|
||||||
|
$new = $this->getNewValue();
|
||||||
|
|
||||||
|
$type = $this->getTransactionType();
|
||||||
|
switch ($type) {
|
||||||
|
case PhabricatorTransactions::TYPE_CREATE:
|
||||||
|
return 'fa-plus';
|
||||||
|
case self::TYPE_DISABLE:
|
||||||
|
if ($new) {
|
||||||
|
return 'fa-ban';
|
||||||
|
} else {
|
||||||
|
return 'fa-check';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return parent::getIcon();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -188,7 +188,7 @@
|
|||||||
|
|
||||||
/* Info View */
|
/* Info View */
|
||||||
|
|
||||||
.phui-two-column-view .phui-two-column-row .phui-info-view {
|
.phui-two-column-view .phui-info-view {
|
||||||
margin: 0 0 20px 0;
|
margin: 0 0 20px 0;
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user