Differential D15487 Diff 37335 src/applications/diffusion/controller/DiffusionRepositoryEditAutomationController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionRepositoryEditAutomationController.php
| Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | if ($request->isFormPost()) { | ||||
| return id(new AphrontRedirectResponse())->setURI($edit_uri); | return id(new AphrontRedirectResponse())->setURI($edit_uri); | ||||
| } | } | ||||
| $crumbs = $this->buildApplicationCrumbs(); | $crumbs = $this->buildApplicationCrumbs(); | ||||
| $crumbs->addTextCrumb(pht('Edit Automation')); | $crumbs->addTextCrumb(pht('Edit Automation')); | ||||
| $title = pht('Edit %s', $repository->getName()); | $title = pht('Edit %s', $repository->getName()); | ||||
| $header = id(new PHUIHeaderView()) | |||||
| ->setHeader($title) | |||||
| ->setHeaderIcon('fa-pencil'); | |||||
| $form = id(new AphrontFormView()) | $form = id(new AphrontFormView()) | ||||
| ->setUser($viewer) | ->setUser($viewer) | ||||
| ->appendRemarkupInstructions( | ->appendRemarkupInstructions( | ||||
| pht( | pht( | ||||
| "Configure **Repository Automation** to allow Phabricator to ". | "Configure **Repository Automation** to allow Phabricator to ". | ||||
| "write to this repository.". | "write to this repository.". | ||||
| "\n\n". | "\n\n". | ||||
| "IMPORTANT: This feature is new, experimental, and not supported. ". | "IMPORTANT: This feature is new, experimental, and not supported. ". | ||||
| "Use it at your own risk.")) | "Use it at your own risk.")) | ||||
| ->appendControl( | ->appendControl( | ||||
| id(new AphrontFormTokenizerControl()) | id(new AphrontFormTokenizerControl()) | ||||
| ->setLabel(pht('Use Blueprints')) | ->setLabel(pht('Use Blueprints')) | ||||
| ->setName('blueprintPHIDs') | ->setName('blueprintPHIDs') | ||||
| ->setValue($v_blueprints) | ->setValue($v_blueprints) | ||||
| ->setDatasource(new DrydockBlueprintDatasource())) | ->setDatasource(new DrydockBlueprintDatasource())) | ||||
| ->appendChild( | ->appendChild( | ||||
| id(new AphrontFormSubmitControl()) | id(new AphrontFormSubmitControl()) | ||||
| ->setValue(pht('Save')) | ->setValue(pht('Save')) | ||||
| ->addCancelButton($edit_uri)); | ->addCancelButton($edit_uri)); | ||||
| $object_box = id(new PHUIObjectBoxView()) | $form_box = id(new PHUIObjectBoxView()) | ||||
| ->setHeaderText($title) | ->setHeaderText(pht('Automation')) | ||||
| ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | |||||
| ->setForm($form); | ->setForm($form); | ||||
| $view = id(new PHUITwoColumnView()) | |||||
| ->setHeader($header) | |||||
| ->setFooter(array( | |||||
| $form_box, | |||||
| )); | |||||
| return $this->newPage() | return $this->newPage() | ||||
| ->setTitle($title) | ->setTitle($title) | ||||
| ->setCrumbs($crumbs) | ->setCrumbs($crumbs) | ||||
| ->appendChild($object_box); | ->appendChild($view); | ||||
| } | } | ||||
| } | } | ||||