2013-08-26 20:53:11 +02:00
|
|
|
<?php
|
|
|
|
|
2013-09-25 20:23:29 +02:00
|
|
|
final class PHUIObjectBoxView extends AphrontView {
|
2013-08-26 20:53:11 +02:00
|
|
|
|
|
|
|
private $headerText;
|
2015-05-20 01:47:48 +02:00
|
|
|
private $color;
|
2014-01-10 18:17:37 +01:00
|
|
|
private $formErrors = null;
|
|
|
|
private $formSaved = false;
|
2015-03-07 02:03:18 +01:00
|
|
|
private $infoView;
|
2013-08-26 20:53:11 +02:00
|
|
|
private $form;
|
2013-09-19 00:31:58 +02:00
|
|
|
private $validationException;
|
2013-09-29 00:55:38 +02:00
|
|
|
private $header;
|
|
|
|
private $flush;
|
2014-01-09 17:51:57 +01:00
|
|
|
private $id;
|
2014-04-18 15:44:45 +02:00
|
|
|
private $sigils = array();
|
|
|
|
private $metadata;
|
2015-01-12 16:24:35 +01:00
|
|
|
private $actionListID;
|
[Redesign] New PHUIObjectItemListView
Summary:
New, cleaner, ObjectItemLists. Lots of minor style tweaks, basic overview:
- Remove FootIcons
- Remove Stackable
- Remove Plain List
- Add StatusIcon
- Add setting ObjectList to an ObjectBox
- Minor retouches to Headers
Mostly, this should give us an idea of life with the new Object Lists. I'll take another application by application pass down the road. This mostly looks at implementation in Maniphest, Differential, Audit, Workboards. Checked a few other areas and dialogs while testing, and everything looks square.
Test Plan: Maniphest, Differential, Homepage, Audit, People, and other applications. Drag reorder, etc.
Reviewers: btrahan, epriestley
Reviewed By: epriestley
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12865
2015-05-15 22:28:59 +02:00
|
|
|
private $objectList;
|
2015-05-20 08:14:22 +02:00
|
|
|
private $table;
|
|
|
|
private $collapsed = false;
|
2015-05-27 02:35:18 +02:00
|
|
|
private $anchor;
|
|
|
|
|
|
|
|
private $showAction;
|
|
|
|
private $hideAction;
|
|
|
|
private $showHideHref;
|
|
|
|
private $showHideContent;
|
2015-06-16 22:10:24 +02:00
|
|
|
private $showHideOpen;
|
Provide more structure to PHUIObjectBoxView
Summary:
Three changes here.
- Add `setActionList()`, and use that to set the action list.
- Add `setPropertyList()`, and use that to set the property list.
These will let us add some apropriate CSS so we can fix the border issue, and get rid of a bunch of goofy `.x + .y` selectors.
- Replace `addContent()` with `appendChild()`.
This is just a consistency thing; `AphrontView` already provides `appendChild()`, and `addContent()` did the same thing.
Test Plan:
- Viewed "All Config".
- Viewed a countdown.
- Viewed a revision (add comment, change list, table of contents, comment, local commits, open revisions affecting these files, update history).
- Viewed Diffusion (browse, change, history, repository, lint).
- Viewed Drydock (resource, lease).
- Viewed Files.
- Viewed Herald.
- Viewed Legalpad.
- Viewed macro (edit, edit audio, view).
- Viewed Maniphest.
- Viewed Applications.
- Viewed Paste.
- Viewed People.
- Viewed Phulux.
- Viewed Pholio.
- Viewed Phame (blog, post).
- Viewed Phortune (account, product).
- Viewed Ponder (questions, answers, comments).
- Viewed Releeph.
- Viewed Projects.
- Viewed Slowvote.
NOTE: Images in Files aren't on a black background anymore -- I assume that's on purpose?
NOTE: Some jankiness in Phortune, I'll clean that up when I get back to it. Not related to this diff.
Reviewers: chad
Reviewed By: chad
CC: aran
Differential Revision: https://secure.phabricator.com/D7174
2013-09-30 18:36:04 +02:00
|
|
|
|
2013-10-19 21:07:50 +02:00
|
|
|
private $tabs = array();
|
|
|
|
private $propertyLists = array();
|
|
|
|
|
2015-05-20 01:47:48 +02:00
|
|
|
const COLOR_RED = 'red';
|
|
|
|
const COLOR_BLUE = 'blue';
|
|
|
|
const COLOR_GREEN = 'green';
|
|
|
|
const COLOR_YELLOW = 'yellow';
|
|
|
|
|
2014-04-18 15:44:45 +02:00
|
|
|
public function addSigil($sigil) {
|
|
|
|
$this->sigils[] = $sigil;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setMetadata(array $metadata) {
|
|
|
|
$this->metadata = $metadata;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2013-10-19 21:07:50 +02:00
|
|
|
public function addPropertyList(
|
|
|
|
PHUIPropertyListView $property_list,
|
2013-10-19 21:08:06 +02:00
|
|
|
$tab = null) {
|
2013-10-19 21:07:50 +02:00
|
|
|
|
2013-10-19 21:08:06 +02:00
|
|
|
if (!($tab instanceof PHUIListItemView) &&
|
|
|
|
($tab !== null)) {
|
|
|
|
assert_stringlike($tab);
|
|
|
|
$tab = id(new PHUIListItemView())->setName($tab);
|
2013-10-19 21:07:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($tab) {
|
|
|
|
if ($tab->getKey()) {
|
|
|
|
$key = $tab->getKey();
|
|
|
|
} else {
|
|
|
|
$key = 'tab.default.'.spl_object_hash($tab);
|
|
|
|
$tab->setKey($key);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$key = 'tab.default';
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($tab) {
|
|
|
|
if (empty($this->tabs[$key])) {
|
|
|
|
$tab->addSigil('phui-object-box-tab');
|
|
|
|
$tab->setMetadata(
|
|
|
|
array(
|
|
|
|
'tabKey' => $key,
|
|
|
|
));
|
|
|
|
|
|
|
|
if (!$tab->getHref()) {
|
|
|
|
$tab->setHref('#');
|
|
|
|
}
|
|
|
|
|
2013-10-19 21:08:06 +02:00
|
|
|
if (!$tab->getType()) {
|
|
|
|
$tab->setType(PHUIListItemView::TYPE_LINK);
|
|
|
|
}
|
|
|
|
|
2013-10-19 21:07:50 +02:00
|
|
|
$this->tabs[$key] = $tab;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->propertyLists[$key][] = $property_list;
|
|
|
|
|
2015-01-12 16:24:35 +01:00
|
|
|
$action_list = $property_list->getActionList();
|
|
|
|
if ($action_list) {
|
|
|
|
$this->actionListID = celerity_generate_unique_node_id();
|
|
|
|
$action_list->setId($this->actionListID);
|
|
|
|
}
|
|
|
|
|
Provide more structure to PHUIObjectBoxView
Summary:
Three changes here.
- Add `setActionList()`, and use that to set the action list.
- Add `setPropertyList()`, and use that to set the property list.
These will let us add some apropriate CSS so we can fix the border issue, and get rid of a bunch of goofy `.x + .y` selectors.
- Replace `addContent()` with `appendChild()`.
This is just a consistency thing; `AphrontView` already provides `appendChild()`, and `addContent()` did the same thing.
Test Plan:
- Viewed "All Config".
- Viewed a countdown.
- Viewed a revision (add comment, change list, table of contents, comment, local commits, open revisions affecting these files, update history).
- Viewed Diffusion (browse, change, history, repository, lint).
- Viewed Drydock (resource, lease).
- Viewed Files.
- Viewed Herald.
- Viewed Legalpad.
- Viewed macro (edit, edit audio, view).
- Viewed Maniphest.
- Viewed Applications.
- Viewed Paste.
- Viewed People.
- Viewed Phulux.
- Viewed Pholio.
- Viewed Phame (blog, post).
- Viewed Phortune (account, product).
- Viewed Ponder (questions, answers, comments).
- Viewed Releeph.
- Viewed Projects.
- Viewed Slowvote.
NOTE: Images in Files aren't on a black background anymore -- I assume that's on purpose?
NOTE: Some jankiness in Phortune, I'll clean that up when I get back to it. Not related to this diff.
Reviewers: chad
Reviewed By: chad
CC: aran
Differential Revision: https://secure.phabricator.com/D7174
2013-09-30 18:36:04 +02:00
|
|
|
return $this;
|
|
|
|
}
|
2013-08-26 20:53:11 +02:00
|
|
|
|
|
|
|
public function setHeaderText($text) {
|
|
|
|
$this->headerText = $text;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2015-05-20 01:47:48 +02:00
|
|
|
public function setColor($color) {
|
|
|
|
$this->color = $color;
|
2014-06-24 18:39:32 +02:00
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2014-01-10 18:17:37 +01:00
|
|
|
public function setFormErrors(array $errors, $title = null) {
|
2014-10-10 01:58:26 +02:00
|
|
|
if ($errors) {
|
2015-03-01 23:45:56 +01:00
|
|
|
$this->formErrors = id(new PHUIInfoView())
|
2014-01-10 18:17:37 +01:00
|
|
|
->setTitle($title)
|
|
|
|
->setErrors($errors);
|
|
|
|
}
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setFormSaved($saved, $text = null) {
|
|
|
|
if (!$text) {
|
|
|
|
$text = pht('Changes saved.');
|
|
|
|
}
|
|
|
|
if ($saved) {
|
2015-03-01 23:45:56 +01:00
|
|
|
$save = id(new PHUIInfoView())
|
|
|
|
->setSeverity(PHUIInfoView::SEVERITY_NOTICE)
|
2014-01-10 18:17:37 +01:00
|
|
|
->appendChild($text);
|
|
|
|
$this->formSaved = $save;
|
|
|
|
}
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2015-03-07 02:03:18 +01:00
|
|
|
public function setInfoView(PHUIInfoView $view) {
|
|
|
|
$this->infoView = $view;
|
2013-08-26 20:53:11 +02:00
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2013-08-27 00:45:58 +02:00
|
|
|
public function setForm($form) {
|
2013-08-26 20:53:11 +02:00
|
|
|
$this->form = $form;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2014-01-09 17:51:57 +01:00
|
|
|
public function setID($id) {
|
|
|
|
$this->id = $id;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2014-06-24 18:39:32 +02:00
|
|
|
public function setHeader($header) {
|
2013-09-29 00:55:38 +02:00
|
|
|
$this->header = $header;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setFlush($flush) {
|
|
|
|
$this->flush = $flush;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
[Redesign] New PHUIObjectItemListView
Summary:
New, cleaner, ObjectItemLists. Lots of minor style tweaks, basic overview:
- Remove FootIcons
- Remove Stackable
- Remove Plain List
- Add StatusIcon
- Add setting ObjectList to an ObjectBox
- Minor retouches to Headers
Mostly, this should give us an idea of life with the new Object Lists. I'll take another application by application pass down the road. This mostly looks at implementation in Maniphest, Differential, Audit, Workboards. Checked a few other areas and dialogs while testing, and everything looks square.
Test Plan: Maniphest, Differential, Homepage, Audit, People, and other applications. Drag reorder, etc.
Reviewers: btrahan, epriestley
Reviewed By: epriestley
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12865
2015-05-15 22:28:59 +02:00
|
|
|
public function setObjectList($list) {
|
|
|
|
$this->objectList = $list;
|
|
|
|
return $this;
|
|
|
|
}
|
[Redesign] Add Table, Collapse support to ObjectBox
Summary: Converts most all tables to be directly set via `setTable` to an ObjectBox. I think this path is more flexible design wise, as we can change the box based on children, and not just CSS. We also already do this with PropertyList, Forms, ObjectList, and Header. `setCollapsed` is added to ObjectBox to all children objects to bleed to the edges (like diffs).
Test Plan: I did a grep of `appendChild($table)` as well as searches for `PHUIObjectBoxView`, also with manual opening of hundreds of files. I'm sure I missed 5-8 places. If you just appendChild($table) nothing breaks, it just looks a little funny.
Reviewers: epriestley, btrahan
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12955
2015-05-20 21:43:34 +02:00
|
|
|
|
2015-05-20 08:14:22 +02:00
|
|
|
public function setTable($table) {
|
|
|
|
$this->collapsed = true;
|
|
|
|
$this->table = $table;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setCollapsed($collapsed) {
|
|
|
|
$this->collapsed = $collapsed;
|
|
|
|
return $this;
|
|
|
|
}
|
[Redesign] New PHUIObjectItemListView
Summary:
New, cleaner, ObjectItemLists. Lots of minor style tweaks, basic overview:
- Remove FootIcons
- Remove Stackable
- Remove Plain List
- Add StatusIcon
- Add setting ObjectList to an ObjectBox
- Minor retouches to Headers
Mostly, this should give us an idea of life with the new Object Lists. I'll take another application by application pass down the road. This mostly looks at implementation in Maniphest, Differential, Audit, Workboards. Checked a few other areas and dialogs while testing, and everything looks square.
Test Plan: Maniphest, Differential, Homepage, Audit, People, and other applications. Drag reorder, etc.
Reviewers: btrahan, epriestley
Reviewed By: epriestley
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12865
2015-05-15 22:28:59 +02:00
|
|
|
|
2015-05-27 02:35:18 +02:00
|
|
|
public function setAnchor(PhabricatorAnchorView $anchor) {
|
|
|
|
$this->anchor = $anchor;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2015-06-16 22:10:24 +02:00
|
|
|
public function setShowHide($show, $hide, $content, $href, $open = false) {
|
2015-05-27 02:35:18 +02:00
|
|
|
$this->showAction = $show;
|
|
|
|
$this->hideAction = $hide;
|
|
|
|
$this->showHideContent = $content;
|
|
|
|
$this->showHideHref = $href;
|
2015-06-16 22:10:24 +02:00
|
|
|
$this->showHideOpen = $open;
|
2015-05-27 02:35:18 +02:00
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2013-09-19 00:31:58 +02:00
|
|
|
public function setValidationException(
|
|
|
|
PhabricatorApplicationTransactionValidationException $ex = null) {
|
|
|
|
$this->validationException = $ex;
|
|
|
|
return $this;
|
|
|
|
}
|
2013-08-26 20:53:11 +02:00
|
|
|
|
2013-09-19 00:31:58 +02:00
|
|
|
public function render() {
|
2013-08-26 20:53:11 +02:00
|
|
|
|
2013-09-29 00:55:38 +02:00
|
|
|
require_celerity_resource('phui-object-box-css');
|
|
|
|
|
2015-05-20 01:47:48 +02:00
|
|
|
$header = $this->header;
|
|
|
|
if ($this->headerText) {
|
2013-09-29 00:55:38 +02:00
|
|
|
$header = id(new PHUIHeaderView())
|
2015-05-20 01:47:48 +02:00
|
|
|
->setHeader($this->headerText);
|
2013-09-29 00:55:38 +02:00
|
|
|
}
|
2013-08-26 20:53:11 +02:00
|
|
|
|
2015-05-27 02:35:18 +02:00
|
|
|
$showhide = null;
|
|
|
|
if ($this->showAction !== null) {
|
|
|
|
Javelin::initBehavior('phabricator-reveal-content');
|
|
|
|
|
|
|
|
$hide_action_id = celerity_generate_unique_node_id();
|
|
|
|
$show_action_id = celerity_generate_unique_node_id();
|
|
|
|
$content_id = celerity_generate_unique_node_id();
|
|
|
|
|
2015-06-16 22:10:24 +02:00
|
|
|
$hide_style = ($this->showHideOpen ? 'display: none;': null);
|
|
|
|
$show_style = ($this->showHideOpen ? null : 'display: none;');
|
2015-05-27 02:35:18 +02:00
|
|
|
$hide_action = id(new PHUIButtonView())
|
|
|
|
->setTag('a')
|
|
|
|
->addSigil('reveal-content')
|
|
|
|
->setID($hide_action_id)
|
2015-06-16 22:10:24 +02:00
|
|
|
->setStyle($hide_style)
|
2015-05-27 02:35:18 +02:00
|
|
|
->setHref($this->showHideHref)
|
|
|
|
->setMetaData(
|
|
|
|
array(
|
|
|
|
'hideIDs' => array($hide_action_id),
|
|
|
|
'showIDs' => array($content_id, $show_action_id),
|
|
|
|
))
|
|
|
|
->setText($this->showAction);
|
|
|
|
|
|
|
|
$show_action = id(new PHUIButtonView())
|
|
|
|
->setTag('a')
|
|
|
|
->addSigil('reveal-content')
|
2015-06-16 22:10:24 +02:00
|
|
|
->setStyle($show_style)
|
2015-05-27 02:35:18 +02:00
|
|
|
->setHref('#')
|
|
|
|
->setID($show_action_id)
|
|
|
|
->setMetaData(
|
|
|
|
array(
|
|
|
|
'hideIDs' => array($content_id, $show_action_id),
|
|
|
|
'showIDs' => array($hide_action_id),
|
|
|
|
))
|
|
|
|
->setText($this->hideAction);
|
|
|
|
|
|
|
|
$header->addActionLink($hide_action);
|
|
|
|
$header->addActionLink($show_action);
|
|
|
|
|
|
|
|
$showhide = array(
|
|
|
|
phutil_tag(
|
|
|
|
'div',
|
|
|
|
array(
|
|
|
|
'class' => 'phui-object-box-hidden-content',
|
|
|
|
'id' => $content_id,
|
2015-06-16 22:10:24 +02:00
|
|
|
'style' => $show_style,
|
2015-05-27 02:35:18 +02:00
|
|
|
),
|
|
|
|
$this->showHideContent),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-01-12 16:24:35 +01:00
|
|
|
if ($this->actionListID) {
|
|
|
|
$icon_id = celerity_generate_unique_node_id();
|
|
|
|
$icon = id(new PHUIIconView())
|
|
|
|
->setIconFont('fa-bars');
|
|
|
|
$meta = array(
|
|
|
|
'map' => array(
|
|
|
|
$this->actionListID => 'phabricator-action-list-toggle',
|
2015-01-12 17:21:17 +01:00
|
|
|
$icon_id => 'phuix-dropdown-open',
|
2015-04-05 14:29:39 +02:00
|
|
|
),
|
|
|
|
);
|
2015-01-12 16:24:35 +01:00
|
|
|
$mobile_menu = id(new PHUIButtonView())
|
|
|
|
->setTag('a')
|
|
|
|
->setText(pht('Actions'))
|
|
|
|
->setHref('#')
|
|
|
|
->setIcon($icon)
|
|
|
|
->addClass('phui-mobile-menu')
|
|
|
|
->setID($icon_id)
|
2015-01-12 17:21:17 +01:00
|
|
|
->addSigil('jx-toggle-class')
|
|
|
|
->setMetadata($meta);
|
2015-01-12 16:24:35 +01:00
|
|
|
$header->addActionLink($mobile_menu);
|
|
|
|
}
|
|
|
|
|
2013-09-19 00:31:58 +02:00
|
|
|
$ex = $this->validationException;
|
|
|
|
$exception_errors = null;
|
|
|
|
if ($ex) {
|
|
|
|
$messages = array();
|
|
|
|
foreach ($ex->getErrors() as $error) {
|
|
|
|
$messages[] = $error->getMessage();
|
|
|
|
}
|
|
|
|
if ($messages) {
|
2015-03-01 23:45:56 +01:00
|
|
|
$exception_errors = id(new PHUIInfoView())
|
2013-09-19 00:31:58 +02:00
|
|
|
->setErrors($messages);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-10-19 21:08:06 +02:00
|
|
|
$tab_lists = array();
|
2013-10-19 21:07:50 +02:00
|
|
|
$property_lists = array();
|
|
|
|
$tab_map = array();
|
2013-10-19 21:08:06 +02:00
|
|
|
|
|
|
|
$default_key = 'tab.default';
|
|
|
|
|
|
|
|
// Find the selected tab, or select the first tab if none are selected.
|
|
|
|
if ($this->tabs) {
|
|
|
|
$selected_tab = null;
|
|
|
|
foreach ($this->tabs as $key => $tab) {
|
|
|
|
if ($tab->getSelected()) {
|
|
|
|
$selected_tab = $key;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($selected_tab === null) {
|
|
|
|
head($this->tabs)->setSelected(true);
|
|
|
|
$selected_tab = head_key($this->tabs);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-10-19 21:07:50 +02:00
|
|
|
foreach ($this->propertyLists as $key => $list) {
|
|
|
|
$group = new PHUIPropertyGroupView();
|
2013-11-04 17:52:46 +01:00
|
|
|
$i = 0;
|
2013-10-19 21:07:50 +02:00
|
|
|
foreach ($list as $item) {
|
|
|
|
$group->addPropertyList($item);
|
2013-11-04 17:52:46 +01:00
|
|
|
if ($i > 0) {
|
|
|
|
$item->addClass('phui-property-list-section-noninitial');
|
|
|
|
}
|
|
|
|
$i++;
|
2013-10-19 21:07:50 +02:00
|
|
|
}
|
|
|
|
|
2013-10-19 21:08:06 +02:00
|
|
|
if ($this->tabs && $key != $default_key) {
|
2013-10-19 21:07:50 +02:00
|
|
|
$tab_id = celerity_generate_unique_node_id();
|
|
|
|
$tab_map[$key] = $tab_id;
|
|
|
|
|
2013-10-19 21:08:06 +02:00
|
|
|
if ($key === $selected_tab) {
|
2013-10-19 21:07:50 +02:00
|
|
|
$style = null;
|
|
|
|
} else {
|
|
|
|
$style = 'display: none';
|
|
|
|
}
|
|
|
|
|
2013-10-19 21:08:06 +02:00
|
|
|
$tab_lists[] = phutil_tag(
|
2013-10-19 21:07:50 +02:00
|
|
|
'div',
|
|
|
|
array(
|
|
|
|
'style' => $style,
|
|
|
|
'id' => $tab_id,
|
|
|
|
),
|
|
|
|
$group);
|
|
|
|
} else {
|
2013-10-19 21:08:06 +02:00
|
|
|
if ($this->tabs) {
|
|
|
|
$group->addClass('phui-property-group-noninitial');
|
|
|
|
}
|
2013-10-19 21:07:50 +02:00
|
|
|
$property_lists[] = $group;
|
2013-10-11 16:53:56 +02:00
|
|
|
}
|
2013-10-06 20:12:00 +02:00
|
|
|
}
|
|
|
|
|
2013-10-19 21:07:50 +02:00
|
|
|
$tabs = null;
|
|
|
|
if ($this->tabs) {
|
|
|
|
$tabs = id(new PHUIListView())
|
|
|
|
->setType(PHUIListView::NAVBAR_LIST);
|
|
|
|
foreach ($this->tabs as $tab) {
|
|
|
|
$tabs->addMenuItem($tab);
|
|
|
|
}
|
|
|
|
|
|
|
|
Javelin::initBehavior('phui-object-box-tabs');
|
|
|
|
}
|
|
|
|
|
2013-08-26 20:53:11 +02:00
|
|
|
$content = id(new PHUIBoxView())
|
2013-09-19 00:31:58 +02:00
|
|
|
->appendChild(
|
|
|
|
array(
|
2015-06-16 22:10:24 +02:00
|
|
|
($this->showHideOpen == false ? $this->anchor : null),
|
2013-09-19 00:31:58 +02:00
|
|
|
$header,
|
2015-03-07 02:03:18 +01:00
|
|
|
$this->infoView,
|
2014-01-10 18:17:37 +01:00
|
|
|
$this->formErrors,
|
|
|
|
$this->formSaved,
|
2013-09-19 00:31:58 +02:00
|
|
|
$exception_errors,
|
|
|
|
$this->form,
|
2013-10-19 21:07:50 +02:00
|
|
|
$tabs,
|
2013-10-19 21:08:06 +02:00
|
|
|
$tab_lists,
|
2015-05-27 02:35:18 +02:00
|
|
|
$showhide,
|
2015-06-16 22:10:24 +02:00
|
|
|
($this->showHideOpen == true ? $this->anchor : null),
|
2013-10-19 21:07:50 +02:00
|
|
|
$property_lists,
|
2015-05-20 08:14:22 +02:00
|
|
|
$this->table,
|
Provide more structure to PHUIObjectBoxView
Summary:
Three changes here.
- Add `setActionList()`, and use that to set the action list.
- Add `setPropertyList()`, and use that to set the property list.
These will let us add some apropriate CSS so we can fix the border issue, and get rid of a bunch of goofy `.x + .y` selectors.
- Replace `addContent()` with `appendChild()`.
This is just a consistency thing; `AphrontView` already provides `appendChild()`, and `addContent()` did the same thing.
Test Plan:
- Viewed "All Config".
- Viewed a countdown.
- Viewed a revision (add comment, change list, table of contents, comment, local commits, open revisions affecting these files, update history).
- Viewed Diffusion (browse, change, history, repository, lint).
- Viewed Drydock (resource, lease).
- Viewed Files.
- Viewed Herald.
- Viewed Legalpad.
- Viewed macro (edit, edit audio, view).
- Viewed Maniphest.
- Viewed Applications.
- Viewed Paste.
- Viewed People.
- Viewed Phulux.
- Viewed Pholio.
- Viewed Phame (blog, post).
- Viewed Phortune (account, product).
- Viewed Ponder (questions, answers, comments).
- Viewed Releeph.
- Viewed Projects.
- Viewed Slowvote.
NOTE: Images in Files aren't on a black background anymore -- I assume that's on purpose?
NOTE: Some jankiness in Phortune, I'll clean that up when I get back to it. Not related to this diff.
Reviewers: chad
Reviewed By: chad
CC: aran
Differential Revision: https://secure.phabricator.com/D7174
2013-09-30 18:36:04 +02:00
|
|
|
$this->renderChildren(),
|
2013-09-19 00:31:58 +02:00
|
|
|
))
|
2013-08-26 20:53:11 +02:00
|
|
|
->setBorder(true)
|
2014-01-09 17:51:57 +01:00
|
|
|
->setID($this->id)
|
2013-08-26 20:53:11 +02:00
|
|
|
->addMargin(PHUI::MARGIN_LARGE_TOP)
|
|
|
|
->addMargin(PHUI::MARGIN_LARGE_LEFT)
|
|
|
|
->addMargin(PHUI::MARGIN_LARGE_RIGHT)
|
2013-09-25 20:23:29 +02:00
|
|
|
->addClass('phui-object-box');
|
2013-08-26 20:53:11 +02:00
|
|
|
|
2015-05-20 01:47:48 +02:00
|
|
|
if ($this->color) {
|
|
|
|
$content->addClass('phui-object-box-'.$this->color);
|
|
|
|
}
|
[Redesign] Add Table, Collapse support to ObjectBox
Summary: Converts most all tables to be directly set via `setTable` to an ObjectBox. I think this path is more flexible design wise, as we can change the box based on children, and not just CSS. We also already do this with PropertyList, Forms, ObjectList, and Header. `setCollapsed` is added to ObjectBox to all children objects to bleed to the edges (like diffs).
Test Plan: I did a grep of `appendChild($table)` as well as searches for `PHUIObjectBoxView`, also with manual opening of hundreds of files. I'm sure I missed 5-8 places. If you just appendChild($table) nothing breaks, it just looks a little funny.
Reviewers: epriestley, btrahan
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12955
2015-05-20 21:43:34 +02:00
|
|
|
|
2015-05-20 08:14:22 +02:00
|
|
|
if ($this->collapsed) {
|
|
|
|
$content->addClass('phui-object-box-collapsed');
|
|
|
|
}
|
2015-05-20 01:47:48 +02:00
|
|
|
|
2013-10-19 21:07:50 +02:00
|
|
|
if ($this->tabs) {
|
|
|
|
$content->addSigil('phui-object-box');
|
|
|
|
$content->setMetadata(
|
|
|
|
array(
|
|
|
|
'tabMap' => $tab_map,
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
2013-09-29 00:55:38 +02:00
|
|
|
if ($this->flush) {
|
|
|
|
$content->addClass('phui-object-box-flush');
|
|
|
|
}
|
2013-08-26 20:53:11 +02:00
|
|
|
|
2014-04-18 15:44:45 +02:00
|
|
|
foreach ($this->sigils as $sigil) {
|
|
|
|
$content->addSigil($sigil);
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($this->metadata !== null) {
|
|
|
|
$content->setMetadata($this->metadata);
|
|
|
|
}
|
|
|
|
|
[Redesign] New PHUIObjectItemListView
Summary:
New, cleaner, ObjectItemLists. Lots of minor style tweaks, basic overview:
- Remove FootIcons
- Remove Stackable
- Remove Plain List
- Add StatusIcon
- Add setting ObjectList to an ObjectBox
- Minor retouches to Headers
Mostly, this should give us an idea of life with the new Object Lists. I'll take another application by application pass down the road. This mostly looks at implementation in Maniphest, Differential, Audit, Workboards. Checked a few other areas and dialogs while testing, and everything looks square.
Test Plan: Maniphest, Differential, Homepage, Audit, People, and other applications. Drag reorder, etc.
Reviewers: btrahan, epriestley
Reviewed By: epriestley
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12865
2015-05-15 22:28:59 +02:00
|
|
|
if ($this->objectList) {
|
|
|
|
$content->appendChild($this->objectList);
|
|
|
|
}
|
|
|
|
|
2013-09-29 00:55:38 +02:00
|
|
|
return $content;
|
2013-08-26 20:53:11 +02:00
|
|
|
}
|
|
|
|
}
|