1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-19 21:32:43 +01:00

Modernize Fact a bit

Summary: Remove AphrontPanels, use standard UI, test for mobile, add phts

Test Plan: Faked a few facts for layout purposes.

Reviewers: btrahan, epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11960
This commit is contained in:
Chad Little 2015-03-03 13:48:30 -08:00
parent 0ceb30af86
commit 972c363a21
2 changed files with 13 additions and 16 deletions

View file

@ -76,8 +76,8 @@ final class PhabricatorFactChartController extends PhabricatorFactController {
'colors' => array('#0000ff'),
));
$panel = new AphrontPanelView();
$panel->setHeader('Count of '.$spec->getName());
$panel = new PHUIObjectBoxView();
$panel->setHeaderText(pht('Count of %s', $spec->getName()));
$panel->appendChild($chart);
$crumbs = $this->buildApplicationCrumbs();
@ -89,8 +89,7 @@ final class PhabricatorFactChartController extends PhabricatorFactController {
$panel,
),
array(
'title' => 'Chart',
'device' => false,
'title' => pht('Chart'),
));
}

View file

@ -42,8 +42,8 @@ final class PhabricatorFactHomeController extends PhabricatorFactController {
$table = new AphrontTableView($rows);
$table->setHeaders(
array(
'Fact',
'Value',
pht('Fact'),
pht('Value'),
));
$table->setColumnClasses(
array(
@ -51,8 +51,8 @@ final class PhabricatorFactHomeController extends PhabricatorFactController {
'n',
));
$panel = new AphrontPanelView();
$panel->setHeader('Facts!');
$panel = new PHUIObjectBoxView();
$panel->setHeaderText(pht('Facts'));
$panel->appendChild($table);
$chart_form = $this->buildChartForm();
@ -67,8 +67,7 @@ final class PhabricatorFactHomeController extends PhabricatorFactController {
$panel,
),
array(
'title' => 'Facts',
'device' => false,
'title' => pht('Facts'),
));
}
@ -98,7 +97,7 @@ final class PhabricatorFactHomeController extends PhabricatorFactController {
if (!$options) {
return id(new PHUIInfoView())
->setSeverity(PHUIInfoView::SEVERITY_NOTICE)
->setSeverity(PHUIInfoView::SEVERITY_NODATA)
->setTitle(pht('No Chartable Facts'))
->appendChild(phutil_tag(
'p',
@ -115,12 +114,11 @@ final class PhabricatorFactHomeController extends PhabricatorFactController {
->setOptions($options))
->appendChild(
id(new AphrontFormSubmitControl())
->setValue('Plot Chart'));
->setValue(pht('Plot Chart')));
$panel = new AphrontPanelView();
$panel->appendChild($form);
$panel->setWidth(AphrontPanelView::WIDTH_FORM);
$panel->setHeader('Plot Chart');
$panel = new PHUIObjectBoxView();
$panel->setForm($form);
$panel->setHeaderText(pht('Plot Chart'));
return $panel;
}