From cf6c3fb41a1661540563cfa7f1471b53cbc5ac91 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Fri, 4 Dec 2015 13:05:29 -0800 Subject: [PATCH] Minor updates to PhameBlogSearch Summary: Use Profile Image, remove skin, show domain info better, add New Post button. Ref T9897 Test Plan: Test new buttons, see new images. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T9897 Differential Revision: https://secure.phabricator.com/D14671 --- .../phame/query/PhameBlogSearchEngine.php | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/src/applications/phame/query/PhameBlogSearchEngine.php b/src/applications/phame/query/PhameBlogSearchEngine.php index 58dba3b810..d006745780 100644 --- a/src/applications/phame/query/PhameBlogSearchEngine.php +++ b/src/applications/phame/query/PhameBlogSearchEngine.php @@ -12,7 +12,8 @@ final class PhameBlogSearchEngine } public function newQuery() { - return new PhameBlogQuery(); + return id(new PhameBlogQuery()) + ->needProfileImage(true); } protected function buildQueryFromParameters(array $map) { @@ -78,22 +79,28 @@ final class PhameBlogSearchEngine $list->setUser($viewer); foreach ($blogs as $blog) { - $archived = false; - $icon = 'fa-star'; - if ($blog->isArchived()) { - $archived = true; - $icon = 'fa-ban'; - } $id = $blog->getID(); + if ($blog->getDomain()) { + $domain = $blog->getDomain(); + } else { + $domain = pht('Local Blog'); + } $item = id(new PHUIObjectItemView()) ->setUser($viewer) ->setObject($blog) ->setHeader($blog->getName()) - ->setStatusIcon($icon) - ->setDisabled($archived) + ->setImageURI($blog->getProfileImageURI()) + ->setDisabled($blog->isArchived()) ->setHref($this->getApplicationURI("/blog/view/{$id}/")) - ->addAttribute($blog->getSkin()) - ->addAttribute($blog->getDomain()); + ->addAttribute($domain); + if (!$blog->isArchived()) { + $button = id(new PHUIButtonView()) + ->setTag('a') + ->setText('New Post') + ->setHref($this->getApplicationURI('/post/edit/?blog='.$id)); + $item->setLaunchButton($button); + } + $list->addItem($item); }