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

Allow images to be used with PHUIBigInfoView

Summary: Allows setting on an image here if wanted.

Test Plan: Set a rocket to launch a new instance on rSAAS

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D18334
This commit is contained in:
Chad Little 2017-08-03 17:18:30 -07:00
parent 020f3c729a
commit 7621376aab
3 changed files with 41 additions and 11 deletions

View file

@ -142,7 +142,7 @@ return array(
'rsrc/css/phui/phui-action-panel.css' => 'b4798122',
'rsrc/css/phui/phui-badge.css' => '22c0cf4f',
'rsrc/css/phui/phui-basic-nav-view.css' => 'a0705f53',
'rsrc/css/phui/phui-big-info-view.css' => 'd13afcde',
'rsrc/css/phui/phui-big-info-view.css' => 'acc3492c',
'rsrc/css/phui/phui-box.css' => '745e881d',
'rsrc/css/phui/phui-chart.css' => '6bf6f78e',
'rsrc/css/phui/phui-cms.css' => '504b4b23',
@ -821,7 +821,7 @@ return array(
'phui-action-panel-css' => 'b4798122',
'phui-badge-view-css' => '22c0cf4f',
'phui-basic-nav-view-css' => 'a0705f53',
'phui-big-info-view-css' => 'd13afcde',
'phui-big-info-view-css' => 'acc3492c',
'phui-box-css' => '745e881d',
'phui-button-bar-css' => 'f1ff5494',
'phui-button-css' => '3ca51caa',

View file

@ -5,6 +5,7 @@ final class PHUIBigInfoView extends AphrontTagView {
private $icon;
private $title;
private $description;
private $image;
private $actions = array();
public function setIcon($icon) {
@ -22,6 +23,11 @@ final class PHUIBigInfoView extends AphrontTagView {
return $this;
}
public function setImage($image) {
$this->image = $image;
return $this;
}
public function addAction(PHUIButtonView $button) {
$this->actions[] = $button;
return $this;
@ -43,16 +49,33 @@ final class PHUIBigInfoView extends AphrontTagView {
protected function getTagContent() {
require_celerity_resource('phui-big-info-view-css');
$icon = id(new PHUIIconView())
->setIcon($this->icon)
->addClass('phui-big-info-icon');
if ($this->icon) {
$icon = id(new PHUIIconView())
->setIcon($this->icon)
->addClass('phui-big-info-icon');
$icon = phutil_tag(
'div',
array(
'class' => 'phui-big-info-icon-container',
),
$icon);
$icon = phutil_tag(
'div',
array(
'class' => 'phui-big-info-icon-container',
),
$icon);
}
if ($this->image) {
$image = phutil_tag(
'img',
array(
'class' => 'phui-big-info-image',
'src' => $this->image,
));
$icon = phutil_tag(
'span',
array(
'class' => 'phui-big-info-icon-container',
),
$image);
}
$title = phutil_tag(
'div',

View file

@ -35,3 +35,10 @@
.phui-big-info-button + .phui-big-info-button {
margin-left: 12px;
}
.phui-big-info-view .phui-big-info-image {
height: 64px;
width: 64px;
margin: 0 auto;
padding-bottom: 12px;
}