mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-03 03:11:01 +01:00
Give application actors in feed reasonable icons
Summary: Ref T8952. Currently, when an application (most commonly Herald, but sometimes Drydock, Diffusion, etc) publishes a feed story, we get an empty grey box for it in feed. Instead, give the story a little application icon kind of "profile picture"-like thing. Test Plan: Here's how it looks: {F1239003} Feel free to tweak/counter-diff. Reviewers: chad Reviewed By: chad Maniphest Tasks: T8952 Differential Revision: https://secure.phabricator.com/D15773
This commit is contained in:
parent
3b154a34c7
commit
df8c3c4fa5
5 changed files with 54 additions and 12 deletions
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
return array(
|
||||
'names' => array(
|
||||
'core.pkg.css' => '31417876',
|
||||
'core.pkg.css' => '04a95108',
|
||||
'core.pkg.js' => '37344f3c',
|
||||
'darkconsole.pkg.js' => 'e7393ebb',
|
||||
'differential.pkg.css' => '7ba78475',
|
||||
|
@ -131,7 +131,7 @@ return array(
|
|||
'rsrc/css/phui/phui-document-pro.css' => '73e45fd2',
|
||||
'rsrc/css/phui/phui-document-summary.css' => '9ca48bdf',
|
||||
'rsrc/css/phui/phui-document.css' => '9c71d2bf',
|
||||
'rsrc/css/phui/phui-feed-story.css' => '04aec08f',
|
||||
'rsrc/css/phui/phui-feed-story.css' => 'd8440402',
|
||||
'rsrc/css/phui/phui-fontkit.css' => '9cda225e',
|
||||
'rsrc/css/phui/phui-form-view.css' => '6a51768e',
|
||||
'rsrc/css/phui/phui-form.css' => 'aac1d51d',
|
||||
|
@ -823,7 +823,7 @@ return array(
|
|||
'phui-document-summary-view-css' => '9ca48bdf',
|
||||
'phui-document-view-css' => '9c71d2bf',
|
||||
'phui-document-view-pro-css' => '73e45fd2',
|
||||
'phui-feed-story-css' => '04aec08f',
|
||||
'phui-feed-story-css' => 'd8440402',
|
||||
'phui-font-icon-base-css' => '6449bce8',
|
||||
'phui-fontkit-css' => '9cda225e',
|
||||
'phui-form-css' => 'aac1d51d',
|
||||
|
|
|
@ -37,8 +37,10 @@ final class PhabricatorApplicationApplicationPHIDType
|
|||
foreach ($handles as $phid => $handle) {
|
||||
$application = $objects[$phid];
|
||||
|
||||
$handle->setName($application->getName());
|
||||
$handle->setURI($application->getApplicationURI());
|
||||
$handle
|
||||
->setName($application->getName())
|
||||
->setURI($application->getApplicationURI())
|
||||
->setIcon($application->getIcon());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -99,8 +99,15 @@ class PhabricatorApplicationTransactionFeedStory
|
|||
}
|
||||
}
|
||||
|
||||
$view->setImage(
|
||||
$this->getHandle($xaction->getAuthorPHID())->getImageURI());
|
||||
$author_phid = $xaction->getAuthorPHID();
|
||||
$author_handle = $this->getHandle($author_phid);
|
||||
$author_image = $author_handle->getImageURI();
|
||||
|
||||
if ($author_image) {
|
||||
$view->setImage($author_image);
|
||||
} else {
|
||||
$view->setAuthorIcon($author_handle->getIcon());
|
||||
}
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ final class PHUIFeedStoryView extends AphrontView {
|
|||
private $actions = array();
|
||||
private $chronologicalKey;
|
||||
private $tags;
|
||||
private $authorIcon;
|
||||
|
||||
public function setTags($tags) {
|
||||
$this->tags = $tags;
|
||||
|
@ -82,6 +83,15 @@ final class PHUIFeedStoryView extends AphrontView {
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function setAuthorIcon($author_icon) {
|
||||
$this->authorIcon = $author_icon;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAuthorIcon() {
|
||||
return $this->authorIcon;
|
||||
}
|
||||
|
||||
public function setTokenBar(array $tokens) {
|
||||
$this->tokenBar = $tokens;
|
||||
return $this;
|
||||
|
@ -163,8 +173,18 @@ final class PHUIFeedStoryView extends AphrontView {
|
|||
$foot = null;
|
||||
|
||||
$actor = new PHUIIconView();
|
||||
$actor->setImage($this->image);
|
||||
$actor->addClass('phui-feed-story-actor-image');
|
||||
$actor->addClass('phui-feed-story-actor');
|
||||
|
||||
$author_icon = $this->getAuthorIcon();
|
||||
|
||||
if ($this->image) {
|
||||
$actor->addClass('phui-feed-story-actor-image');
|
||||
$actor->setImage($this->image);
|
||||
} else if ($author_icon) {
|
||||
$actor->addClass('phui-feed-story-actor-icon');
|
||||
$actor->setIcon($author_icon);
|
||||
}
|
||||
|
||||
if ($this->imageHref) {
|
||||
$actor->setHref($this->imageHref);
|
||||
}
|
||||
|
|
|
@ -10,16 +10,29 @@
|
|||
border: none;
|
||||
}
|
||||
|
||||
.phui-feed-story-head .phui-feed-story-actor-image {
|
||||
.phui-feed-story-head .phui-feed-story-actor {
|
||||
width: 35px;
|
||||
height: 35px;
|
||||
background-size: 35px;
|
||||
float: left;
|
||||
margin-right: 8px;
|
||||
box-shadow: {$borderinset};
|
||||
border-radius: 3px;
|
||||
box-shadow: {$borderinset};
|
||||
}
|
||||
|
||||
.phui-feed-story-head .phui-feed-story-actor-image {
|
||||
background-size: 35px;
|
||||
}
|
||||
|
||||
.phui-feed-story-head .phui-feed-story-actor-icon {
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
font-size: 24px;
|
||||
line-height: 35px;
|
||||
color: {$lightgreytext};
|
||||
background: {$greybackground};
|
||||
}
|
||||
|
||||
|
||||
.phui-feed-story-head {
|
||||
padding: 12px 4px;
|
||||
overflow: hidden;
|
||||
|
|
Loading…
Reference in a new issue