2012-10-01 23:06:00 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class PhabricatorPinboardView extends AphrontView {
|
|
|
|
|
|
|
|
private $items = array();
|
2012-12-13 19:59:29 +01:00
|
|
|
private $noDataString;
|
|
|
|
|
|
|
|
public function setNoDataString($no_data_string) {
|
|
|
|
$this->noDataString = $no_data_string;
|
|
|
|
return $this;
|
|
|
|
}
|
2012-10-01 23:06:00 +02:00
|
|
|
|
Add very basic scaffolding for Pholio
Summary:
I'm not going to land this until it's a bit more fleshed out since it would just confuse users, but this is probably more reviewable as a few diffs adding a couple features than one ULTRA-diff adding everything. Implement application basics for Pholio. This does more or less nothing, but adds storage, subscribe, flag, markup, indexing, query basics, PHIDs, handle loads, a couple of realy really basic controllers, etc.
Basic hierarchy is:
- **Moleskine**: Top-level object like a Differential Revision, like "Ponder Feed Ideas".
- **Image**: Each Moleskine has one or more images, like the unexpanded / expanded / mobile / empty states of feed.
- **Transaction**: Comment or edit, like Maniphest. I generally want to move most apps to a transaction model so we can log edits.
- **PixelComment**: Equivalent of an inline comment.
Test Plan: Created a fake object and viewed it.
Reviewers: btrahan, chad
Reviewed By: btrahan
CC: aran, davidreuss
Maniphest Tasks: T2097
Differential Revision: https://secure.phabricator.com/D3817
2012-11-22 02:22:36 +01:00
|
|
|
public function addItem(PhabricatorPinboardItemView $item) {
|
2012-10-01 23:06:00 +02:00
|
|
|
$this->items[] = $item;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function render() {
|
|
|
|
require_celerity_resource('phabricator-pinboard-view-css');
|
|
|
|
|
2012-12-13 19:59:29 +01:00
|
|
|
if (!$this->items) {
|
|
|
|
$string = nonempty($this->noDataString, pht('No data.'));
|
|
|
|
return id(new AphrontErrorView())
|
|
|
|
->setSeverity(AphrontErrorView::SEVERITY_NODATA)
|
|
|
|
->appendChild(phutil_escape_html($string))
|
|
|
|
->render();
|
|
|
|
}
|
|
|
|
|
2013-01-29 03:44:54 +01:00
|
|
|
return phutil_tag(
|
2012-10-01 23:06:00 +02:00
|
|
|
'div',
|
|
|
|
array(
|
|
|
|
'class' => 'phabricator-pinboard-view',
|
|
|
|
),
|
2013-01-29 03:44:54 +01:00
|
|
|
$this->renderHTMLView($this->items));
|
2012-10-01 23:06:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|