Add ImageView to PropertyListView
Summary: Adds imageview (dark background) to Files and Macro. Test Plan: Test a file and a macro, see darkness. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D5131
This commit is contained in:
@@ -2924,7 +2924,7 @@ celerity_register_resource_map(array(
|
|||||||
),
|
),
|
||||||
'phabricator-property-list-view-css' =>
|
'phabricator-property-list-view-css' =>
|
||||||
array(
|
array(
|
||||||
'uri' => '/res/cd84ee5a/rsrc/css/layout/phabricator-property-list-view.css',
|
'uri' => '/res/dfee0687/rsrc/css/layout/phabricator-property-list-view.css',
|
||||||
'type' => 'css',
|
'type' => 'css',
|
||||||
'requires' =>
|
'requires' =>
|
||||||
array(
|
array(
|
||||||
|
|||||||
@@ -146,9 +146,6 @@ final class PhabricatorFileInfoController extends PhabricatorFileController {
|
|||||||
|
|
||||||
if ($file->isViewableImage()) {
|
if ($file->isViewableImage()) {
|
||||||
|
|
||||||
// TODO: Clean this up after Pholio (dark backgrounds, standardization,
|
|
||||||
// etc.)
|
|
||||||
|
|
||||||
$image = phutil_tag(
|
$image = phutil_tag(
|
||||||
'img',
|
'img',
|
||||||
array(
|
array(
|
||||||
@@ -163,7 +160,7 @@ final class PhabricatorFileInfoController extends PhabricatorFileController {
|
|||||||
),
|
),
|
||||||
$image);
|
$image);
|
||||||
|
|
||||||
$view->addTextContent($linked_image);
|
$view->addImageContent($linked_image);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $view;
|
return $view;
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ final class PhabricatorMacroViewController
|
|||||||
$sub_view);
|
$sub_view);
|
||||||
|
|
||||||
if ($file) {
|
if ($file) {
|
||||||
$view->addTextContent(
|
$view->addImageContent(
|
||||||
phutil_tag(
|
phutil_tag(
|
||||||
'img',
|
'img',
|
||||||
array(
|
array(
|
||||||
|
|||||||
@@ -59,6 +59,14 @@ final class PhabricatorPropertyListView extends AphrontView {
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function addImageContent($content) {
|
||||||
|
$this->parts[] = array(
|
||||||
|
'type' => 'image',
|
||||||
|
'content' => $content,
|
||||||
|
);
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
public function invokeWillRenderEvent() {
|
public function invokeWillRenderEvent() {
|
||||||
if ($this->object && $this->getUser() && !$this->invokedWillRenderEvent) {
|
if ($this->object && $this->getUser() && !$this->invokedWillRenderEvent) {
|
||||||
$event = new PhabricatorEvent(
|
$event = new PhabricatorEvent(
|
||||||
@@ -91,6 +99,7 @@ final class PhabricatorPropertyListView extends AphrontView {
|
|||||||
$items[] = $this->renderSectionPart($part);
|
$items[] = $this->renderSectionPart($part);
|
||||||
break;
|
break;
|
||||||
case 'text':
|
case 'text':
|
||||||
|
case 'image':
|
||||||
$items[] = $this->renderTextPart($part);
|
$items[] = $this->renderTextPart($part);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -166,10 +175,15 @@ final class PhabricatorPropertyListView extends AphrontView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function renderTextPart(array $part) {
|
private function renderTextPart(array $part) {
|
||||||
|
$classes = array();
|
||||||
|
$classes[] = 'phabricator-property-list-text-content';
|
||||||
|
if ($part['type'] == 'image') {
|
||||||
|
$classes[] = 'phabricator-property-list-image-content';
|
||||||
|
}
|
||||||
return phutil_tag(
|
return phutil_tag(
|
||||||
'div',
|
'div',
|
||||||
array(
|
array(
|
||||||
'class' => 'phabricator-property-list-text-content',
|
'class' => implode($classes, ' '),
|
||||||
),
|
),
|
||||||
$part['content']);
|
$part['content']);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,6 +93,10 @@
|
|||||||
border-bottom: 1px solid #dbdbdb;
|
border-bottom: 1px solid #dbdbdb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.phabricator-property-list-image-content {
|
||||||
|
background: #282828;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* In the common case where we immediately follow a header, move back up 30px
|
/* In the common case where we immediately follow a header, move back up 30px
|
||||||
so we snuggle next to the header. */
|
so we snuggle next to the header. */
|
||||||
|
|||||||
Reference in New Issue
Block a user