1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 22:10:55 +01:00

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
This commit is contained in:
Chad Little 2015-12-04 13:05:29 -08:00
parent ef820ed1ee
commit cf6c3fb41a

View file

@ -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);
}