mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-29 08:50:58 +01:00
[Redesign] Add Table, Collapse support to ObjectBox
This commit is contained in:
parent
fa858cc8fd
commit
667159eb07
18 changed files with 46 additions and 22 deletions
|
@ -837,9 +837,7 @@ final class DifferentialRevisionViewController extends DifferentialController {
|
||||||
$viewer = $this->getViewer();
|
$viewer = $this->getViewer();
|
||||||
|
|
||||||
$header = id(new PHUIHeaderView())
|
$header = id(new PHUIHeaderView())
|
||||||
->setHeader(pht('Similar Open Revisions'))
|
->setHeader(pht('Recent Similar Open Revisions'));
|
||||||
->setSubheader(
|
|
||||||
pht('Recently updated open revisions affecting the same files.'));
|
|
||||||
|
|
||||||
$view = id(new DifferentialRevisionListView())
|
$view = id(new DifferentialRevisionListView())
|
||||||
->setHeader($header)
|
->setHeader($header)
|
||||||
|
|
|
@ -251,8 +251,8 @@ final class DifferentialDiffTableOfContentsView extends AphrontView {
|
||||||
|
|
||||||
return id(new PHUIObjectBoxView())
|
return id(new PHUIObjectBoxView())
|
||||||
->setHeaderText(pht('Table of Contents'))
|
->setHeaderText(pht('Table of Contents'))
|
||||||
|
->setTable($table)
|
||||||
->appendChild($anchor)
|
->appendChild($anchor)
|
||||||
->appendChild($table)
|
|
||||||
->appendChild($buttons);
|
->appendChild($buttons);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -130,7 +130,7 @@ final class DifferentialLocalCommitsView extends AphrontView {
|
||||||
|
|
||||||
return id(new PHUIObjectBoxView())
|
return id(new PHUIObjectBoxView())
|
||||||
->setHeaderText(pht('Local Commits'))
|
->setHeaderText(pht('Local Commits'))
|
||||||
->appendChild($table);
|
->setTable($table);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function formatCommit($commit) {
|
private static function formatCommit($commit) {
|
||||||
|
|
|
@ -47,7 +47,7 @@ final class DiffusionBranchTableController extends DiffusionController {
|
||||||
|
|
||||||
$panel = id(new PHUIObjectBoxView())
|
$panel = id(new PHUIObjectBoxView())
|
||||||
->setHeaderText(pht('Branches'))
|
->setHeaderText(pht('Branches'))
|
||||||
->appendChild($view);
|
->setTable($view);
|
||||||
|
|
||||||
$content = $panel;
|
$content = $panel;
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,7 @@ final class DiffusionBrowseDirectoryController
|
||||||
|
|
||||||
$browse_panel = new PHUIObjectBoxView();
|
$browse_panel = new PHUIObjectBoxView();
|
||||||
$browse_panel->setHeaderText($drequest->getPath(), '/');
|
$browse_panel->setHeaderText($drequest->getPath(), '/');
|
||||||
$browse_panel->appendChild($browse_table);
|
$browse_panel->setTable($browse_table);
|
||||||
|
|
||||||
$content[] = $browse_panel;
|
$content[] = $browse_panel;
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,7 +103,7 @@ final class DiffusionBrowseSearchController extends DiffusionBrowseController {
|
||||||
|
|
||||||
$box = id(new PHUIObjectBoxView())
|
$box = id(new PHUIObjectBoxView())
|
||||||
->setHeaderText($header)
|
->setHeaderText($header)
|
||||||
->appendChild($table);
|
->setTable($table);
|
||||||
|
|
||||||
$pager_box = id(new PHUIBoxView())
|
$pager_box = id(new PHUIBoxView())
|
||||||
->addMargin(PHUI::MARGIN_LARGE)
|
->addMargin(PHUI::MARGIN_LARGE)
|
||||||
|
|
|
@ -261,7 +261,7 @@ final class DiffusionCommitController extends DiffusionController {
|
||||||
$header->addActionLink($button);
|
$header->addActionLink($button);
|
||||||
}
|
}
|
||||||
|
|
||||||
$change_panel->appendChild($change_table);
|
$change_panel->setTable($change_table);
|
||||||
$change_panel->setHeader($header);
|
$change_panel->setHeader($header);
|
||||||
|
|
||||||
$content[] = $change_panel;
|
$content[] = $change_panel;
|
||||||
|
@ -918,7 +918,7 @@ final class DiffusionCommitController extends DiffusionController {
|
||||||
|
|
||||||
$panel = new PHUIObjectBoxView();
|
$panel = new PHUIObjectBoxView();
|
||||||
$panel->setHeaderText(pht('Merged Changes'));
|
$panel->setHeaderText(pht('Merged Changes'));
|
||||||
$panel->appendChild($history_table);
|
$panel->setTable($history_table);
|
||||||
if ($caption) {
|
if ($caption) {
|
||||||
$panel->setInfoView($caption);
|
$panel->setInfoView($caption);
|
||||||
}
|
}
|
||||||
|
|
|
@ -132,7 +132,7 @@ final class DiffusionExternalController extends DiffusionController {
|
||||||
$content = new PHUIObjectBoxView();
|
$content = new PHUIObjectBoxView();
|
||||||
$content->setHeaderText(pht('Multiple Matching Commits'));
|
$content->setHeaderText(pht('Multiple Matching Commits'));
|
||||||
$content->setInfoView($caption);
|
$content->setInfoView($caption);
|
||||||
$content->appendChild($table);
|
$content->setTable($table);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->buildApplicationPage(
|
return $this->buildApplicationPage(
|
||||||
|
|
|
@ -59,7 +59,7 @@ final class DiffusionHistoryController extends DiffusionController {
|
||||||
|
|
||||||
$history_panel = new PHUIObjectBoxView();
|
$history_panel = new PHUIObjectBoxView();
|
||||||
$history_panel->setHeaderText(pht('History'));
|
$history_panel->setHeaderText(pht('History'));
|
||||||
$history_panel->appendChild($history_table);
|
$history_panel->setTable($history_table);
|
||||||
|
|
||||||
$content[] = $history_panel;
|
$content[] = $history_panel;
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ final class DiffusionLintController extends DiffusionController {
|
||||||
|
|
||||||
$content[] = id(new PHUIObjectBoxView())
|
$content[] = id(new PHUIObjectBoxView())
|
||||||
->setHeaderText(pht('Lint'))
|
->setHeaderText(pht('Lint'))
|
||||||
->appendChild($table);
|
->setTable($table);
|
||||||
|
|
||||||
$title = array('Lint');
|
$title = array('Lint');
|
||||||
$crumbs = $this->buildCrumbs(
|
$crumbs = $this->buildCrumbs(
|
||||||
|
|
|
@ -74,7 +74,7 @@ final class DiffusionLintDetailsController extends DiffusionController {
|
||||||
|
|
||||||
$content[] = id(new PHUIObjectBoxView())
|
$content[] = id(new PHUIObjectBoxView())
|
||||||
->setHeaderText(pht('Lint Details'))
|
->setHeaderText(pht('Lint Details'))
|
||||||
->appendChild($table);
|
->setTable($table);
|
||||||
|
|
||||||
$crumbs = $this->buildCrumbs(
|
$crumbs = $this->buildCrumbs(
|
||||||
array(
|
array(
|
||||||
|
|
|
@ -43,7 +43,7 @@ final class DiffusionPushEventViewController
|
||||||
|
|
||||||
$commits_box = id(new PHUIObjectBoxView())
|
$commits_box = id(new PHUIObjectBoxView())
|
||||||
->setHeaderText(pht('Pushed Commits'))
|
->setHeaderText(pht('Pushed Commits'))
|
||||||
->appendChild($commits_table);
|
->setTable($commits_table);
|
||||||
|
|
||||||
$logs = $event->getLogs();
|
$logs = $event->getLogs();
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ final class DiffusionPushEventViewController
|
||||||
|
|
||||||
$update_box = id(new PHUIObjectBoxView())
|
$update_box = id(new PHUIObjectBoxView())
|
||||||
->setHeaderText(pht('All Pushed Updates'))
|
->setHeaderText(pht('All Pushed Updates'))
|
||||||
->appendChild($updates_table);
|
->setTable($updates_table);
|
||||||
|
|
||||||
return $this->buildApplicationPage(
|
return $this->buildApplicationPage(
|
||||||
array(
|
array(
|
||||||
|
|
|
@ -127,7 +127,7 @@ final class DiffusionRefTableController extends DiffusionController {
|
||||||
|
|
||||||
$content = id(new PHUIObjectBoxView())
|
$content = id(new PHUIObjectBoxView())
|
||||||
->setHeaderText(pht('Ref "%s"', $ref_name))
|
->setHeaderText(pht('Ref "%s"', $ref_name))
|
||||||
->appendChild($table);
|
->setTable($table);
|
||||||
|
|
||||||
$crumbs = $this->buildCrumbs(array());
|
$crumbs = $this->buildCrumbs(array());
|
||||||
$crumbs->addTextCrumb(pht('Refs'));
|
$crumbs->addTextCrumb(pht('Refs'));
|
||||||
|
|
|
@ -397,7 +397,7 @@ final class DiffusionRepositoryController extends DiffusionController {
|
||||||
|
|
||||||
$header->addActionLink($button);
|
$header->addActionLink($button);
|
||||||
$panel->setHeader($header);
|
$panel->setHeader($header);
|
||||||
$panel->appendChild($table);
|
$panel->setTable($table);
|
||||||
|
|
||||||
return $panel;
|
return $panel;
|
||||||
}
|
}
|
||||||
|
@ -572,7 +572,7 @@ final class DiffusionRepositoryController extends DiffusionController {
|
||||||
->setHeader(pht('Recent Commits'))
|
->setHeader(pht('Recent Commits'))
|
||||||
->addActionLink($button);
|
->addActionLink($button);
|
||||||
$panel->setHeader($header);
|
$panel->setHeader($header);
|
||||||
$panel->appendChild($history_table);
|
$panel->setTable($history_table);
|
||||||
|
|
||||||
return $panel;
|
return $panel;
|
||||||
}
|
}
|
||||||
|
@ -658,7 +658,7 @@ final class DiffusionRepositoryController extends DiffusionController {
|
||||||
$browse_panel->appendChild($form_box);
|
$browse_panel->appendChild($form_box);
|
||||||
}
|
}
|
||||||
|
|
||||||
$browse_panel->appendChild($browse_table);
|
$browse_panel->setTable($browse_table);
|
||||||
|
|
||||||
return $browse_panel;
|
return $browse_panel;
|
||||||
}
|
}
|
||||||
|
|
|
@ -132,7 +132,7 @@ final class DiffusionSymbolController extends DiffusionController {
|
||||||
|
|
||||||
$panel = new PHUIObjectBoxView();
|
$panel = new PHUIObjectBoxView();
|
||||||
$panel->setHeaderText(pht('Similar Symbols'));
|
$panel->setHeaderText(pht('Similar Symbols'));
|
||||||
$panel->appendChild($table);
|
$panel->setTable($table);
|
||||||
|
|
||||||
return $this->buildApplicationPage(
|
return $this->buildApplicationPage(
|
||||||
$panel,
|
$panel,
|
||||||
|
|
|
@ -16,6 +16,8 @@ final class PHUIObjectBoxView extends AphrontView {
|
||||||
private $metadata;
|
private $metadata;
|
||||||
private $actionListID;
|
private $actionListID;
|
||||||
private $objectList;
|
private $objectList;
|
||||||
|
private $table;
|
||||||
|
private $collapsed = false;
|
||||||
|
|
||||||
private $tabs = array();
|
private $tabs = array();
|
||||||
private $propertyLists = array();
|
private $propertyLists = array();
|
||||||
|
@ -148,6 +150,17 @@ final class PHUIObjectBoxView extends AphrontView {
|
||||||
$this->objectList = $list;
|
$this->objectList = $list;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setTable($table) {
|
||||||
|
$this->collapsed = true;
|
||||||
|
$this->table = $table;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setCollapsed($collapsed) {
|
||||||
|
$this->collapsed = $collapsed;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
public function setValidationException(
|
public function setValidationException(
|
||||||
PhabricatorApplicationTransactionValidationException $ex = null) {
|
PhabricatorApplicationTransactionValidationException $ex = null) {
|
||||||
|
@ -280,6 +293,7 @@ final class PHUIObjectBoxView extends AphrontView {
|
||||||
$tabs,
|
$tabs,
|
||||||
$tab_lists,
|
$tab_lists,
|
||||||
$property_lists,
|
$property_lists,
|
||||||
|
$this->table,
|
||||||
$this->renderChildren(),
|
$this->renderChildren(),
|
||||||
))
|
))
|
||||||
->setBorder(true)
|
->setBorder(true)
|
||||||
|
@ -292,6 +306,10 @@ final class PHUIObjectBoxView extends AphrontView {
|
||||||
if ($this->color) {
|
if ($this->color) {
|
||||||
$content->addClass('phui-object-box-'.$this->color);
|
$content->addClass('phui-object-box-'.$this->color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->collapsed) {
|
||||||
|
$content->addClass('phui-object-box-collapsed');
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->tabs) {
|
if ($this->tabs) {
|
||||||
$content->addSigil('phui-object-box');
|
$content->addSigil('phui-object-box');
|
||||||
|
|
|
@ -208,7 +208,7 @@ span.single-display-line-content {
|
||||||
}
|
}
|
||||||
|
|
||||||
.aphront-table-view tr.alt-highlighted {
|
.aphront-table-view tr.alt-highlighted {
|
||||||
background: #fcf2bb;
|
background: {$sh-yellowbackground};
|
||||||
}
|
}
|
||||||
|
|
||||||
.aphront-table-view tr.no-data td {
|
.aphront-table-view tr.no-data td {
|
||||||
|
|
|
@ -7,6 +7,14 @@
|
||||||
padding: 12px 12px 4px 12px;
|
padding: 12px 12px 4px 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.phui-object-box.phui-object-box-collapsed {
|
||||||
|
padding: 12px 0 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.phui-object-box.phui-object-box-collapsed .phui-header-shell {
|
||||||
|
padding: 0 4px 4px 16px;
|
||||||
|
}
|
||||||
|
|
||||||
div.phui-object-box.phui-object-box-flush {
|
div.phui-object-box.phui-object-box-flush {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue