2013-03-30 17:51:35 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class PhabricatorWorkboardExample extends PhabricatorUIExample {
|
|
|
|
|
|
|
|
public function getName() {
|
|
|
|
return 'Workboard';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getDescription() {
|
|
|
|
return 'A board for visualizing work. Fixed and Fluid layouts.';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function renderExample() {
|
|
|
|
|
|
|
|
/* List 1 */
|
|
|
|
|
|
|
|
$list = new PhabricatorObjectItemListView();
|
|
|
|
$list->setCards(true);
|
|
|
|
$list->setFlush(true);
|
|
|
|
|
|
|
|
$list->addItem(
|
|
|
|
id(new PhabricatorObjectItemView())
|
|
|
|
->setHeader(pht('Business Card'))
|
|
|
|
->setBarColor('red'));
|
|
|
|
$list->addItem(
|
|
|
|
id(new PhabricatorObjectItemView())
|
|
|
|
->setHeader(pht('Playing Card'))
|
|
|
|
->setBarColor('orange'));
|
|
|
|
$list->addItem(
|
|
|
|
id(new PhabricatorObjectItemView())
|
|
|
|
->setHeader(pht('House of Cards'))
|
|
|
|
->setBarColor('yellow'));
|
|
|
|
$list->addItem(
|
|
|
|
id(new PhabricatorObjectItemView())
|
|
|
|
->setHeader(pht('Cardigan'))
|
|
|
|
->setBarColor('green'));
|
|
|
|
$list->addItem(
|
|
|
|
id(new PhabricatorObjectItemView())
|
|
|
|
->setHeader(pht('Cardamom'))
|
|
|
|
->addFootIcon('highlight-white', 'Spice')
|
|
|
|
->setBarColor('blue'));
|
|
|
|
|
|
|
|
/* List 2 */
|
|
|
|
|
|
|
|
$list2 = new PhabricatorObjectItemListView();
|
|
|
|
$list2->setCards(true);
|
|
|
|
$list2->setFlush(true);
|
|
|
|
|
|
|
|
$list2->addItem(
|
|
|
|
id(new PhabricatorObjectItemView())
|
|
|
|
->setHeader(pht('Business Card'))
|
|
|
|
->setBarColor('red'));
|
|
|
|
$list2->addItem(
|
|
|
|
id(new PhabricatorObjectItemView())
|
|
|
|
->setHeader(pht('Playing Card'))
|
|
|
|
->setBarColor('orange'));
|
|
|
|
|
|
|
|
/* List 3 */
|
|
|
|
|
|
|
|
$list3 = new PhabricatorObjectItemListView();
|
|
|
|
$list3->setCards(true);
|
|
|
|
$list3->setFlush(true);
|
|
|
|
|
|
|
|
$list3->addItem(
|
|
|
|
id(new PhabricatorObjectItemView())
|
|
|
|
->setHeader(pht('Business Card'))
|
|
|
|
->setBarColor('red'));
|
|
|
|
$list3->addItem(
|
|
|
|
id(new PhabricatorObjectItemView())
|
|
|
|
->setHeader(pht('Playing Card'))
|
|
|
|
->setBarColor('orange'));
|
|
|
|
$list3->addItem(
|
|
|
|
id(new PhabricatorObjectItemView())
|
|
|
|
->setHeader(pht('House of Cards'))
|
|
|
|
->setBarColor('yellow'));
|
|
|
|
$list3->addItem(
|
|
|
|
id(new PhabricatorObjectItemView())
|
|
|
|
->setHeader(pht('Cardigan'))
|
|
|
|
->setBarColor('green'));
|
|
|
|
$list3->addItem(
|
|
|
|
id(new PhabricatorObjectItemView())
|
|
|
|
->setHeader(pht('Cardamom'))
|
|
|
|
->addFootIcon('highlight-white', 'Spice')
|
|
|
|
->setBarColor('blue'));
|
|
|
|
$list3->addItem(
|
|
|
|
id(new PhabricatorObjectItemView())
|
|
|
|
->setHeader(pht('Business Card'))
|
|
|
|
->setBarColor('red'));
|
|
|
|
$list3->addItem(
|
|
|
|
id(new PhabricatorObjectItemView())
|
|
|
|
->setHeader(pht('Playing Card'))
|
|
|
|
->setBarColor('orange'));
|
|
|
|
$list3->addItem(
|
|
|
|
id(new PhabricatorObjectItemView())
|
|
|
|
->setHeader(pht('Business Card'))
|
|
|
|
->setBarColor('red'));
|
|
|
|
$list3->addItem(
|
|
|
|
id(new PhabricatorObjectItemView())
|
|
|
|
->setHeader(pht('Playing Card'))
|
|
|
|
->setBarColor('orange'));
|
|
|
|
|
2013-03-31 21:28:50 +02:00
|
|
|
$panel = id(new PhabricatorWorkpanelView())
|
2013-03-30 17:51:35 +01:00
|
|
|
->setCards($list)
|
2013-03-30 22:46:02 +01:00
|
|
|
->setHeader('Business Stuff')
|
|
|
|
->setFooterAction(
|
2013-06-05 17:41:43 +02:00
|
|
|
id(new PHUIListItemView())
|
2013-03-30 22:46:02 +01:00
|
|
|
->setName(pht('Add Task'))
|
|
|
|
->setIcon('new')
|
|
|
|
->setHref('/maniphest/task/create/'));
|
2013-03-30 17:51:35 +01:00
|
|
|
|
2013-03-31 21:28:50 +02:00
|
|
|
$panel2 = id(new PhabricatorWorkpanelView())
|
2013-03-30 17:51:35 +01:00
|
|
|
->setCards($list2)
|
|
|
|
->setHeader('Under Duress');
|
|
|
|
|
2013-03-31 21:28:50 +02:00
|
|
|
$panel3 = id(new PhabricatorWorkpanelView())
|
2013-03-30 22:46:02 +01:00
|
|
|
->setCards($list3)
|
|
|
|
->setHeader('Spicy Thai Chicken');
|
2013-03-30 17:51:35 +01:00
|
|
|
|
2013-03-31 21:28:50 +02:00
|
|
|
$board = id(new PhabricatorWorkboardView())
|
2013-03-30 17:51:35 +01:00
|
|
|
->addPanel($panel)
|
|
|
|
->addPanel($panel2)
|
|
|
|
->addPanel($panel2)
|
|
|
|
->addPanel($panel3);
|
|
|
|
|
2013-03-31 21:28:50 +02:00
|
|
|
$board2 = id(new PhabricatorWorkboardView())
|
2013-04-02 20:23:24 +02:00
|
|
|
->setFluidLayout(true)
|
2013-03-30 17:51:35 +01:00
|
|
|
->addPanel($panel)
|
|
|
|
->addPanel($panel2)
|
|
|
|
->addPanel($panel2)
|
2013-03-30 22:46:02 +01:00
|
|
|
->addPanel($panel)
|
2013-03-30 17:51:35 +01:00
|
|
|
->addPanel($panel2)
|
|
|
|
->addPanel($panel3);
|
|
|
|
|
2013-04-20 02:44:20 +02:00
|
|
|
$action = new PHUIIconView();
|
2013-03-31 21:28:50 +02:00
|
|
|
$action->setHref('/maniphest/task/create');
|
|
|
|
$action->setImage('/rsrc/image/actions/edit.png');
|
|
|
|
|
2013-04-20 02:44:20 +02:00
|
|
|
$person1 = new PHUIIconView();
|
2013-03-31 21:28:50 +02:00
|
|
|
$person1->setHref('http://en.wikipedia.org/wiki/George_Washington');
|
|
|
|
$person1->setImage(
|
|
|
|
celerity_get_resource_uri('/rsrc/image/people/washington.png'));
|
|
|
|
|
2013-04-20 02:44:20 +02:00
|
|
|
$person2 = new PHUIIconView();
|
2013-03-31 21:28:50 +02:00
|
|
|
$person2->setHref('http://en.wikipedia.org/wiki/Warren_G._Harding');
|
|
|
|
$person2->setImage(
|
|
|
|
celerity_get_resource_uri('/rsrc/image/people/harding.png'));
|
|
|
|
|
2013-04-20 02:44:20 +02:00
|
|
|
$person3 = new PHUIIconView();
|
2013-03-31 21:28:50 +02:00
|
|
|
$person3->setHref('http://en.wikipedia.org/wiki/William_Howard_Taft');
|
|
|
|
$person3->setImage(
|
|
|
|
celerity_get_resource_uri('/rsrc/image/people/taft.png'));
|
|
|
|
|
|
|
|
$board3 = id(new PhabricatorWorkboardView())
|
2013-04-02 20:23:24 +02:00
|
|
|
->setFluidLayout(true)
|
2013-03-31 21:28:50 +02:00
|
|
|
->addPanel($panel)
|
|
|
|
->addPanel($panel)
|
|
|
|
->addPanel($panel2)
|
|
|
|
->addPanel($panel3)
|
|
|
|
->addAction($action)
|
|
|
|
->addAction($person1)
|
|
|
|
->addAction($person2)
|
|
|
|
->addAction($person3);
|
|
|
|
|
2013-03-30 17:51:35 +01:00
|
|
|
$head1 = id(new PhabricatorHeaderView())
|
|
|
|
->setHeader(pht('Fixed Panel'));
|
|
|
|
|
|
|
|
$head2 = id(new PhabricatorHeaderView())
|
|
|
|
->setHeader(pht('Fluid Panel'));
|
|
|
|
|
2013-03-31 21:28:50 +02:00
|
|
|
$head3 = id(new PhabricatorHeaderView())
|
|
|
|
->setHeader(pht('Action Panel'));
|
2013-03-30 17:51:35 +01:00
|
|
|
|
2013-04-18 20:34:02 +02:00
|
|
|
$wrap1 = id(new PHUIBoxView())
|
|
|
|
->appendChild($board)
|
|
|
|
->addMargin(PHUI::MARGIN_LARGE);
|
2013-03-30 17:51:35 +01:00
|
|
|
|
2013-04-18 20:34:02 +02:00
|
|
|
$wrap2 = id(new PHUIBoxView())
|
|
|
|
->appendChild($board2)
|
|
|
|
->addMargin(PHUI::MARGIN_LARGE);
|
2013-03-30 17:51:35 +01:00
|
|
|
|
2013-04-18 20:34:02 +02:00
|
|
|
$wrap3 = id(new PHUIBoxView())
|
|
|
|
->appendChild($board3)
|
|
|
|
->addMargin(PHUI::MARGIN_LARGE);
|
2013-03-31 21:28:50 +02:00
|
|
|
|
2013-03-30 17:51:35 +01:00
|
|
|
return phutil_tag(
|
|
|
|
'div',
|
|
|
|
array(),
|
|
|
|
array(
|
|
|
|
$head1,
|
|
|
|
$wrap1,
|
|
|
|
$head2,
|
2013-03-31 21:28:50 +02:00
|
|
|
$wrap2,
|
|
|
|
$head3,
|
|
|
|
$wrap3
|
2013-03-30 17:51:35 +01:00
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|