Skip to content

Commit

Permalink
Add a UIExamples page for PHUIBigInfoView
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Chad Little committed Aug 7, 2017
1 parent fd3cb18 commit 7119c98
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/__phutil_library_map__.php
Expand Up @@ -1710,6 +1710,7 @@
'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',
Expand Down Expand Up @@ -6867,6 +6868,7 @@
'PHUIBadgeExample' => 'PhabricatorUIExample',
'PHUIBadgeMiniView' => 'AphrontTagView',
'PHUIBadgeView' => 'AphrontTagView',
'PHUIBigInfoExample' => 'PhabricatorUIExample',
'PHUIBigInfoView' => 'AphrontTagView',
'PHUIBoxExample' => 'PhabricatorUIExample',
'PHUIBoxView' => 'AphrontTagView',
Expand Down
48 changes: 48 additions & 0 deletions src/applications/uiexample/examples/PHUIBigInfoExample.php
@@ -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);
}
}
1 change: 1 addition & 0 deletions src/view/phui/PHUIBigInfoView.php
Expand Up @@ -49,6 +49,7 @@ protected function getTagAttributes() {
protected function getTagContent() {
require_celerity_resource('phui-big-info-view-css');

$icon = null;
if ($this->icon) {
$icon = id(new PHUIIconView())
->setIcon($this->icon)
Expand Down

0 comments on commit 7119c98

Please sign in to comment.