diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 67202eb7d1..35ffa85e1e 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -100,7 +100,7 @@ return array( 'rsrc/css/application/releeph/releeph-preview-branch.css' => 'b7a6f4a5', 'rsrc/css/application/releeph/releeph-request-differential-create-dialog.css' => '8d8b92cd', 'rsrc/css/application/releeph/releeph-request-typeahead.css' => '667a48ae', - 'rsrc/css/application/search/search-results.css' => 'f240504c', + 'rsrc/css/application/search/search-results.css' => '559cc554', 'rsrc/css/application/slowvote/slowvote.css' => '266df6a1', 'rsrc/css/application/tokens/tokens.css' => '3d0f239e', 'rsrc/css/application/uiexample/example.css' => '528b19de', @@ -738,7 +738,7 @@ return array( 'phabricator-prefab' => '72da38cc', 'phabricator-profile-css' => '1a20dcbf', 'phabricator-remarkup-css' => '2dbff225', - 'phabricator-search-results-css' => 'f240504c', + 'phabricator-search-results-css' => '559cc554', 'phabricator-shaped-request' => '7cbe244b', 'phabricator-side-menu-view-css' => '7e8c6341', 'phabricator-slowvote-css' => '266df6a1', diff --git a/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php b/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php index 5b1e79cc2f..0e13f9ffea 100644 --- a/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php +++ b/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php @@ -251,33 +251,24 @@ final class PhabricatorSearchApplicationSearchEngine ->withPHIDs(mpull($results, 'getPHID')) ->execute(); - $output = array(); + $list = new PHUIObjectItemListView(); foreach ($results as $phid => $handle) { $view = id(new PhabricatorSearchResultView()) ->setHandle($handle) ->setQuery($query) - ->setObject(idx($objects, $phid)); - $output[] = $view->render(); + ->setObject(idx($objects, $phid)) + ->render(); + $list->addItem($view); } - $results = phutil_tag_div( - 'phabricator-search-result-list', - $output); + $results = $list; } else { - $results = phutil_tag_div( - 'phabricator-search-result-list', - phutil_tag( - 'p', - array('class' => 'phabricator-search-no-results'), - pht('No search results.'))); + $results = id(new PHUIInfoView()) + ->appendChild(pht('No results returned for that query.')) + ->setSeverity(PHUIInfoView::SEVERITY_NODATA); } - return id(new PHUIBoxView()) - ->addMargin(PHUI::MARGIN_LARGE) - ->addPadding(PHUI::PADDING_LARGE) - ->setBorder(true) - ->appendChild($results) - ->addClass('phabricator-search-result-box'); + return $results; } } diff --git a/src/applications/search/view/PhabricatorSearchResultView.php b/src/applications/search/view/PhabricatorSearchResultView.php index 94cbbfaf78..9586150b5e 100644 --- a/src/applications/search/view/PhabricatorSearchResultView.php +++ b/src/applications/search/view/PhabricatorSearchResultView.php @@ -27,53 +27,26 @@ final class PhabricatorSearchResultView extends AphrontView { return; } - $type_name = nonempty($handle->getTypeName(), 'Document'); - require_celerity_resource('phabricator-search-results-css'); - $link = phutil_tag( - 'a', - array( - 'href' => $handle->getURI(), - ), - PhabricatorEnv::getProductionURI($handle->getURI())); - - $img = $handle->getImageURI(); - - if ($img) { - $img = phutil_tag( - 'div', - array( - 'class' => 'result-image', - 'style' => "background-image: url('{$img}');", - ), - ''); - } + $type_name = nonempty($handle->getTypeName(), pht('Document')); $title = $this->emboldenQuery($handle->getFullName()); if ($handle->getStatus() == PhabricatorObjectHandleStatus::STATUS_CLOSED) { - $title = phutil_tag('del', array(), $title); } - return hsprintf( - '