mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 03:50:54 +01:00
Add a footer to PHUITwoColumnView
Summary: This allows setting of full-width content underneath the two column, or full column all by itself. Maybe these names are bad. Test Plan: Using these in Differential / Diffusion conversions. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D15455
This commit is contained in:
parent
683fb7101e
commit
e351eba744
1 changed files with 24 additions and 32 deletions
|
@ -8,9 +8,8 @@ final class PHUITwoColumnView extends AphrontTagView {
|
|||
private $fluid;
|
||||
private $header;
|
||||
private $subheader;
|
||||
private $footer;
|
||||
private $propertySection = array();
|
||||
private $actionList;
|
||||
private $propertyList;
|
||||
private $curtain;
|
||||
|
||||
const DISPLAY_LEFT = 'phui-side-column-left';
|
||||
|
@ -36,21 +35,16 @@ final class PHUITwoColumnView extends AphrontTagView {
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function setFooter($footer) {
|
||||
$this->footer = $footer;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addPropertySection($title, $section) {
|
||||
$this->propertySection[] = array($title, $section);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setActionList(PhabricatorActionListView $list) {
|
||||
$this->actionList = $list;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setPropertyList(PHUIPropertyListView $list) {
|
||||
$this->propertyList = $list;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setCurtain(PHUICurtainView $curtain) {
|
||||
$this->curtain = $curtain;
|
||||
return $this;
|
||||
|
@ -101,6 +95,8 @@ final class PHUITwoColumnView extends AphrontTagView {
|
|||
|
||||
$main = $this->buildMainColumn();
|
||||
$side = $this->buildSideColumn();
|
||||
$footer = $this->buildFooter();
|
||||
|
||||
$order = array($side, $main);
|
||||
|
||||
$inner = phutil_tag_div('phui-two-column-row grouped', $order);
|
||||
|
@ -111,11 +107,6 @@ final class PHUITwoColumnView extends AphrontTagView {
|
|||
$curtain = $this->getCurtain();
|
||||
if ($curtain) {
|
||||
$action_list = $curtain->getActionList();
|
||||
} else {
|
||||
$action_list = $this->actionList;
|
||||
}
|
||||
|
||||
if ($action_list) {
|
||||
$this->header->setActionList($action_list);
|
||||
}
|
||||
|
||||
|
@ -138,6 +129,7 @@ final class PHUITwoColumnView extends AphrontTagView {
|
|||
$header,
|
||||
$subheader,
|
||||
$table,
|
||||
$footer,
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -169,20 +161,6 @@ final class PHUITwoColumnView extends AphrontTagView {
|
|||
}
|
||||
|
||||
private function buildSideColumn() {
|
||||
$property_list = $this->propertyList;
|
||||
$action_list = $this->actionList;
|
||||
|
||||
$properties = null;
|
||||
if ($property_list || $action_list) {
|
||||
if ($property_list) {
|
||||
$property_list->setStacked(true);
|
||||
}
|
||||
|
||||
$properties = id(new PHUIObjectBoxView())
|
||||
->appendChild($action_list)
|
||||
->appendChild($property_list)
|
||||
->addClass('phui-two-column-properties');
|
||||
}
|
||||
|
||||
$curtain = $this->getCurtain();
|
||||
|
||||
|
@ -192,9 +170,23 @@ final class PHUITwoColumnView extends AphrontTagView {
|
|||
'class' => 'phui-side-column',
|
||||
),
|
||||
array(
|
||||
$properties,
|
||||
$curtain,
|
||||
$this->sideColumn,
|
||||
));
|
||||
}
|
||||
|
||||
private function buildFooter() {
|
||||
|
||||
$footer = $this->footer;
|
||||
|
||||
return phutil_tag(
|
||||
'div',
|
||||
array(
|
||||
'class' => 'phui-two-column-content phui-two-column-footer',
|
||||
),
|
||||
array(
|
||||
$footer,
|
||||
));
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue