Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15513976
D8569.id20345.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D8569.id20345.diff
View Options
diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -7,7 +7,7 @@
return array(
'names' =>
array(
- 'core.pkg.css' => '4b8e980c',
+ 'core.pkg.css' => 'b548faff',
'core.pkg.js' => '264721e1',
'darkconsole.pkg.js' => 'ca8671ce',
'differential.pkg.css' => 'cb97e095',
@@ -141,7 +141,7 @@
'rsrc/css/phui/phui-info-panel.css' => '27ea50a1',
'rsrc/css/phui/phui-list.css' => '2edb76cf',
'rsrc/css/phui/phui-object-box.css' => 'ce92d8ec',
- 'rsrc/css/phui/phui-object-item-list-view.css' => '4e4e3d4c',
+ 'rsrc/css/phui/phui-object-item-list-view.css' => 'a8131782',
'rsrc/css/phui/phui-pinboard-view.css' => '4b346c2a',
'rsrc/css/phui/phui-property-list-view.css' => 'dbf53b12',
'rsrc/css/phui/phui-remarkup-preview.css' => '19ad512b',
@@ -758,7 +758,7 @@
'phui-info-panel-css' => '27ea50a1',
'phui-list-view-css' => '2edb76cf',
'phui-object-box-css' => 'ce92d8ec',
- 'phui-object-item-list-view-css' => '4e4e3d4c',
+ 'phui-object-item-list-view-css' => 'a8131782',
'phui-pinboard-view-css' => '4b346c2a',
'phui-property-list-view-css' => 'dbf53b12',
'phui-remarkup-preview-css' => '19ad512b',
diff --git a/src/applications/uiexample/examples/PHUIObjectItemListExample.php b/src/applications/uiexample/examples/PHUIObjectItemListExample.php
--- a/src/applications/uiexample/examples/PHUIObjectItemListExample.php
+++ b/src/applications/uiexample/examples/PHUIObjectItemListExample.php
@@ -332,6 +332,34 @@
$out[] = array($head, $list);
+
+ $head = id(new PHUIHeaderView())
+ ->setHeader(pht('Images'));
+
+ $list = new PHUIObjectItemListView();
+
+ $default_profile = PhabricatorFile::loadBuiltin($user, 'profile.png');
+ $default_project = PhabricatorFile::loadBuiltin($user, 'project.png');
+
+ $list->addItem(
+ id(new PHUIObjectItemView())
+ ->setImageURI($default_profile->getViewURI())
+ ->setHeader(pht('Default User Profile Image'))
+ ->setBarColor('violet')
+ ->addAction(
+ id(new PHUIListItemView())
+ ->setHref('#')
+ ->setIcon('create')));
+
+ $list->addItem(
+ id(new PHUIObjectItemView())
+ ->setImageURI($default_project->getViewURI())
+ ->setHeader(pht('Default Project Profile Image'))
+ ->setGrippable(true)
+ ->addAttribute(pht('This is the default project profile image.')));
+
+ $out[] = array($head, $list);
+
return $out;
}
}
diff --git a/src/view/phui/PHUIObjectItemView.php b/src/view/phui/PHUIObjectItemView.php
--- a/src/view/phui/PHUIObjectItemView.php
+++ b/src/view/phui/PHUIObjectItemView.php
@@ -18,6 +18,7 @@
private $actions = array();
private $headIcons = array();
private $disabled;
+ private $imageURI;
const AGE_FRESH = 'fresh';
const AGE_STALE = 'stale';
@@ -97,6 +98,15 @@
return $this;
}
+ public function setImageURI($image_uri) {
+ $this->imageURI = $image_uri;
+ return $this;
+ }
+
+ public function getImageURI() {
+ return $this->imageURI;
+ }
+
public function setEpoch($epoch, $age = self::AGE_FRESH) {
$date = phabricator_datetime($epoch, $this->getUser());
@@ -241,6 +251,10 @@
$item_classes[] = 'phui-object-item-grippable';
}
+ if ($this->getImageuRI()) {
+ $item_classes[] = 'phui-object-item-with-image';
+ }
+
return array(
'class' => $item_classes,
);
@@ -469,6 +483,17 @@
$foot,
));
+ $image = null;
+ if ($this->getImageURI()) {
+ $image = phutil_tag(
+ 'div',
+ array(
+ 'class' => 'phui-object-item-image',
+ 'style' => 'background-image: url('.$this->getImageURI().')',
+ ),
+ '');
+ }
+
$box = phutil_tag(
'div',
array(
@@ -505,6 +530,7 @@
),
array(
$actions,
+ $image,
$box,
));
}
diff --git a/webroot/rsrc/css/phui/phui-object-item-list-view.css b/webroot/rsrc/css/phui/phui-object-item-list-view.css
--- a/webroot/rsrc/css/phui/phui-object-item-list-view.css
+++ b/webroot/rsrc/css/phui/phui-object-item-list-view.css
@@ -568,3 +568,19 @@
padding-left: 0;
padding-top: 0;
}
+
+.phui-object-item-image {
+ width: 50px;
+ height: 50px;
+ margin: 4px 4px 4px 8px;
+ position: absolute;
+ background-color: {$lightbluebackground};
+}
+
+.phui-object-item-with-image .phui-object-item-frame {
+ min-height: 58px;
+}
+
+.phui-object-item-with-image .phui-object-item-content-box {
+ margin-left: 58px;
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 18, 11:28 PM (5 d, 22 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7222434
Default Alt Text
D8569.id20345.diff (4 KB)
Attached To
Mode
D8569: Allow ObjectItemListView to show profile images
Attached
Detach File
Event Timeline
Log In to Comment