Differential D15487 Diff 37335 src/applications/diffusion/controller/DiffusionRepositoryEditHostingController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionRepositoryEditHostingController.php
| Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | if ($request->isFormPost()) { | ||||
| return id(new AphrontRedirectResponse())->setURI($next_uri); | return id(new AphrontRedirectResponse())->setURI($next_uri); | ||||
| } | } | ||||
| $crumbs = $this->buildApplicationCrumbs(); | $crumbs = $this->buildApplicationCrumbs(); | ||||
| $crumbs->addTextCrumb(pht('Edit Hosting')); | $crumbs->addTextCrumb(pht('Edit Hosting')); | ||||
| $title = pht('Edit Hosting (%s)', $repository->getName()); | $title = pht('Edit Hosting (%s)', $repository->getName()); | ||||
| $header = id(new PHUIHeaderView()) | |||||
| ->setHeader($title) | |||||
| ->setHeaderIcon('fa-pencil'); | |||||
| $hosted_control = id(new AphrontFormRadioButtonControl()) | $hosted_control = id(new AphrontFormRadioButtonControl()) | ||||
| ->setName('hosting') | ->setName('hosting') | ||||
| ->setLabel(pht('Hosting')) | ->setLabel(pht('Hosting')) | ||||
| ->addButton( | ->addButton( | ||||
| true, | true, | ||||
| pht('Host Repository on Phabricator'), | pht('Host Repository on Phabricator'), | ||||
| pht( | pht( | ||||
| Show All 22 Lines | $form = id(new AphrontFormView()) | ||||
| 'Repository Hosting]]', | 'Repository Hosting]]', | ||||
| $doc_href)) | $doc_href)) | ||||
| ->appendChild($hosted_control) | ->appendChild($hosted_control) | ||||
| ->appendChild( | ->appendChild( | ||||
| id(new AphrontFormSubmitControl()) | id(new AphrontFormSubmitControl()) | ||||
| ->setValue(pht('Save and Continue')) | ->setValue(pht('Save and Continue')) | ||||
| ->addCancelButton($edit_uri)); | ->addCancelButton($edit_uri)); | ||||
| $object_box = id(new PHUIObjectBoxView()) | $form_box = id(new PHUIObjectBoxView()) | ||||
| ->setHeaderText($title) | ->setHeaderText(pht('Hosting')) | ||||
| ->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); | ||||
| } | } | ||||
| public function handleProtocols(PhabricatorRepository $repository) { | public function handleProtocols(PhabricatorRepository $repository) { | ||||
| $request = $this->getRequest(); | $request = $this->getRequest(); | ||||
| $user = $request->getUser(); | $user = $request->getUser(); | ||||
| $type = $repository->getVersionControlSystem(); | $type = $repository->getVersionControlSystem(); | ||||
| $is_svn = ($type == PhabricatorRepositoryType::REPOSITORY_TYPE_SVN); | $is_svn = ($type == PhabricatorRepositoryType::REPOSITORY_TYPE_SVN); | ||||
| Show All 36 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 Protocols')); | $crumbs->addTextCrumb(pht('Edit Protocols')); | ||||
| $title = pht('Edit Protocols (%s)', $repository->getName()); | $title = pht('Edit Protocols (%s)', $repository->getName()); | ||||
| $header = id(new PHUIHeaderView()) | |||||
| ->setHeader($title) | |||||
| ->setHeaderIcon('fa-pencil'); | |||||
| $rw_message = pht( | $rw_message = pht( | ||||
| 'Phabricator will serve a read-write copy of this repository.'); | 'Phabricator will serve a read-write copy of this repository.'); | ||||
| if (!$repository->isHosted()) { | if (!$repository->isHosted()) { | ||||
| $rw_message = array( | $rw_message = array( | ||||
| $rw_message, | $rw_message, | ||||
| phutil_tag('br'), | phutil_tag('br'), | ||||
| ▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | public function handleProtocols(PhabricatorRepository $repository) { | ||||
| $form | $form | ||||
| ->appendChild($http_control) | ->appendChild($http_control) | ||||
| ->appendChild( | ->appendChild( | ||||
| id(new AphrontFormSubmitControl()) | id(new AphrontFormSubmitControl()) | ||||
| ->setValue(pht('Save Changes')) | ->setValue(pht('Save Changes')) | ||||
| ->addCancelButton($prev_uri, pht('Back'))); | ->addCancelButton($prev_uri, pht('Back'))); | ||||
| $object_box = id(new PHUIObjectBoxView()) | $form_box = id(new PHUIObjectBoxView()) | ||||
| ->setHeaderText($title) | ->setHeaderText(pht('Protocols')) | ||||
| ->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); | ||||
| } | } | ||||
| } | } | ||||