Page MenuHomePhorge

No OneTemporary

diff --git a/src/applications/uiexample/controller/PhabricatorUIExampleRenderController.php b/src/applications/uiexample/controller/PhabricatorUIExampleRenderController.php
index f386982964..7b65600aa3 100644
--- a/src/applications/uiexample/controller/PhabricatorUIExampleRenderController.php
+++ b/src/applications/uiexample/controller/PhabricatorUIExampleRenderController.php
@@ -1,65 +1,66 @@
<?php
final class PhabricatorUIExampleRenderController extends PhabricatorController {
private $class;
+ public function shouldAllowPublic() {
+ return true;
+ }
+
public function willProcessRequest(array $data) {
$this->class = idx($data, 'class');
}
public function processRequest() {
$classes = id(new PhutilSymbolLoader())
->setAncestorClass('PhabricatorUIExample')
- ->setConcreteOnly(true)
- ->selectAndLoadSymbols();
- $classes = ipull($classes, 'name', 'name');
-
- foreach ($classes as $class => $ignored) {
- $classes[$class] = newv($class, array());
- }
-
+ ->loadObjects();
$classes = msort($classes, 'getName');
$nav = new AphrontSideNavFilterView();
$nav->setBaseURI(new PhutilURI($this->getApplicationURI('view/')));
foreach ($classes as $class => $obj) {
$name = $obj->getName();
$nav->addFilter($class, $name);
}
$selected = $nav->selectFilter($this->class, head_key($classes));
$example = $classes[$selected];
$example->setRequest($this->getRequest());
$result = $example->renderExample();
if ($result instanceof AphrontResponse) {
// This allows examples to generate dialogs, etc., for demonstration.
return $result;
}
require_celerity_resource('phabricator-ui-example-css');
- $nav->appendChild(hsprintf(
- '<div class="phabricator-ui-example-header">'.
- '<h1 class="phabricator-ui-example-name">%s (%s)</h1>'.
- '<p class="phabricator-ui-example-description">%s</p>'.
- '</div>',
- $example->getName(),
- get_class($example),
- $example->getDescription()));
+ $crumbs = $this->buildApplicationCrumbs();
+ $crumbs->addTextCrumb($example->getName());
+
+ $header = id(new PHUIHeaderView())
+ ->setHeader(pht('%s (%s)', $example->getName(), get_class($example)))
+ ->setSubheader($example->getDescription());
- $nav->appendChild($result);
+ $nav->appendChild(
+ array(
+ $crumbs,
+ $header,
+ phutil_tag('br'),
+ $result,
+ ));
return $this->buildApplicationPage(
$nav,
array(
- 'title' => 'UI Example',
+ 'title' => $example->getName(),
'device' => true,
));
}
}
diff --git a/webroot/rsrc/css/application/uiexample/example.css b/webroot/rsrc/css/application/uiexample/example.css
index a337e21064..fdd0c9749b 100644
--- a/webroot/rsrc/css/application/uiexample/example.css
+++ b/webroot/rsrc/css/application/uiexample/example.css
@@ -1,59 +1,51 @@
/**
* @provides phabricator-ui-example-css
*/
.phabricator-ui-example-note {
padding: .5em;
margin: 2em 1em 0.5em;
background: #ffffdd;
border: 1px solid #f5e178;
}
.phabricator-ui-example-note tt {
font-weight: bold;
}
-.phabricator-ui-example-header {
- margin: 1em 2em 2em;
-}
-
-.phabricator-ui-example-description {
- margin: 1em 0;
-}
-
.jxui-example-container {
padding: 2em;
margin: 4em auto;
border: 4px solid black;
background: #dfdfdf;
text-align: center;
width: 50%;
}
.jxui-example-container a {
margin: 1em;
}
.jxui-example-container a.jxui-active {
box-shadow: 0 0 30px #ffff00;
}
.jxui-blue-background {
background: {$blue};
}
.jxui-red-border {
border-color: {$red};
}
.phui-example-icon-name {
display: inline-block;
width: 160px;
padding-bottom: 8px;
white-space: nowrap;
}
.phui-icon-view.phui-example-icon-transform {
display: block;
padding-bottom: 8px;
}

File Metadata

Mime Type
text/x-diff
Expires
Sun, Jan 19, 16:09 (2 w, 6 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1126335
Default Alt Text
(3 KB)

Event Timeline