diff --git a/resources/celerity/map.php b/resources/celerity/map.php --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -7,7 +7,7 @@ */ return array( 'names' => array( - 'core.pkg.css' => '9d77cbde', + 'core.pkg.css' => '247930e0', 'core.pkg.js' => '9db3e620', 'darkconsole.pkg.js' => 'e7393ebb', 'differential.pkg.css' => 'bb338e4b', @@ -140,7 +140,7 @@ 'rsrc/css/phui/phui-info-panel.css' => '27ea50a1', 'rsrc/css/phui/phui-info-view.css' => '33e54618', 'rsrc/css/phui/phui-list.css' => 'e448b6ba', - 'rsrc/css/phui/phui-object-box.css' => 'e3441f90', + 'rsrc/css/phui/phui-object-box.css' => 'fc4b0f93', 'rsrc/css/phui/phui-object-item-list-view.css' => 'fef025d8', 'rsrc/css/phui/phui-pinboard-view.css' => '55b27bc3', 'rsrc/css/phui/phui-property-list-view.css' => 'd2d143ea', @@ -776,7 +776,7 @@ 'phui-info-view-css' => '33e54618', 'phui-inline-comment-view-css' => '2174771a', 'phui-list-view-css' => 'e448b6ba', - 'phui-object-box-css' => 'e3441f90', + 'phui-object-box-css' => 'fc4b0f93', 'phui-object-item-list-view-css' => 'fef025d8', 'phui-pinboard-view-css' => '55b27bc3', 'phui-property-list-view-css' => 'd2d143ea', diff --git a/src/applications/search/controller/PhabricatorApplicationSearchController.php b/src/applications/search/controller/PhabricatorApplicationSearchController.php --- a/src/applications/search/controller/PhabricatorApplicationSearchController.php +++ b/src/applications/search/controller/PhabricatorApplicationSearchController.php @@ -174,32 +174,11 @@ // we sort out T5307. $form->appendChild($submit); - $filter_view = id(new AphrontListFilterView())->appendChild($form); - - if ($run_query && $named_query) { - if ($named_query->getIsBuiltin()) { - $description = pht( - 'Showing results for query "%s".', - $named_query->getQueryName()); - } else { - $description = pht( - 'Showing results for saved query "%s".', - $named_query->getQueryName()); - } - - $filter_view->setCollapsed( - pht('Edit Query...'), - pht('Hide Query'), - $description, - $this->getApplicationURI('query/advanced/?query='.$query_key)); - } if ($this->getPreface()) { $nav->appendChild($this->getPreface()); } - $nav->appendChild($filter_view); - if ($named_query) { $title = $named_query->getQueryName(); } else { @@ -207,9 +186,8 @@ } if ($run_query) { - $nav->appendChild( - $anchor = id(new PhabricatorAnchorView()) - ->setAnchorName('R')); + $anchor = id(new PhabricatorAnchorView()) + ->setAnchorName('R'); try { $query = $engine->buildQueryFromSavedQuery($saved_query); @@ -234,7 +212,14 @@ } $box = id(new PHUIObjectBoxView()) - ->setHeaderText($title); + ->setHeaderText($title) + ->setAnchor($anchor); + + $box->setShowHide( + pht('Edit Query'), + pht('Hide Query'), + $form, + $this->getApplicationURI('query/advanced/?query='.$query_key)); if ($list instanceof AphrontTableView) { $box->setTable($list); @@ -246,7 +231,6 @@ // TODO: This is a bit hacky. if ($list instanceof PHUIObjectItemListView) { $list->setNoDataString(pht('No results found for this query.')); - $list->setPager($pager); } else { if ($pager->willShowPagingControls()) { $pager_box = id(new PHUIBoxView()) diff --git a/src/view/phui/PHUIObjectBoxView.php b/src/view/phui/PHUIObjectBoxView.php --- a/src/view/phui/PHUIObjectBoxView.php +++ b/src/view/phui/PHUIObjectBoxView.php @@ -18,6 +18,12 @@ private $objectList; private $table; private $collapsed = false; + private $anchor; + + private $showAction; + private $hideAction; + private $showHideHref; + private $showHideContent; private $tabs = array(); private $propertyLists = array(); @@ -162,6 +168,19 @@ return $this; } + public function setAnchor(PhabricatorAnchorView $anchor) { + $this->anchor = $anchor; + return $this; + } + + public function setShowHide($show, $hide, $content, $href) { + $this->showAction = $show; + $this->hideAction = $hide; + $this->showHideContent = $content; + $this->showHideHref = $href; + return $this; + } + public function setValidationException( PhabricatorApplicationTransactionValidationException $ex = null) { $this->validationException = $ex; @@ -178,6 +197,55 @@ ->setHeader($this->headerText); } + $showhide = null; + if ($this->showAction !== null) { + Javelin::initBehavior('phabricator-reveal-content'); + + $hide_action_id = celerity_generate_unique_node_id(); + $show_action_id = celerity_generate_unique_node_id(); + $content_id = celerity_generate_unique_node_id(); + + $hide_action = id(new PHUIButtonView()) + ->setTag('a') + ->addSigil('reveal-content') + ->setID($hide_action_id) + ->setHref($this->showHideHref) + ->setMetaData( + array( + 'hideIDs' => array($hide_action_id), + 'showIDs' => array($content_id, $show_action_id), + )) + ->setText($this->showAction); + + $show_action = id(new PHUIButtonView()) + ->setTag('a') + ->addSigil('reveal-content') + ->setStyle('display: none;') + ->setHref('#') + ->setID($show_action_id) + ->setMetaData( + array( + 'hideIDs' => array($content_id, $show_action_id), + 'showIDs' => array($hide_action_id), + )) + ->setText($this->hideAction); + + $header->addActionLink($hide_action); + $header->addActionLink($show_action); + + $showhide = array( + phutil_tag( + 'div', + array( + 'class' => 'phui-object-box-hidden-content', + 'id' => $content_id, + 'style' => 'display: none;', + ), + $this->showHideContent), + ); + } + + if ($this->actionListID) { $icon_id = celerity_generate_unique_node_id(); $icon = id(new PHUIIconView()) @@ -284,6 +352,7 @@ $content = id(new PHUIBoxView()) ->appendChild( array( + $this->anchor, $header, $this->infoView, $this->formErrors, @@ -292,6 +361,7 @@ $this->form, $tabs, $tab_lists, + $showhide, $property_lists, $this->table, $this->renderChildren(), diff --git a/webroot/rsrc/css/phui/phui-object-box.css b/webroot/rsrc/css/phui/phui-object-box.css --- a/webroot/rsrc/css/phui/phui-object-box.css +++ b/webroot/rsrc/css/phui/phui-object-box.css @@ -90,6 +90,12 @@ border-bottom-color: {$lightred}; } +.phui-object-box-hidden-content { + background: {$lightgreybackground}; + border-bottom: 1px solid {$thinblueborder}; + margin-bottom: 4px; +} + /* - Double Object Box Override --------------------------------------------- */ .phui-object-box .phui-object-box {