Modernize tag and branch controllers in Diffusion

Summary: Ref T4245. Prepares these controllers to accept alternate identifers, plus minor spacing and layout fixes.

Test Plan: Viewed tags, viewed branches.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T4245

Differential Revision: https://secure.phabricator.com/D14941
This commit is contained in:
epriestley
2016-01-05 05:00:22 -08:00
parent fb3b4ee532
commit 7de17fb75e
5 changed files with 63 additions and 48 deletions

View File

@@ -61,23 +61,16 @@ abstract class DiffusionController extends PhabricatorController {
$identifier = (int)$request->getURIData('repositoryID');
}
$blob = $request->getURIData('dblob');
if (strlen($blob)) {
$parsed = DiffusionRequest::parseRequestBlob($blob);
} else {
$parsed = array(
'commit' => $request->getURIData('commit'),
'path' => $request->getURIData('path'),
'line' => $request->getURIData('line'),
'branch' => $request->getURIData('branch'),
'lint' => $request->getStr('lint'),
);
}
$params = array(
'repository' => $identifier,
'user' => $viewer,
) + $parsed;
'blob' => $request->getURIData('dblob'),
'commit' => $request->getURIData('commit'),
'path' => $request->getURIData('path'),
'line' => $request->getURIData('line'),
'branch' => $request->getURIData('branch'),
'lint' => $request->getStr('lint'),
);
$drequest = DiffusionRequest::newFromDictionary($params);
@@ -286,4 +279,10 @@ abstract class DiffusionController extends PhabricatorController {
->appendChild($body);
}
protected function renderTablePagerBox(PHUIPagerView $pager) {
return id(new PHUIBoxView())
->addMargin(PHUI::MARGIN_LARGE)
->appendChild($pager);
}
}