Modernize most somewhat-weird Diffusion controllers
Summary: Ref T4245. This gets everything else except serving HTTP requests (complicated) and lint (quite weird). Test Plan: - Viewed a diff. - Viewed externals. - Viewed history table to see last modified. - Did path completion and validation in Owners. - Did tree path search in Diffusion. - Viewed a repository. - Created a new repository. - Looked up symbols. Reviewers: chad Reviewed By: chad Maniphest Tasks: T4245 Differential Revision: https://secure.phabricator.com/D14947
This commit is contained in:
@@ -6,12 +6,7 @@ final class DiffusionExternalController extends DiffusionController {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function shouldLoadDiffusionRequest() {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function processDiffusionRequest(AphrontRequest $request) {
|
||||
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$uri = $request->getStr('uri');
|
||||
$id = $request->getStr('id');
|
||||
|
||||
@@ -64,10 +59,11 @@ final class DiffusionExternalController extends DiffusionController {
|
||||
|
||||
if (empty($commits)) {
|
||||
$desc = null;
|
||||
if ($uri) {
|
||||
$desc = $uri.', at ';
|
||||
if (strlen($uri)) {
|
||||
$desc = pht('"%s", at "%s"', $uri, $id);
|
||||
} else {
|
||||
$desc = pht('"%s"', $id);
|
||||
}
|
||||
$desc .= $id;
|
||||
|
||||
$content = id(new PHUIInfoView())
|
||||
->setTitle(pht('Unknown External'))
|
||||
@@ -135,11 +131,13 @@ final class DiffusionExternalController extends DiffusionController {
|
||||
$content->setTable($table);
|
||||
}
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
$content,
|
||||
array(
|
||||
'title' => pht('Unresolvable External'),
|
||||
));
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$crumbs->addTextCrumb(pht('External'));
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle(pht('Unresolvable External'))
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($content);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user