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:
Chad Little
2013-02-26 16:37:45 -08:00
parent 40d453d6aa
commit 82e41e7fa1
5 changed files with 22 additions and 7 deletions

View File

@@ -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(

View File

@@ -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;

View File

@@ -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(

View File

@@ -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']);
} }

View File

@@ -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. */