1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-30 10:42:41 +01:00
phorge-phorge/src/view/phui/PHUIPinboardView.php
Chad Little 140f63e398 [Redesign] Center Pinboard Items
Summary: Ref T8099, This centers, but floats, all pinboards items based on screen width.

Test Plan:
Test desktop, mobile break points. Items scale nicely.

{F459680}

Reviewers: btrahan, epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T8099

Differential Revision: https://secure.phabricator.com/D13085
2015-05-31 14:28:16 -07:00

37 lines
788 B
PHP

<?php
final class PHUIPinboardView extends AphrontView {
private $items = array();
private $noDataString;
public function setNoDataString($no_data_string) {
$this->noDataString = $no_data_string;
return $this;
}
public function addItem(PHUIPinboardItemView $item) {
$this->items[] = $item;
return $this;
}
public function render() {
require_celerity_resource('phui-pinboard-view-css');
if (!$this->items) {
$string = nonempty($this->noDataString, pht('No data.'));
return id(new PHUIInfoView())
->setSeverity(PHUIInfoView::SEVERITY_NODATA)
->appendChild($string)
->render();
}
return phutil_tag(
'ul',
array(
'class' => 'phui-pinboard-view',
),
$this->items);
}
}