mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-30 10:42:41 +01:00
Remove some AphrontPanels
Summary: Removes AphrontPanelViews from UIExamples Test Plan: Tested new layouts in each of the pages. Reviewers: btrahan, epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T7427 Differential Revision: https://secure.phabricator.com/D11947
This commit is contained in:
parent
5952b0a31b
commit
de13f39847
4 changed files with 26 additions and 25 deletions
|
@ -82,7 +82,8 @@ final class JavelinReactorUIExample extends PhabricatorUIExample {
|
||||||
|
|
||||||
$table = new AphrontTableView($rows);
|
$table = new AphrontTableView($rows);
|
||||||
|
|
||||||
$panel = new AphrontPanelView();
|
$panel = new PHUIObjectBoxView();
|
||||||
|
$panel->setHeaderText(pht('Example'));
|
||||||
$panel->appendChild($table);
|
$panel->appendChild($table);
|
||||||
|
|
||||||
return $panel;
|
return $panel;
|
||||||
|
|
|
@ -35,8 +35,10 @@ final class JavelinViewUIExample extends PhabricatorUIExample {
|
||||||
$child_server_template->appendChild($child_client_template);
|
$child_server_template->appendChild($child_client_template);
|
||||||
$child_client_template->appendChild('Hey, it worked.');
|
$child_client_template->appendChild('Hey, it worked.');
|
||||||
|
|
||||||
$panel = new AphrontPanelView();
|
$panel = new PHUIObjectBoxView();
|
||||||
$panel->appendChild($parent_server_template);
|
$panel->setHeaderText(pht('Example'));
|
||||||
|
$panel->appendChild(
|
||||||
|
phutil_tag_div('ml', $parent_server_template));
|
||||||
|
|
||||||
return $panel;
|
return $panel;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,19 +11,19 @@ final class PhabricatorAphrontBarUIExample extends PhabricatorUIExample {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderExample() {
|
public function renderExample() {
|
||||||
$out = '';
|
$out = array();
|
||||||
$out .= $this->renderTestThings('AphrontProgressBarView', 13, 10);
|
$out[] = $this->renderTestThings('AphrontProgressBarView', 13, 10);
|
||||||
$out .= $this->renderTestThings('AphrontGlyphBarView', 13, 10);
|
$out[] = $this->renderTestThings('AphrontGlyphBarView', 13, 10);
|
||||||
$out .= $this->renderWeirdOrderGlyphBars();
|
$out[] = $this->renderWeirdOrderGlyphBars();
|
||||||
$out .= $this->renderAsciiStarBar();
|
$out[] = $this->renderAsciiStarBar();
|
||||||
return phutil_safe_html($out);
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function wrap($title, $thing) {
|
private function wrap($title, $thing) {
|
||||||
return id(new AphrontPanelView())
|
$thing = phutil_tag_div('ml grouped', $thing);
|
||||||
->setHeader($title)
|
return id(new PHUIObjectBoxView())
|
||||||
->appendChild($thing)
|
->setHeaderText($title)
|
||||||
->render();
|
->appendChild($thing);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function renderTestThings($class, $max, $incr) {
|
private function renderTestThings($class, $max, $incr) {
|
||||||
|
@ -34,9 +34,7 @@ final class PhabricatorAphrontBarUIExample extends PhabricatorUIExample {
|
||||||
->setMax($max * $incr)
|
->setMax($max * $incr)
|
||||||
->setCaption("{$ii} outta {$max} ain't bad!");
|
->setCaption("{$ii} outta {$max} ain't bad!");
|
||||||
}
|
}
|
||||||
return $this->wrap(
|
return $this->wrap("Test {$class}", $bars);
|
||||||
"Test {$class}",
|
|
||||||
phutil_implode_html('', mpull($bars, 'render')));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function renderWeirdOrderGlyphBars() {
|
private function renderWeirdOrderGlyphBars() {
|
||||||
|
@ -50,26 +48,25 @@ final class PhabricatorAphrontBarUIExample extends PhabricatorUIExample {
|
||||||
->setNumGlyphs(5)
|
->setNumGlyphs(5)
|
||||||
->setCaption("Lol score is {$index}/{$max}")
|
->setCaption("Lol score is {$index}/{$max}")
|
||||||
->setGlyph(hsprintf('%s', 'LOL!'))
|
->setGlyph(hsprintf('%s', 'LOL!'))
|
||||||
->setBackgroundGlyph(hsprintf('%s', '____'))
|
->setBackgroundGlyph(hsprintf('%s', '____'));
|
||||||
->render();
|
|
||||||
$views[] = hsprintf('<div style="clear:both;"></div>');
|
$views[] = hsprintf('<div style="clear:both;"></div>');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->wrap(
|
return $this->wrap(
|
||||||
'Glyph bars in weird order',
|
'Glyph bars in weird order',
|
||||||
phutil_implode_html('', $views));
|
$views);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function renderAsciiStarBar() {
|
private function renderAsciiStarBar() {
|
||||||
return $this->wrap(
|
$bar = id(new AphrontGlyphBarView())
|
||||||
'Ascii star glyph bar',
|
|
||||||
id(new AphrontGlyphBarView())
|
|
||||||
->setValue(50)
|
->setValue(50)
|
||||||
->setMax(100)
|
->setMax(100)
|
||||||
->setCaption('Glyphs!')
|
->setCaption('Glyphs!')
|
||||||
->setNumGlyphs(10)
|
->setNumGlyphs(10)
|
||||||
->setGlyph(hsprintf('%s', '*'))
|
->setGlyph(hsprintf('%s', '*'));
|
||||||
->render());
|
|
||||||
|
return $this->wrap(
|
||||||
|
'Ascii star glyph bar', $bar);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,8 @@ final class PhabricatorPagerUIExample extends PhabricatorUIExample {
|
||||||
array(
|
array(
|
||||||
'Item',
|
'Item',
|
||||||
));
|
));
|
||||||
$panel = new AphrontPanelView();
|
$panel = new PHUIObjectBoxView();
|
||||||
|
$panel->setHeaderText(pht('Example'));
|
||||||
$panel->appendChild($table);
|
$panel->appendChild($table);
|
||||||
|
|
||||||
$panel->appendChild(hsprintf(
|
$panel->appendChild(hsprintf(
|
||||||
|
|
Loading…
Reference in a new issue