Differential D15487 Diff 37335 src/applications/diffusion/controller/DiffusionRepositoryEditBasicController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionRepositoryEditBasicController.php
| Show First 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | if ($request->isFormPost()) { | ||||
| } | } | ||||
| } | } | ||||
| $crumbs = $this->buildApplicationCrumbs(); | $crumbs = $this->buildApplicationCrumbs(); | ||||
| $crumbs->addTextCrumb(pht('Edit Basics')); | $crumbs->addTextCrumb(pht('Edit Basics')); | ||||
| $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) | ||||
| ->appendChild( | ->appendChild( | ||||
| id(new AphrontFormTextControl()) | id(new AphrontFormTextControl()) | ||||
| ->setName('name') | ->setName('name') | ||||
| ->setLabel(pht('Name')) | ->setLabel(pht('Name')) | ||||
| ->setValue($v_name) | ->setValue($v_name) | ||||
| ->setError($e_name)) | ->setError($e_name)) | ||||
| Show All 23 Lines | $form = id(new AphrontFormView()) | ||||
| ->setValue($v_projects)) | ->setValue($v_projects)) | ||||
| ->appendChild( | ->appendChild( | ||||
| id(new AphrontFormSubmitControl()) | id(new AphrontFormSubmitControl()) | ||||
| ->setValue(pht('Save')) | ->setValue(pht('Save')) | ||||
| ->addCancelButton($edit_uri)) | ->addCancelButton($edit_uri)) | ||||
| ->appendChild(id(new PHUIFormDividerControl())) | ->appendChild(id(new PHUIFormDividerControl())) | ||||
| ->appendRemarkupInstructions($this->getReadmeInstructions()); | ->appendRemarkupInstructions($this->getReadmeInstructions()); | ||||
| $object_box = id(new PHUIObjectBoxView()) | $form_box = id(new PHUIObjectBoxView()) | ||||
| ->setHeaderText($title) | ->setHeaderText(pht('Basic Information')) | ||||
| ->setValidationException($validation_exception) | ->setValidationException($validation_exception) | ||||
| ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | |||||
| ->setForm($form) | ->setForm($form) | ||||
| ->setFormErrors($errors); | ->setFormErrors($errors); | ||||
| $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); | ||||
| } | } | ||||
| private function getReadmeInstructions() { | private function getReadmeInstructions() { | ||||
| return pht(<<<EOTEXT | return pht(<<<EOTEXT | ||||
| You can also create a `%s` file at the repository root (or in any | You can also create a `%s` file at the repository root (or in any | ||||
| subdirectory) to provide information about the repository. These formats are | subdirectory) to provide information about the repository. These formats are | ||||
| supported: | supported: | ||||
| Show All 18 Lines | |||||