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' =>
|
||||
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',
|
||||
'requires' =>
|
||||
array(
|
||||
|
||||
@@ -146,9 +146,6 @@ final class PhabricatorFileInfoController extends PhabricatorFileController {
|
||||
|
||||
if ($file->isViewableImage()) {
|
||||
|
||||
// TODO: Clean this up after Pholio (dark backgrounds, standardization,
|
||||
// etc.)
|
||||
|
||||
$image = phutil_tag(
|
||||
'img',
|
||||
array(
|
||||
@@ -163,7 +160,7 @@ final class PhabricatorFileInfoController extends PhabricatorFileController {
|
||||
),
|
||||
$image);
|
||||
|
||||
$view->addTextContent($linked_image);
|
||||
$view->addImageContent($linked_image);
|
||||
}
|
||||
|
||||
return $view;
|
||||
|
||||
@@ -157,7 +157,7 @@ final class PhabricatorMacroViewController
|
||||
$sub_view);
|
||||
|
||||
if ($file) {
|
||||
$view->addTextContent(
|
||||
$view->addImageContent(
|
||||
phutil_tag(
|
||||
'img',
|
||||
array(
|
||||
|
||||
@@ -59,6 +59,14 @@ final class PhabricatorPropertyListView extends AphrontView {
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addImageContent($content) {
|
||||
$this->parts[] = array(
|
||||
'type' => 'image',
|
||||
'content' => $content,
|
||||
);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function invokeWillRenderEvent() {
|
||||
if ($this->object && $this->getUser() && !$this->invokedWillRenderEvent) {
|
||||
$event = new PhabricatorEvent(
|
||||
@@ -91,6 +99,7 @@ final class PhabricatorPropertyListView extends AphrontView {
|
||||
$items[] = $this->renderSectionPart($part);
|
||||
break;
|
||||
case 'text':
|
||||
case 'image':
|
||||
$items[] = $this->renderTextPart($part);
|
||||
break;
|
||||
default:
|
||||
@@ -166,10 +175,15 @@ final class PhabricatorPropertyListView extends AphrontView {
|
||||
}
|
||||
|
||||
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(
|
||||
'div',
|
||||
array(
|
||||
'class' => 'phabricator-property-list-text-content',
|
||||
'class' => implode($classes, ' '),
|
||||
),
|
||||
$part['content']);
|
||||
}
|
||||
|
||||
@@ -93,6 +93,10 @@
|
||||
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
|
||||
so we snuggle next to the header. */
|
||||
|
||||
Reference in New Issue
Block a user