diff --git a/src/__celerity_resource_map__.php b/src/__celerity_resource_map__.php index 3a7830ad08..0a072a6af5 100644 --- a/src/__celerity_resource_map__.php +++ b/src/__celerity_resource_map__.php @@ -884,7 +884,7 @@ celerity_register_resource_map(array( ), 'phabricator-core-buttons-css' => array( - 'uri' => '/res/f797baf5/rsrc/css/core/buttons.css', + 'uri' => '/res/3059cf79/rsrc/css/core/buttons.css', 'type' => 'css', 'requires' => array( @@ -1048,7 +1048,7 @@ celerity_register_resource_map(array( 'uri' => '/res/pkg/613cf273/differential.pkg.css', 'type' => 'css', ), - 'a6102fe7' => + 'c9c3eee2' => array ( 'name' => 'core.pkg.css', 'symbols' => @@ -1069,7 +1069,7 @@ celerity_register_resource_map(array( 13 => 'phabricator-remarkup-css', 14 => 'syntax-highlighting-css', ), - 'uri' => '/res/pkg/a6102fe7/core.pkg.css', + 'uri' => '/res/pkg/c9c3eee2/core.pkg.css', 'type' => 'css', ), 'db95a6d0' => @@ -1108,15 +1108,15 @@ celerity_register_resource_map(array( ), 'reverse' => array ( - 'aphront-crumbs-view-css' => 'a6102fe7', - 'aphront-dialog-view-css' => 'a6102fe7', - 'aphront-form-view-css' => 'a6102fe7', - 'aphront-list-filter-view-css' => 'a6102fe7', - 'aphront-panel-view-css' => 'a6102fe7', - 'aphront-side-nav-view-css' => 'a6102fe7', - 'aphront-table-view-css' => 'a6102fe7', - 'aphront-tokenizer-control-css' => 'a6102fe7', - 'aphront-typeahead-control-css' => 'a6102fe7', + 'aphront-crumbs-view-css' => 'c9c3eee2', + 'aphront-dialog-view-css' => 'c9c3eee2', + 'aphront-form-view-css' => 'c9c3eee2', + 'aphront-list-filter-view-css' => 'c9c3eee2', + 'aphront-panel-view-css' => 'c9c3eee2', + 'aphront-side-nav-view-css' => 'c9c3eee2', + 'aphront-table-view-css' => 'c9c3eee2', + 'aphront-tokenizer-control-css' => 'c9c3eee2', + 'aphront-typeahead-control-css' => 'c9c3eee2', 'differential-changeset-view-css' => '613cf273', 'differential-core-view-css' => '613cf273', 'differential-revision-add-comment-css' => '613cf273', @@ -1151,11 +1151,11 @@ celerity_register_resource_map(array( 'javelin-util' => 'db95a6d0', 'javelin-vector' => 'db95a6d0', 'javelin-workflow' => '122a6b6d', - 'phabricator-core-buttons-css' => 'a6102fe7', - 'phabricator-core-css' => 'a6102fe7', - 'phabricator-directory-css' => 'a6102fe7', - 'phabricator-remarkup-css' => 'a6102fe7', - 'phabricator-standard-page-view' => 'a6102fe7', - 'syntax-highlighting-css' => 'a6102fe7', + 'phabricator-core-buttons-css' => 'c9c3eee2', + 'phabricator-core-css' => 'c9c3eee2', + 'phabricator-directory-css' => 'c9c3eee2', + 'phabricator-remarkup-css' => 'c9c3eee2', + 'phabricator-standard-page-view' => 'c9c3eee2', + 'syntax-highlighting-css' => 'c9c3eee2', ), )); diff --git a/src/applications/maniphest/controller/tasklist/ManiphestTaskListController.php b/src/applications/maniphest/controller/tasklist/ManiphestTaskListController.php index 2966a61065..70567184eb 100644 --- a/src/applications/maniphest/controller/tasklist/ManiphestTaskListController.php +++ b/src/applications/maniphest/controller/tasklist/ManiphestTaskListController.php @@ -301,73 +301,26 @@ class ManiphestTaskListController extends ManiphestController { public function renderStatusLinks() { $request = $this->getRequest(); - $sel = array( - 'open' => false, - 'closed' => false, + $statuses = array( + 'o' => array('open' => true), + 'c' => array('closed' => true), + 'oc' => array('open' => true, 'closed' => true), ); $status = $request->getStr('s'); - if ($status == 'c') { - $sel['closed'] = true; - } else if ($status == 'oc') { - $sel['closed'] = true; - $sel['open'] = true; - } else { - $sel['open'] = true; + if (empty($statuses[$status])) { + $status = 'o'; } - $just_one = (count(array_filter($sel)) == 1); - - $flag_map = array( - 'Open' => 'open', - 'Closed' => 'closed', - ); $button_names = array( 'Open' => 'o', 'Closed' => 'c', + 'All' => 'oc', ); - $base_flags = array(); - foreach ($flag_map as $name => $key) { - $base_flags[$button_names[$name]] = $sel[$key]; - } + $status_links = $this->renderFilterLinks($button_names, $status, 's'); - foreach ($button_names as $name => $letter) { - $flags = $base_flags; - $flags[$letter] = !$flags[$letter]; - $button_names[$name] = implode('', array_keys(array_filter($flags))); - } - - $uri = $request->getRequestURI(); - - $links = array(); - foreach ($button_names as $name => $value) { - $selected = $sel[$flag_map[$name]]; - $fixed = ($selected && $just_one); - - $more = null; - if ($fixed) { - $href = null; - $more .= ' toggle-fixed'; - } else { - $href = $uri->alter('s', $value); - } - - if ($selected) { - $more .= ' toggle-selected'; - } - - $links[] = phutil_render_tag( - 'a', - array( - 'href' => $href, - 'class' => 'toggle'.$more, - ), - $name); - } - $status_links = implode("\n", $links); - - return array($sel, $status_links); + return array($statuses[$status], $status_links); } public function renderOrderLinks() { @@ -390,26 +343,7 @@ class ManiphestTaskListController extends ManiphestController { 'Created' => 'c', ); - $uri = $request->getRequestURI(); - - $links = array(); - foreach ($order_names as $name => $param_key) { - if ($param_key == $order) { - $more = ' toggle-selected toggle-fixed'; - $href = null; - } else { - $more = null; - $href = $uri->alter('o', $param_key); - } - $links[] = phutil_render_tag( - 'a', - array( - 'class' => 'toggle'.$more, - 'href' => $href, - ), - $name); - } - $order_links = implode("\n", $links); + $order_links = $this->renderFilterLinks($order_names, $order, 'o'); return array($order_by, $order_links); } @@ -436,16 +370,23 @@ class ManiphestTaskListController extends ManiphestController { 'None' => 'n', ); + $group_links = $this->renderFilterLinks($group_names, $group, 'g'); + + return array($group_by, $group_links); + } + + private function renderFilterLinks($filter_map, $selected, $uri_param) { + $request = $this->getRequest(); $uri = $request->getRequestURI(); $links = array(); - foreach ($group_names as $name => $param_key) { - if ($param_key == $group) { + foreach ($filter_map as $name => $value) { + if ($value == $selected) { $more = ' toggle-selected toggle-fixed'; $href = null; } else { $more = null; - $href = $uri->alter('g', $param_key); + $href = $uri->alter($uri_param, $value); } $links[] = phutil_render_tag( 'a', @@ -455,10 +396,7 @@ class ManiphestTaskListController extends ManiphestController { ), $name); } - $group_links = implode("\n", $links); - - return array($group_by, $group_links); + return implode("\n", $links); } - } diff --git a/webroot/rsrc/css/core/buttons.css b/webroot/rsrc/css/core/buttons.css index 809f7eb855..2288ebf5df 100644 --- a/webroot/rsrc/css/core/buttons.css +++ b/webroot/rsrc/css/core/buttons.css @@ -161,7 +161,7 @@ a.toggle { padding: 2px 6px 3px; font-weight: bold; margin-right: 4px; - color: #333333; + color: #777777; border-radius: 8px; -moz-border-radius: 8px; -webkit-border-radius: 8px;