mirror of
https://we.phorge.it/source/phorge.git
synced 2025-03-08 10:24:48 +01:00
Modernize Countdown
Summary: Update to new modern methods. Test Plan: View List, New Countdown, Edit Countdown, Delete Countdown Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T9690 Differential Revision: https://secure.phabricator.com/D14593
This commit is contained in:
parent
5686fb7fa4
commit
ee102c7aca
4 changed files with 27 additions and 50 deletions
|
@ -2,27 +2,9 @@
|
|||
|
||||
abstract class PhabricatorCountdownController extends PhabricatorController {
|
||||
|
||||
public function buildSideNavView($for_app = false) {
|
||||
$user = $this->getRequest()->getUser();
|
||||
|
||||
$nav = new AphrontSideNavFilterView();
|
||||
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
|
||||
|
||||
if ($for_app) {
|
||||
$nav->addFilter('create', pht('Create Countdown'));
|
||||
}
|
||||
|
||||
id(new PhabricatorCountdownSearchEngine())
|
||||
->setViewer($user)
|
||||
->addNavigationItems($nav->getMenu());
|
||||
|
||||
$nav->selectFilter(null);
|
||||
|
||||
return $nav;
|
||||
}
|
||||
|
||||
public function buildApplicationMenu() {
|
||||
return $this->buildSideNavView($for_app = true)->getMenu();
|
||||
return $this->newApplicationMenu()
|
||||
->setSearchEngine(new PhabricatorCountdownSearchEngine());
|
||||
}
|
||||
|
||||
protected function buildApplicationCrumbs() {
|
||||
|
|
|
@ -184,14 +184,13 @@ final class PhabricatorCountdownEditController
|
|||
->setFormErrors($errors)
|
||||
->setForm($form);
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
array(
|
||||
$crumbs,
|
||||
$form_box,
|
||||
),
|
||||
array(
|
||||
'title' => $page_title,
|
||||
));
|
||||
return $this->newPage()
|
||||
->setTitle($page_title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild(
|
||||
array(
|
||||
$form_box,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,15 +8,9 @@ final class PhabricatorCountdownListController
|
|||
}
|
||||
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$querykey = $request->getURIData('queryKey');
|
||||
|
||||
$controller = id(new PhabricatorApplicationSearchController())
|
||||
->setQueryKey($querykey)
|
||||
->setSearchEngine(new PhabricatorCountdownSearchEngine())
|
||||
->setNavigation($this->buildSideNavView());
|
||||
|
||||
return $this->delegateToController($controller);
|
||||
return id(new PhabricatorCountdownSearchEngine())
|
||||
->setController($this)
|
||||
->buildResponse();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -61,20 +61,22 @@ final class PhabricatorCountdownViewController
|
|||
|
||||
$add_comment = $this->buildCommentForm($countdown);
|
||||
|
||||
$content = array(
|
||||
$crumbs,
|
||||
$object_box,
|
||||
$countdown_view,
|
||||
$timeline,
|
||||
$add_comment,
|
||||
);
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
$content,
|
||||
array(
|
||||
'title' => $title,
|
||||
'pageObjects' => array($countdown->getPHID()),
|
||||
));
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->setPageObjectPHIDs(
|
||||
array(
|
||||
$countdown->getPHID(),
|
||||
))
|
||||
->appendChild(
|
||||
array(
|
||||
$object_box,
|
||||
$countdown_view,
|
||||
$timeline,
|
||||
$add_comment,
|
||||
));
|
||||
}
|
||||
|
||||
private function buildActionListView(PhabricatorCountdown $countdown) {
|
||||
|
|
Loading…
Add table
Reference in a new issue