mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 00:42:41 +01:00
In standard property lists, render projects with tag UIs
Summary: Ref T2628. There are a few UIs that need updates, but generally I want to show project icons everywhere that we show project names, to more strongly reinforce the ideas of projects being groups/tags/policies/etc. Test Plan: See screenshot. Reviewers: chad Reviewed By: chad Subscribers: epriestley Maniphest Tasks: T2628 Differential Revision: https://secure.phabricator.com/D9709
This commit is contained in:
parent
e4d38592ce
commit
38ae1191de
3 changed files with 28 additions and 2 deletions
|
@ -30,6 +30,10 @@ final class PhabricatorObjectHandle
|
|||
return $this->getTypeIcon();
|
||||
}
|
||||
|
||||
public function getIconColor() {
|
||||
return 'bluegrey';
|
||||
}
|
||||
|
||||
public function getTypeIcon() {
|
||||
if ($this->getPHIDType()) {
|
||||
return $this->getPHIDType()->getTypeIcon();
|
||||
|
@ -255,6 +259,14 @@ final class PhabricatorObjectHandle
|
|||
array($icon, $name));
|
||||
}
|
||||
|
||||
public function renderTag() {
|
||||
return id(new PHUITagView())
|
||||
->setType(PHUITagView::TYPE_OBJECT)
|
||||
->setIcon($this->getIcon().' '.$this->getIconColor())
|
||||
->setHref($this->getURI())
|
||||
->setName($this->getLinkName());
|
||||
}
|
||||
|
||||
public function getLinkName() {
|
||||
switch ($this->getType()) {
|
||||
case PhabricatorPeoplePHIDTypeUser::TYPECONST:
|
||||
|
|
|
@ -45,9 +45,19 @@ final class PhabricatorProjectUIEventListener
|
|||
if ($handles) {
|
||||
$list = array();
|
||||
foreach ($handles as $handle) {
|
||||
$list[] = $handle->renderLink();
|
||||
$list[] = phutil_tag(
|
||||
'li',
|
||||
array(
|
||||
'class' => 'phabricator-handle-tag-list-item',
|
||||
),
|
||||
$handle->renderTag());
|
||||
}
|
||||
$list = phutil_implode_html(phutil_tag('br'), $list);
|
||||
$list = phutil_tag(
|
||||
'ul',
|
||||
array(
|
||||
'class' => 'phabricator-handle-tag-list',
|
||||
),
|
||||
$list);
|
||||
} else {
|
||||
$list = phutil_tag('em', array(), pht('None'));
|
||||
}
|
||||
|
|
|
@ -300,3 +300,7 @@ a.phui-tag-view:hover.phui-tag-shade-checkered .phui-tag-core {
|
|||
a.phui-tag-view:hover.phui-tag-shade-disabled .phui-tag-core {
|
||||
border-color: {$sh-disabledborder};
|
||||
}
|
||||
|
||||
.phabricator-handle-tag-list-item + .phabricator-handle-tag-list-item {
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue