diff --git a/src/applications/maniphest/controller/tasklist/ManiphestTaskListController.php b/src/applications/maniphest/controller/tasklist/ManiphestTaskListController.php
index f8bcc2744f..364300c1cc 100644
--- a/src/applications/maniphest/controller/tasklist/ManiphestTaskListController.php
+++ b/src/applications/maniphest/controller/tasklist/ManiphestTaskListController.php
@@ -33,7 +33,6 @@ class ManiphestTaskListController extends ManiphestController {
$request = $this->getRequest();
$user = $request->getUser();
- $uri = $request->getRequestURI();
if ($request->isFormPost()) {
// Redirect to GET so URIs can be copy/pasted.
@@ -55,23 +54,21 @@ class ManiphestTaskListController extends ManiphestController {
return id(new AphrontRedirectResponse())->setURI($uri);
}
- $views = array(
- 'User Tasks',
- 'action' => 'Assigned',
- 'created' => 'Created',
- 'subscribed' => 'Subscribed',
- 'triage' => 'Need Triage',
- '
',
- 'All Tasks',
- 'alltriage' => 'Need Triage',
- 'all' => 'All Tasks',
- '
',
- 'custom' => 'Custom',
- );
+ $nav = new AphrontSideNavFilterView();
+ $nav->setBaseURI(new PhutilURI('/maniphest/view/'));
+ $nav->addLabel('User Tasks');
+ $nav->addFilter('action', 'Assigned');
+ $nav->addFilter('created', 'Created');
+ $nav->addFilter('subscribed', 'Subscribed');
+ $nav->addFilter('triage', 'Need Triage');
+ $nav->addSpacer();
+ $nav->addLabel('All Tasks');
+ $nav->addFilter('alltriage', 'Need Triage');
+ $nav->addFilter('all', 'All Tasks');
+ $nav->addSpacer();
+ $nav->addFilter('custom', 'Custom');
- if (empty($views[$this->view])) {
- $this->view = 'action';
- }
+ $this->view = $nav->selectFilter($this->view, 'action');
$has_filter = array(
'action' => true,
@@ -80,29 +77,6 @@ class ManiphestTaskListController extends ManiphestController {
'triage' => true,
);
- $nav = new AphrontSideNavView();
- foreach ($views as $view => $name) {
- if (is_integer($view)) {
- $nav->addNavItem(
- phutil_render_tag(
- 'span',
- array(),
- $name));
- } else {
- $uri->setPath('/maniphest/view/'.$view.'/');
- $nav->addNavItem(
- phutil_render_tag(
- 'a',
- array(
- 'href' => $uri->alter('page', null),
- 'class' => ($this->view == $view)
- ? 'aphront-side-nav-selected'
- : null,
- ),
- phutil_escape_html($name)));
- }
- }
-
list($status_map, $status_links) = $this->renderStatusLinks();
list($grouping, $group_links) = $this->renderGroupLinks();
list($order, $order_links) = $this->renderOrderLinks();
diff --git a/src/applications/maniphest/controller/tasklist/__init__.php b/src/applications/maniphest/controller/tasklist/__init__.php
index 4d1fd93445..ac7a65b8da 100644
--- a/src/applications/maniphest/controller/tasklist/__init__.php
+++ b/src/applications/maniphest/controller/tasklist/__init__.php
@@ -21,7 +21,7 @@ phutil_require_module('phabricator', 'view/form/control/text');
phutil_require_module('phabricator', 'view/form/control/togglebuttons');
phutil_require_module('phabricator', 'view/form/control/tokenizer');
phutil_require_module('phabricator', 'view/layout/listfilter');
-phutil_require_module('phabricator', 'view/layout/sidenav');
+phutil_require_module('phabricator', 'view/layout/sidenavfilter');
phutil_require_module('phutil', 'markup');
phutil_require_module('phutil', 'parser/uri');