mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Minor updates to UIExamples
Summary: Ref T4830. - If the application policy is public, allow logged-out users to browse examples. - Use standard elements instead of custom ones. Test Plan: Browsed UIExamples. Reviewers: btrahan, chad Reviewed By: chad Subscribers: epriestley Maniphest Tasks: T4830 Differential Revision: https://secure.phabricator.com/D8825
This commit is contained in:
parent
28696d08ac
commit
4143ecf015
2 changed files with 19 additions and 26 deletions
|
@ -4,6 +4,10 @@ final class PhabricatorUIExampleRenderController extends PhabricatorController {
|
|||
|
||||
private $class;
|
||||
|
||||
public function shouldAllowPublic() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function willProcessRequest(array $data) {
|
||||
$this->class = idx($data, 'class');
|
||||
}
|
||||
|
@ -12,14 +16,7 @@ final class PhabricatorUIExampleRenderController extends PhabricatorController {
|
|||
|
||||
$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();
|
||||
|
@ -43,21 +40,25 @@ final class PhabricatorUIExampleRenderController extends PhabricatorController {
|
|||
|
||||
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());
|
||||
|
||||
$nav->appendChild($result);
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader(pht('%s (%s)', $example->getName(), get_class($example)))
|
||||
->setSubheader($example->getDescription());
|
||||
|
||||
$nav->appendChild(
|
||||
array(
|
||||
$crumbs,
|
||||
$header,
|
||||
phutil_tag('br'),
|
||||
$result,
|
||||
));
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
$nav,
|
||||
array(
|
||||
'title' => 'UI Example',
|
||||
'title' => $example->getName(),
|
||||
'device' => true,
|
||||
));
|
||||
}
|
||||
|
|
|
@ -13,14 +13,6 @@
|
|||
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;
|
||||
|
|
Loading…
Reference in a new issue