2013-08-26 20:53:11 +02:00
|
|
|
<?php
|
|
|
|
|
2016-02-17 21:43:38 +01:00
|
|
|
final class PHUIObjectBoxView extends AphrontTagView {
|
2013-08-26 20:53:11 +02:00
|
|
|
|
|
|
|
private $headerText;
|
2015-05-20 01:47:48 +02:00
|
|
|
private $color;
|
2016-01-24 01:02:29 +01:00
|
|
|
private $background;
|
2016-07-01 00:57:32 +02:00
|
|
|
private $tabGroups = array();
|
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;
|
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();
|
2016-02-17 21:43:38 +01:00
|
|
|
private $tabMap = null;
|
|
|
|
private $tabLists = array();
|
2013-10-19 21:07:50 +02:00
|
|
|
private $propertyLists = array();
|
2016-02-17 21:43:38 +01:00
|
|
|
private $propertyList = null;
|
2013-10-19 21:07:50 +02:00
|
|
|
|
2015-05-20 01:47:48 +02:00
|
|
|
const COLOR_RED = 'red';
|
|
|
|
const COLOR_BLUE = 'blue';
|
|
|
|
const COLOR_GREEN = 'green';
|
|
|
|
const COLOR_YELLOW = 'yellow';
|
|
|
|
|
2016-02-17 21:43:38 +01:00
|
|
|
const BLUE = 'phui-box-blue';
|
2016-02-26 23:34:51 +01:00
|
|
|
const BLUE_PROPERTY = 'phui-box-blue-property';
|
2016-02-17 21:43:38 +01:00
|
|
|
const GREY = 'phui-box-grey';
|
2014-04-18 15:44:45 +02:00
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2016-01-24 01:02:29 +01:00
|
|
|
public function setBackground($color) {
|
|
|
|
$this->background = $color;
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2016-07-01 00:57:32 +02:00
|
|
|
public function addTabGroup(PHUITabGroupView $view) {
|
|
|
|
$this->tabGroups[] = $view;
|
|
|
|
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-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
|
|
|
|
2016-02-17 21:43:38 +01:00
|
|
|
public function willRender() {
|
|
|
|
$tab_lists = array();
|
|
|
|
$property_lists = array();
|
|
|
|
$tab_map = array();
|
|
|
|
|
|
|
|
$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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach ($this->propertyLists as $key => $list) {
|
|
|
|
$group = new PHUIPropertyGroupView();
|
|
|
|
$i = 0;
|
|
|
|
foreach ($list as $item) {
|
|
|
|
$group->addPropertyList($item);
|
2016-07-01 00:57:32 +02:00
|
|
|
if ($i > 0 || $this->tabGroups) {
|
2016-02-17 21:43:38 +01:00
|
|
|
$item->addClass('phui-property-list-section-noninitial');
|
|
|
|
}
|
|
|
|
$i++;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($this->tabs && $key != $default_key) {
|
|
|
|
$tab_id = celerity_generate_unique_node_id();
|
|
|
|
$tab_map[$key] = $tab_id;
|
|
|
|
|
|
|
|
if ($key === $selected_tab) {
|
|
|
|
$style = null;
|
|
|
|
} else {
|
|
|
|
$style = 'display: none';
|
|
|
|
}
|
|
|
|
|
|
|
|
$tab_lists[] = phutil_tag(
|
|
|
|
'div',
|
|
|
|
array(
|
|
|
|
'style' => $style,
|
|
|
|
'id' => $tab_id,
|
|
|
|
),
|
|
|
|
$group);
|
|
|
|
} else {
|
|
|
|
if ($this->tabs) {
|
|
|
|
$group->addClass('phui-property-group-noninitial');
|
|
|
|
}
|
|
|
|
$property_lists[] = $group;
|
|
|
|
}
|
|
|
|
$this->propertyList = $property_lists;
|
|
|
|
$this->tabMap = $tab_map;
|
|
|
|
$this->tabLists = $tab_lists;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function getTagAttributes() {
|
|
|
|
$classes = array();
|
|
|
|
$classes[] = 'phui-box';
|
|
|
|
$classes[] = 'phui-box-border';
|
|
|
|
$classes[] = 'phui-object-box';
|
|
|
|
$classes[] = 'mlt mll mlr';
|
|
|
|
|
|
|
|
if ($this->color) {
|
|
|
|
$classes[] = 'phui-object-box-'.$this->color;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($this->collapsed) {
|
|
|
|
$classes[] = 'phui-object-box-collapsed';
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($this->flush) {
|
|
|
|
$classes[] = 'phui-object-box-flush';
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($this->background) {
|
|
|
|
$classes[] = $this->background;
|
|
|
|
}
|
|
|
|
|
|
|
|
$sigil = null;
|
|
|
|
$metadata = null;
|
|
|
|
if ($this->tabs) {
|
|
|
|
$sigil = 'phui-object-box';
|
|
|
|
$metadata = array(
|
|
|
|
'tabMap' => $this->tabMap,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
return array(
|
|
|
|
'class' => implode(' ', $classes),
|
|
|
|
'sigil' => $sigil,
|
|
|
|
'meta' => $metadata,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function getTagContent() {
|
|
|
|
require_celerity_resource('phui-box-css');
|
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;
|
2015-07-07 20:52:06 +02:00
|
|
|
|
2015-05-20 01:47:48 +02:00
|
|
|
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) {
|
2015-07-07 20:52:06 +02:00
|
|
|
if (!$header) {
|
|
|
|
$header = id(new PHUIHeaderView());
|
|
|
|
}
|
|
|
|
|
2015-05-27 02:35:18 +02:00
|
|
|
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())
|
2016-01-28 05:38:01 +01:00
|
|
|
->setIcon('fa-bars');
|
2015-01-12 16:24:35 +01:00
|
|
|
$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: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');
|
|
|
|
}
|
|
|
|
|
2016-02-17 21:43:38 +01:00
|
|
|
$content = array(
|
|
|
|
($this->showHideOpen == false ? $this->anchor : null),
|
|
|
|
$header,
|
|
|
|
$this->infoView,
|
|
|
|
$this->formErrors,
|
|
|
|
$this->formSaved,
|
|
|
|
$exception_errors,
|
|
|
|
$this->form,
|
2016-07-01 00:57:32 +02:00
|
|
|
$this->tabGroups,
|
2016-02-17 21:43:38 +01:00
|
|
|
$tabs,
|
|
|
|
$this->tabLists,
|
|
|
|
$showhide,
|
|
|
|
($this->showHideOpen == true ? $this->anchor : null),
|
|
|
|
$this->propertyList,
|
|
|
|
$this->table,
|
|
|
|
$this->renderChildren(),
|
|
|
|
);
|
2014-04-18 15:44:45 +02:00
|
|
|
|
[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) {
|
2016-02-17 21:43:38 +01:00
|
|
|
$content[] = $this->objectList;
|
[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
|
|
|
}
|
|
|
|
|
2013-09-29 00:55:38 +02:00
|
|
|
return $content;
|
2013-08-26 20:53:11 +02:00
|
|
|
}
|
|
|
|
}
|