1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-05 03:18:25 +01:00

Based hovercards on ActionHeader

Summary: Refs T1048 - Makes it look //way// better

Test Plan: {F39347}

Reviewers: chad, epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1048

Differential Revision: https://secure.phabricator.com/D5587
This commit is contained in:
Anh Nhan Nguyen 2013-04-05 08:21:01 -07:00 committed by epriestley
parent 576804f67f
commit 9f42bd7912
4 changed files with 24 additions and 27 deletions

View file

@ -3029,7 +3029,7 @@ celerity_register_resource_map(array(
),
'phabricator-hovercard-view-css' =>
array(
'uri' => '/res/061e66df/rsrc/css/layout/phabricator-hovercard-view.css',
'uri' => '/res/68d69a87/rsrc/css/layout/phabricator-hovercard-view.css',
'type' => 'css',
'requires' =>
array(

View file

@ -93,6 +93,7 @@ final class ManiphestHovercardEventListener extends PhutilEventListener {
}
$hovercard->addTag(ManiphestView::renderTagForTask($task));
$hovercard->setColor(PhabricatorActionHeaderView::HEADER_BLUE);
$event->setValue('hovercard', $hovercard);
}

View file

@ -17,7 +17,7 @@ final class PhabricatorHovercardView extends AphrontView {
private $fields = array();
private $actions = array();
private $color = 'grey';
private $color = 'green';
public function setObjectHandle(PhabricatorObjectHandle $handle) {
$this->handle = $handle;
@ -70,21 +70,19 @@ final class PhabricatorHovercardView extends AphrontView {
require_celerity_resource("phabricator-hovercard-view-css");
$title = array();
if ($this->tags) {
$title[] = ' ';
$title[] = phutil_tag(
'span',
array(
'class' => 'phabricator-hovercard-tags',
),
array_interleave(' ', $this->tags));
}
$title[] = pht("%s: %s",
$title = pht("%s: %s",
$handle->getTypeName(),
$this->title ? $this->title : $handle->getName());
$header = new PhabricatorActionHeaderView();
$header->setHeaderColor($this->color);
$header->setHeaderTitle($title);
if ($this->tags) {
foreach ($this->tags as $tag) {
$header->setTag($tag);
}
}
$body = array();
if ($this->detail) {
$body[] = hsprintf('<strong>%s</strong>', $this->detail);
@ -146,8 +144,16 @@ final class PhabricatorHovercardView extends AphrontView {
// TODO: Add color support
$content = hsprintf(
'%s%s%s',
phutil_tag('div', array('class' => 'phabricator-hovercard-head'), $title),
phutil_tag('div', array('class' => 'phabricator-hovercard-body'), $body),
phutil_tag('div',
array(
'class' => 'phabricator-hovercard-head'
),
$header),
phutil_tag('div',
array(
'class' => 'phabricator-hovercard-body'
),
$body),
$tail);
$hovercard = phutil_tag("div",

View file

@ -19,19 +19,9 @@
border: 1px solid #666666;
}
.phabricator-hovercard-head {
padding: 10px 15px;
font-weight: bold;
font-size: 15px;
white-space: nowrap;
color: white;
text-shadow: 0 1px 0 #333333;
font-weight: bold;
.phabricator-hovercard-head .phabricator-action-header {
border-top-left-radius: 2px;
border-top-right-radius: 2px;
overflow: hidden;
background-color: #559911;
}
.phabricator-hovercard-tags {