mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-29 10:12:41 +01:00
Add a UIExamples page for PHUIBigInfoView
Summary: Fixes the icon bug and builds a basic examples page for future testing. Test Plan: Visit uiexampls and various types of info views. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D18356
This commit is contained in:
parent
fd3cb18fe4
commit
7119c98744
3 changed files with 51 additions and 0 deletions
|
@ -1710,6 +1710,7 @@ phutil_register_library_map(array(
|
|||
'PHUIBadgeExample' => 'applications/uiexample/examples/PHUIBadgeExample.php',
|
||||
'PHUIBadgeMiniView' => 'view/phui/PHUIBadgeMiniView.php',
|
||||
'PHUIBadgeView' => 'view/phui/PHUIBadgeView.php',
|
||||
'PHUIBigInfoExample' => 'applications/uiexample/examples/PHUIBigInfoExample.php',
|
||||
'PHUIBigInfoView' => 'view/phui/PHUIBigInfoView.php',
|
||||
'PHUIBoxExample' => 'applications/uiexample/examples/PHUIBoxExample.php',
|
||||
'PHUIBoxView' => 'view/phui/PHUIBoxView.php',
|
||||
|
@ -6867,6 +6868,7 @@ phutil_register_library_map(array(
|
|||
'PHUIBadgeExample' => 'PhabricatorUIExample',
|
||||
'PHUIBadgeMiniView' => 'AphrontTagView',
|
||||
'PHUIBadgeView' => 'AphrontTagView',
|
||||
'PHUIBigInfoExample' => 'PhabricatorUIExample',
|
||||
'PHUIBigInfoView' => 'AphrontTagView',
|
||||
'PHUIBoxExample' => 'PhabricatorUIExample',
|
||||
'PHUIBoxView' => 'AphrontTagView',
|
||||
|
|
48
src/applications/uiexample/examples/PHUIBigInfoExample.php
Normal file
48
src/applications/uiexample/examples/PHUIBigInfoExample.php
Normal file
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
final class PHUIBigInfoExample extends PhabricatorUIExample {
|
||||
|
||||
public function getName() {
|
||||
return pht('Big Info View');
|
||||
}
|
||||
|
||||
public function getDescription() {
|
||||
return pht(
|
||||
'Basic New User State information block.');
|
||||
}
|
||||
|
||||
public function renderExample() {
|
||||
$request = $this->getRequest();
|
||||
$viewer = $request->getUser();
|
||||
|
||||
$image = PhabricatorFile::loadBuiltin($viewer,
|
||||
'projects/v3/rocket.png');
|
||||
|
||||
$button = id(new PHUIButtonView())
|
||||
->setTag('a')
|
||||
->setText(pht('Launch Away'))
|
||||
->setColor(PHUIButtonView::GREEN)
|
||||
->setHref('#');
|
||||
|
||||
$views = array();
|
||||
$views[] = id(new PHUIBigInfoView())
|
||||
->setTitle(pht('Simply Slim'))
|
||||
->setDescription(pht('A simple description'))
|
||||
->addAction($button);
|
||||
|
||||
$views[] = id(new PHUIBigInfoView())
|
||||
->setTitle(pht('Basicly Basic'))
|
||||
->setIcon('fa-rocket')
|
||||
->setDescription(pht('A more basic description'))
|
||||
->addAction($button);
|
||||
|
||||
$views[] = id(new PHUIBigInfoView())
|
||||
->setTitle(pht('A Modern Example'))
|
||||
->setImage($image->getBestURI())
|
||||
->setDescription(pht('A modern description with lots of frills.'))
|
||||
->addAction($button);
|
||||
|
||||
|
||||
return phutil_tag_div('ml', $views);
|
||||
}
|
||||
}
|
|
@ -49,6 +49,7 @@ final class PHUIBigInfoView extends AphrontTagView {
|
|||
protected function getTagContent() {
|
||||
require_celerity_resource('phui-big-info-view-css');
|
||||
|
||||
$icon = null;
|
||||
if ($this->icon) {
|
||||
$icon = id(new PHUIIconView())
|
||||
->setIcon($this->icon)
|
||||
|
|
Loading…
Reference in a new issue