1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-09 14:21:02 +01:00
phorge-phorge/src/applications/uiexample/examples/PHUIDocumentExample.php
Chad Little 9170e90112 [Redesign] Move basefont to Lato, remove Source Sans Pro
Summary: Working towards a more unified look and feel. This brings in Lato as a complete base font over Helvetica Neue, as well as removing Source Sans Pro from DocumentView and Conpherence. Design-wise Lato provides the nice readability at larger font sizes that Source Sans Pro did, with the ability to scale down to tables and UI widgets with ease. This gives us one font instead of two, and now Object descriptions and Timeline posts all can benefit from a consistent, readable font.

Test Plan:
Test main UI, smaller elements like tables, menus, DocumentViews, Previews, Conpherence.

{F498135}

{F498136}

Reviewers: btrahan, epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D13276
2015-06-13 20:32:45 +01:00

199 lines
7.3 KiB
PHP

<?php
final class PHUIDocumentExample extends PhabricatorUIExample {
public function getName() {
return pht('Document View');
}
public function getDescription() {
return pht('Useful for areas of large content navigation');
}
public function renderExample() {
$request = $this->getRequest();
$user = $request->getUser();
$action = id(new PHUIListItemView())
->setName(pht('Actions'))
->setType(PHUIListItemView::TYPE_LABEL);
$action1 = id(new PHUIListItemView())
->setName(pht('Edit Document'))
->setHref('#')
->setIcon('fa-edit')
->setType(PHUIListItemView::TYPE_LINK);
$action2 = id(new PHUIListItemView())
->setName(pht('Move Document'))
->setHref('#')
->setIcon('fa-arrows')
->setType(PHUIListItemView::TYPE_LINK);
$action3 = id(new PHUIListItemView())
->setName(pht('Delete Document'))
->setHref('#')
->setIcon('fa-times')
->setType(PHUIListItemView::TYPE_LINK);
$action4 = id(new PHUIListItemView())
->setName(pht('View History'))
->setHref('#')
->setIcon('fa-list')
->setType(PHUIListItemView::TYPE_LINK);
$action5 = id(new PHUIListItemView())
->setName(pht('Subscribe'))
->setHref('#')
->setIcon('fa-plus-circle')
->setType(PHUIListItemView::TYPE_LINK);
$divider = id(new PHUIListItemView())
->setType(PHUIListItemView::TYPE_DIVIDER);
$header = id(new PHUIHeaderView())
->setHeader(pht('Installation'));
$label1 = id(new PHUIListItemView())
->setName(pht('Getting Started'))
->setType(PHUIListItemView::TYPE_LABEL);
$label2 = id(new PHUIListItemView())
->setName(pht('Documentation'))
->setType(PHUIListItemView::TYPE_LABEL);
$item1 = id(new PHUIListItemView())
->setName(pht('Installation'))
->setHref('#')
->setType(PHUIListItemView::TYPE_LINK);
$item2 = id(new PHUIListItemView())
->setName(pht('Webserver Config'))
->setHref('#')
->setType(PHUIListItemView::TYPE_LINK);
$item3 = id(new PHUIListItemView())
->setName(pht('Adding Users'))
->setHref('#')
->setType(PHUIListItemView::TYPE_LINK);
$item4 = id(new PHUIListItemView())
->setName(pht('Debugging'))
->setHref('#')
->setType(PHUIListItemView::TYPE_LINK);
$sidenav = id(new PHUIListView())
->setType(PHUIListView::SIDENAV_LIST)
->addMenuItem($action)
->addMenuItem($action1)
->addMenuItem($action2)
->addMenuItem($action3)
->addMenuItem($action4)
->addMenuItem($action5)
->addMenuItem($divider)
->addMenuItem($label1)
->addMenuItem($item1)
->addMenuItem($item2)
->addMenuItem($item3)
->addMenuItem($item4)
->addMenuItem($label2)
->addMenuItem($item2)
->addMenuItem($item3)
->addMenuItem($item4)
->addMenuItem($item1);
$home = id(new PHUIListItemView())
->setIcon('fa-home')
->setHref('#')
->setType(PHUIListItemView::TYPE_ICON);
$item1 = id(new PHUIListItemView())
->setName(pht('Installation'))
->setHref('#')
->setSelected(true)
->setType(PHUIListItemView::TYPE_LINK);
$item2 = id(new PHUIListItemView())
->setName(pht('Webserver Config'))
->setHref('#')
->setType(PHUIListItemView::TYPE_LINK);
$item3 = id(new PHUIListItemView())
->setName(pht('Adding Users'))
->setHref('#')
->setType(PHUIListItemView::TYPE_LINK);
$item4 = id(new PHUIListItemView())
->setName(pht('Debugging'))
->setHref('#')
->setType(PHUIListItemView::TYPE_LINK);
$topnav = id(new PHUIListView())
->setType(PHUIListView::NAVBAR_LIST)
->addMenuItem($home)
->addMenuItem($item1)
->addMenuItem($item2)
->addMenuItem($item3)
->addMenuItem($item4);
$document = hsprintf(
'<p class="pl">Lorem ipsum dolor sit amet, consectetur adipisicing, '.
'sed do eiusmod tempor incididunt ut labore et dolore magna '.
'aliqua. Ut enim ad minim veniam, quis nostrud exercitation '.
'ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis '.
'aute irure dolor in reprehenderit in voluptate velit esse cillum '.
'dolore eu fugiat nulla pariatur. Excepteur sint occaecat '.
'cupidatat non proident, sunt in culpa qui officia deserunt '.
'mollit anim id est laborum.</p>'.
'<p class="plr pll plb">Lorem ipsum dolor sit amet, consectetur, '.
'sed do eiusmod tempor incididunt ut labore et dolore magna '.
'aliqua. Ut enim ad minim veniam, quis nostrud exercitation '.
'ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis '.
'aute irure dolor in reprehenderit in voluptate velit esse cillum '.
'dolore eu fugiat nulla pariatur. Excepteur sint occaecat '.
'cupidatat non proident, sunt in culpa qui officia deserunt '.
'mollit anim id est laborum.</p>'.
'<p class="plr pll plb">Lorem ipsum dolor sit amet, consectetur, '.
'sed do eiusmod tempor incididunt ut labore et dolore magna '.
'aliqua. Ut enim ad minim veniam, quis nostrud exercitation '.
'ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis '.
'aute irure dolor in reprehenderit in voluptate velit esse cillum '.
'dolore eu fugiat nulla pariatur. Excepteur sint occaecat '.
'cupidatat non proident, sunt in culpa qui officia deserunt '.
'mollit anim id est laborum.</p>'.
'<p class="plr pll plb">Lorem ipsum dolor sit amet, consectetur, '.
'sed do eiusmod tempor incididunt ut labore et dolore magna '.
'aliqua. Ut enim ad minim veniam, quis nostrud exercitation '.
'ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis '.
'aute irure dolor in reprehenderit in voluptate velit esse cillum '.
'dolore eu fugiat nulla pariatur. Excepteur sint occaecat '.
'cupidatat non proident, sunt in culpa qui officia deserunt '.
'mollit anim id est laborum.</p>'.
'<p class="plr pll plb">Lorem ipsum dolor sit amet, consectetur, '.
'sed do eiusmod tempor incididunt ut labore et dolore magna '.
'aliqua. Ut enim ad minim veniam, quis nostrud exercitation '.
'ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis '.
'aute irure dolor in reprehenderit in voluptate velit esse cillum '.
'dolore eu fugiat nulla pariatur. Excepteur sint occaecat '.
'cupidatat non proident, sunt in culpa qui officia deserunt '.
'mollit anim id est laborum.</p>'.
'<p class="plr pll plb">Lorem ipsum dolor sit amet, consectetur, '.
'sed do eiusmod tempor incididunt ut labore et dolore magna '.
'aliqua. Ut enim ad minim veniam, quis nostrud exercitation '.
'ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis '.
'aute irure dolor in reprehenderit in voluptate velit esse cillum '.
'dolore eu fugiat nulla pariatur. Excepteur sint occaecat '.
'cupidatat non proident, sunt in culpa qui officia deserunt '.
'mollit anim id est laborum.</p>');
$content = new PHUIDocumentView();
$content->setBook(pht('Book or Project Name'), pht('Article'));
$content->setHeader($header);
$content->setFluid(true);
$content->setTopNav($topnav);
$content->setSidenav($sidenav);
$content->appendChild($document);
return $content;
}
}