Page MenuHomePhabricator

D11948.diff
No OneTemporary

D11948.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -100,7 +100,7 @@
'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 @@
'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
--- a/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php
+++ b/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php
@@ -251,33 +251,24 @@
->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
--- a/src/applications/search/view/PhabricatorSearchResultView.php
+++ b/src/applications/search/view/PhabricatorSearchResultView.php
@@ -27,53 +27,26 @@
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(
- '<div class="phabricator-search-result">'.
- '%s'.
- '<div class="result-desc">'.
- '%s'.
- '<div class="result-type">%s &middot; %s</div>'.
- '</div>'.
- '<div style="clear: both;"></div>'.
- '</div>',
- $img,
- phutil_tag(
- 'a',
- array(
- 'class' => 'result-name',
- 'href' => $handle->getURI(),
- ),
- $title),
- $type_name,
- $link);
+ $item = id(new PHUIObjectItemView())
+ ->setHeader($title)
+ ->setHref($handle->getURI())
+ ->setImageURI($handle->getImageURI())
+ ->addAttribute($type_name);
+
+ if ($handle->getStatus() == PhabricatorObjectHandleStatus::STATUS_CLOSED) {
+ $item->setDisabled(true);
+ $item->addAttribute(pht('Closed'));
+ }
+
+ return $item;
}
diff --git a/webroot/rsrc/css/application/search/search-results.css b/webroot/rsrc/css/application/search/search-results.css
--- a/webroot/rsrc/css/application/search/search-results.css
+++ b/webroot/rsrc/css/application/search/search-results.css
@@ -2,36 +2,9 @@
* @provides phabricator-search-results-css
*/
-.phabricator-search-result {
- margin: 4px 0 16px;
-}
-
-.device-phone .phabricator-search-result-box .phui-box {
- margin: 20px 0;
-}
-
-.phabricator-search-result .result-image {
- position: relative;
- float: left;
- width: 50px;
- height: 50px;
- margin-right: 10px;
-}
-
-.phabricator-search-result .result-type {
- margin-top: 4px;
- word-break: break-word;
-}
-
-.phabricator-search-result .result-name {
- font-size: 16px;
-}
-
-.search-results-pager .aphront-pager-view {
- text-align: center;
-}
-
-.phabricator-search-no-results {
- color: {$lightgreytext};
- font-size: 18px;
+.phui-object-item-link strong {
+ background-color: {$lightyellow};
+ color: black;
+ padding: 0 4px;
+ border-radius: 3px;
}

File Metadata

Mime Type
text/plain
Expires
Mon, Oct 21, 9:12 AM (3 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6708853
Default Alt Text
D11948.diff (5 KB)

Event Timeline