Differential D20694 Diff 49356 src/applications/diffusion/controller/DiffusionRepositoryEditDeleteController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionRepositoryEditDeleteController.php
Show All 11 Lines | public function handleRequest(AphrontRequest $request) { | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
$drequest = $this->getDiffusionRequest(); | $drequest = $this->getDiffusionRequest(); | ||||
$repository = $drequest->getRepository(); | $repository = $drequest->getRepository(); | ||||
$panel_uri = id(new DiffusionRepositoryBasicsManagementPanel()) | $panel_uri = id(new DiffusionRepositoryBasicsManagementPanel()) | ||||
->setRepository($repository) | ->setRepository($repository) | ||||
->getPanelURI(); | ->getPanelURI(); | ||||
$dialog = new AphrontDialogView(); | $doc_uri = PhabricatorEnv::getDoclink( | ||||
$text_1 = pht( | 'Permanently Destroying Data'); | ||||
'If you really want to delete the repository, run this command from '. | |||||
'the command line:'); | return $this->newDialog() | ||||
$command = csprintf( | ->setTitle(pht('Delete Repository')) | ||||
->appendParagraph( | |||||
pht( | |||||
'To permanently destroy this repository, run this command from '. | |||||
'the command line:')) | |||||
->appendCommand( | |||||
csprintf( | |||||
'phabricator/ $ ./bin/remove destroy %R', | 'phabricator/ $ ./bin/remove destroy %R', | ||||
$repository->getMonogram()); | $repository->getMonogram())) | ||||
$text_2 = pht( | ->appendParagraph( | ||||
'Repositories touch many objects and as such deletes are '. | pht( | ||||
'prohibitively expensive to run from the web UI.'); | 'Repositories can not be permanently destroyed from the web '. | ||||
$body = phutil_tag( | 'interface. See %s in the documentation for more information.', | ||||
'div', | phutil_tag( | ||||
'a', | |||||
array( | array( | ||||
'class' => 'phabricator-remarkup', | 'href' => $doc_uri, | ||||
'target' => '_blank', | |||||
), | ), | ||||
array( | pht('Permanently Destroying Data')))) | ||||
phutil_tag('p', array(), $text_1), | ->addCancelButton($panel_uri, pht('Close')); | ||||
phutil_tag('p', array(), | |||||
phutil_tag('tt', array(), $command)), | |||||
phutil_tag('p', array(), $text_2), | |||||
)); | |||||
return $this->newDialog() | |||||
->setTitle(pht('Really want to delete the repository?')) | |||||
->appendChild($body) | |||||
->addCancelButton($panel_uri, pht('Okay')); | |||||
} | } | ||||
} | } |