Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Chad Little
committed
Aug 7, 2017
1 parent
fd3cb18
commit 7119c98
Showing
3 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
src/applications/uiexample/examples/PHUIBigInfoExample.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters