[Redesign] Add Table, Collapse support to ObjectBox

This commit is contained in:
Chad Little
2015-05-19 23:14:22 -07:00
parent fa858cc8fd
commit 667159eb07
18 changed files with 46 additions and 22 deletions

View File

@@ -837,9 +837,7 @@ final class DifferentialRevisionViewController extends DifferentialController {
$viewer = $this->getViewer();
$header = id(new PHUIHeaderView())
->setHeader(pht('Similar Open Revisions'))
->setSubheader(
pht('Recently updated open revisions affecting the same files.'));
->setHeader(pht('Recent Similar Open Revisions'));
$view = id(new DifferentialRevisionListView())
->setHeader($header)

View File

@@ -251,8 +251,8 @@ final class DifferentialDiffTableOfContentsView extends AphrontView {
return id(new PHUIObjectBoxView())
->setHeaderText(pht('Table of Contents'))
->setTable($table)
->appendChild($anchor)
->appendChild($table)
->appendChild($buttons);
}

View File

@@ -130,7 +130,7 @@ final class DifferentialLocalCommitsView extends AphrontView {
return id(new PHUIObjectBoxView())
->setHeaderText(pht('Local Commits'))
->appendChild($table);
->setTable($table);
}
private static function formatCommit($commit) {

View File

@@ -47,7 +47,7 @@ final class DiffusionBranchTableController extends DiffusionController {
$panel = id(new PHUIObjectBoxView())
->setHeaderText(pht('Branches'))
->appendChild($view);
->setTable($view);
$content = $panel;
}

View File

@@ -59,7 +59,7 @@ final class DiffusionBrowseDirectoryController
$browse_panel = new PHUIObjectBoxView();
$browse_panel->setHeaderText($drequest->getPath(), '/');
$browse_panel->appendChild($browse_table);
$browse_panel->setTable($browse_table);
$content[] = $browse_panel;
}

View File

@@ -103,7 +103,7 @@ final class DiffusionBrowseSearchController extends DiffusionBrowseController {
$box = id(new PHUIObjectBoxView())
->setHeaderText($header)
->appendChild($table);
->setTable($table);
$pager_box = id(new PHUIBoxView())
->addMargin(PHUI::MARGIN_LARGE)

View File

@@ -261,7 +261,7 @@ final class DiffusionCommitController extends DiffusionController {
$header->addActionLink($button);
}
$change_panel->appendChild($change_table);
$change_panel->setTable($change_table);
$change_panel->setHeader($header);
$content[] = $change_panel;
@@ -918,7 +918,7 @@ final class DiffusionCommitController extends DiffusionController {
$panel = new PHUIObjectBoxView();
$panel->setHeaderText(pht('Merged Changes'));
$panel->appendChild($history_table);
$panel->setTable($history_table);
if ($caption) {
$panel->setInfoView($caption);
}

View File

@@ -132,7 +132,7 @@ final class DiffusionExternalController extends DiffusionController {
$content = new PHUIObjectBoxView();
$content->setHeaderText(pht('Multiple Matching Commits'));
$content->setInfoView($caption);
$content->appendChild($table);
$content->setTable($table);
}
return $this->buildApplicationPage(

View File

@@ -59,7 +59,7 @@ final class DiffusionHistoryController extends DiffusionController {
$history_panel = new PHUIObjectBoxView();
$history_panel->setHeaderText(pht('History'));
$history_panel->appendChild($history_table);
$history_panel->setTable($history_table);
$content[] = $history_panel;

View File

@@ -122,7 +122,7 @@ final class DiffusionLintController extends DiffusionController {
$content[] = id(new PHUIObjectBoxView())
->setHeaderText(pht('Lint'))
->appendChild($table);
->setTable($table);
$title = array('Lint');
$crumbs = $this->buildCrumbs(

View File

@@ -74,7 +74,7 @@ final class DiffusionLintDetailsController extends DiffusionController {
$content[] = id(new PHUIObjectBoxView())
->setHeaderText(pht('Lint Details'))
->appendChild($table);
->setTable($table);
$crumbs = $this->buildCrumbs(
array(

View File

@@ -43,7 +43,7 @@ final class DiffusionPushEventViewController
$commits_box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Pushed Commits'))
->appendChild($commits_table);
->setTable($commits_table);
$logs = $event->getLogs();
@@ -54,7 +54,7 @@ final class DiffusionPushEventViewController
$update_box = id(new PHUIObjectBoxView())
->setHeaderText(pht('All Pushed Updates'))
->appendChild($updates_table);
->setTable($updates_table);
return $this->buildApplicationPage(
array(

View File

@@ -127,7 +127,7 @@ final class DiffusionRefTableController extends DiffusionController {
$content = id(new PHUIObjectBoxView())
->setHeaderText(pht('Ref "%s"', $ref_name))
->appendChild($table);
->setTable($table);
$crumbs = $this->buildCrumbs(array());
$crumbs->addTextCrumb(pht('Refs'));

View File

@@ -397,7 +397,7 @@ final class DiffusionRepositoryController extends DiffusionController {
$header->addActionLink($button);
$panel->setHeader($header);
$panel->appendChild($table);
$panel->setTable($table);
return $panel;
}
@@ -572,7 +572,7 @@ final class DiffusionRepositoryController extends DiffusionController {
->setHeader(pht('Recent Commits'))
->addActionLink($button);
$panel->setHeader($header);
$panel->appendChild($history_table);
$panel->setTable($history_table);
return $panel;
}
@@ -658,7 +658,7 @@ final class DiffusionRepositoryController extends DiffusionController {
$browse_panel->appendChild($form_box);
}
$browse_panel->appendChild($browse_table);
$browse_panel->setTable($browse_table);
return $browse_panel;
}

View File

@@ -132,7 +132,7 @@ final class DiffusionSymbolController extends DiffusionController {
$panel = new PHUIObjectBoxView();
$panel->setHeaderText(pht('Similar Symbols'));
$panel->appendChild($table);
$panel->setTable($table);
return $this->buildApplicationPage(
$panel,

View File

@@ -16,6 +16,8 @@ final class PHUIObjectBoxView extends AphrontView {
private $metadata;
private $actionListID;
private $objectList;
private $table;
private $collapsed = false;
private $tabs = array();
private $propertyLists = array();
@@ -149,6 +151,17 @@ final class PHUIObjectBoxView extends AphrontView {
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(
PhabricatorApplicationTransactionValidationException $ex = null) {
$this->validationException = $ex;
@@ -280,6 +293,7 @@ final class PHUIObjectBoxView extends AphrontView {
$tabs,
$tab_lists,
$property_lists,
$this->table,
$this->renderChildren(),
))
->setBorder(true)
@@ -293,6 +307,10 @@ final class PHUIObjectBoxView extends AphrontView {
$content->addClass('phui-object-box-'.$this->color);
}
if ($this->collapsed) {
$content->addClass('phui-object-box-collapsed');
}
if ($this->tabs) {
$content->addSigil('phui-object-box');
$content->setMetadata(

View File

@@ -208,7 +208,7 @@ span.single-display-line-content {
}
.aphront-table-view tr.alt-highlighted {
background: #fcf2bb;
background: {$sh-yellowbackground};
}
.aphront-table-view tr.no-data td {

View File

@@ -7,6 +7,14 @@
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 {
margin-top: 0;
}