@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

PHUIPropertyListView

Summary: This builds out and implements PHUIPropertyListView (container) and PHUIPropertyListItemView (section) as well as adding tabs.

Test Plan: Tested each page I edited with the exception of Releeph and Phortune, though those changes look ok to me diff wise. Updated examples page with tabs.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: Korvin, epriestley, aran

Differential Revision: https://secure.phabricator.com/D7283

+669 -505
+1 -1
scripts/celerity_mapper.php
··· 112 112 113 113 'phabricator-application-launch-view-css', 114 114 'phabricator-action-list-view-css', 115 - 'phabricator-property-list-view-css', 115 + 'phui-property-list-view-css', 116 116 'phabricator-tag-view-css', 117 117 'phui-list-view-css', 118 118 ),
+58 -58
src/__celerity_resource_map__.php
··· 1149 1149 ), 1150 1150 'diviner-shared-css' => 1151 1151 array( 1152 - 'uri' => '/res/cba9c99e/rsrc/css/diviner/diviner-shared.css', 1152 + 'uri' => '/res/2e831eea/rsrc/css/diviner/diviner-shared.css', 1153 1153 'type' => 'css', 1154 1154 'requires' => 1155 1155 array( ··· 3387 3387 ), 3388 3388 'disk' => '/rsrc/css/application/projects/project-tag.css', 3389 3389 ), 3390 - 'phabricator-property-list-view-css' => 3391 - array( 3392 - 'uri' => '/res/31912bb1/rsrc/css/layout/phabricator-property-list-view.css', 3393 - 'type' => 'css', 3394 - 'requires' => 3395 - array( 3396 - ), 3397 - 'disk' => '/rsrc/css/layout/phabricator-property-list-view.css', 3398 - ), 3399 3390 'phabricator-remarkup-css' => 3400 3391 array( 3401 3392 'uri' => '/res/7e8988dd/rsrc/css/core/remarkup.css', ··· 3760 3751 ), 3761 3752 'phui-document-view-css' => 3762 3753 array( 3763 - 'uri' => '/res/40e39942/rsrc/css/phui/phui-document.css', 3754 + 'uri' => '/res/f744b3b2/rsrc/css/phui/phui-document.css', 3764 3755 'type' => 'css', 3765 3756 'requires' => 3766 3757 array( ··· 3796 3787 ), 3797 3788 'phui-header-view-css' => 3798 3789 array( 3799 - 'uri' => '/res/94208bd6/rsrc/css/phui/phui-header-view.css', 3790 + 'uri' => '/res/d4cec460/rsrc/css/phui/phui-header-view.css', 3800 3791 'type' => 'css', 3801 3792 'requires' => 3802 3793 array( ··· 3848 3839 ), 3849 3840 'disk' => '/rsrc/css/phui/phui-pinboard-view.css', 3850 3841 ), 3842 + 'phui-property-list-view-css' => 3843 + array( 3844 + 'uri' => '/res/6c937c64/rsrc/css/phui/phui-property-list-view.css', 3845 + 'type' => 'css', 3846 + 'requires' => 3847 + array( 3848 + ), 3849 + 'disk' => '/rsrc/css/phui/phui-property-list-view.css', 3850 + ), 3851 3851 'phui-remarkup-preview-css' => 3852 3852 array( 3853 3853 'uri' => '/res/50fa4178/rsrc/css/phui/phui-remarkup-preview.css', ··· 4220 4220 ), array( 4221 4221 'packages' => 4222 4222 array( 4223 - '7cd2ded3' => 4223 + '09637a26' => 4224 4224 array( 4225 4225 'name' => 'core.pkg.css', 4226 4226 'symbols' => ··· 4265 4265 37 => 'phui-icon-view-css', 4266 4266 38 => 'phabricator-application-launch-view-css', 4267 4267 39 => 'phabricator-action-list-view-css', 4268 - 40 => 'phabricator-property-list-view-css', 4268 + 40 => 'phui-property-list-view-css', 4269 4269 41 => 'phabricator-tag-view-css', 4270 4270 42 => 'phui-list-view-css', 4271 4271 ), 4272 - 'uri' => '/res/pkg/7cd2ded3/core.pkg.css', 4272 + 'uri' => '/res/pkg/09637a26/core.pkg.css', 4273 4273 'type' => 'css', 4274 4274 ), 4275 4275 '64eeda79' => ··· 4461 4461 ), 4462 4462 'reverse' => 4463 4463 array( 4464 - 'aphront-dialog-view-css' => '7cd2ded3', 4465 - 'aphront-error-view-css' => '7cd2ded3', 4466 - 'aphront-list-filter-view-css' => '7cd2ded3', 4467 - 'aphront-pager-view-css' => '7cd2ded3', 4468 - 'aphront-panel-view-css' => '7cd2ded3', 4469 - 'aphront-table-view-css' => '7cd2ded3', 4470 - 'aphront-tokenizer-control-css' => '7cd2ded3', 4471 - 'aphront-tooltip-css' => '7cd2ded3', 4472 - 'aphront-typeahead-control-css' => '7cd2ded3', 4464 + 'aphront-dialog-view-css' => '09637a26', 4465 + 'aphront-error-view-css' => '09637a26', 4466 + 'aphront-list-filter-view-css' => '09637a26', 4467 + 'aphront-pager-view-css' => '09637a26', 4468 + 'aphront-panel-view-css' => '09637a26', 4469 + 'aphront-table-view-css' => '09637a26', 4470 + 'aphront-tokenizer-control-css' => '09637a26', 4471 + 'aphront-tooltip-css' => '09637a26', 4472 + 'aphront-typeahead-control-css' => '09637a26', 4473 4473 'differential-changeset-view-css' => '4dc2311c', 4474 4474 'differential-core-view-css' => '4dc2311c', 4475 4475 'differential-inline-comment-editor' => '5e9e5c4e', ··· 4483 4483 'differential-table-of-contents-css' => '4dc2311c', 4484 4484 'diffusion-commit-view-css' => 'c8ce2d88', 4485 4485 'diffusion-icons-css' => 'c8ce2d88', 4486 - 'global-drag-and-drop-css' => '7cd2ded3', 4486 + 'global-drag-and-drop-css' => '09637a26', 4487 4487 'inline-comment-summary-css' => '4dc2311c', 4488 4488 'javelin-aphlict' => '64eeda79', 4489 4489 'javelin-behavior' => '9564fa17', ··· 4558 4558 'javelin-util' => '9564fa17', 4559 4559 'javelin-vector' => '9564fa17', 4560 4560 'javelin-workflow' => '9564fa17', 4561 - 'lightbox-attachment-css' => '7cd2ded3', 4561 + 'lightbox-attachment-css' => '09637a26', 4562 4562 'maniphest-task-summary-css' => '49898640', 4563 - 'phabricator-action-list-view-css' => '7cd2ded3', 4564 - 'phabricator-application-launch-view-css' => '7cd2ded3', 4563 + 'phabricator-action-list-view-css' => '09637a26', 4564 + 'phabricator-application-launch-view-css' => '09637a26', 4565 4565 'phabricator-busy' => '64eeda79', 4566 4566 'phabricator-content-source-view-css' => '4dc2311c', 4567 - 'phabricator-core-css' => '7cd2ded3', 4568 - 'phabricator-crumbs-view-css' => '7cd2ded3', 4567 + 'phabricator-core-css' => '09637a26', 4568 + 'phabricator-crumbs-view-css' => '09637a26', 4569 4569 'phabricator-drag-and-drop-file-upload' => '5e9e5c4e', 4570 4570 'phabricator-dropdown-menu' => '64eeda79', 4571 4571 'phabricator-file-upload' => '64eeda79', 4572 - 'phabricator-filetree-view-css' => '7cd2ded3', 4573 - 'phabricator-flag-css' => '7cd2ded3', 4572 + 'phabricator-filetree-view-css' => '09637a26', 4573 + 'phabricator-flag-css' => '09637a26', 4574 4574 'phabricator-hovercard' => '64eeda79', 4575 - 'phabricator-jump-nav' => '7cd2ded3', 4575 + 'phabricator-jump-nav' => '09637a26', 4576 4576 'phabricator-keyboard-shortcut' => '64eeda79', 4577 4577 'phabricator-keyboard-shortcut-manager' => '64eeda79', 4578 - 'phabricator-main-menu-view' => '7cd2ded3', 4578 + 'phabricator-main-menu-view' => '09637a26', 4579 4579 'phabricator-menu-item' => '64eeda79', 4580 - 'phabricator-nav-view-css' => '7cd2ded3', 4580 + 'phabricator-nav-view-css' => '09637a26', 4581 4581 'phabricator-notification' => '64eeda79', 4582 - 'phabricator-notification-css' => '7cd2ded3', 4583 - 'phabricator-notification-menu-css' => '7cd2ded3', 4582 + 'phabricator-notification-css' => '09637a26', 4583 + 'phabricator-notification-menu-css' => '09637a26', 4584 4584 'phabricator-object-selector-css' => '4dc2311c', 4585 4585 'phabricator-phtize' => '64eeda79', 4586 4586 'phabricator-prefab' => '64eeda79', 4587 4587 'phabricator-project-tag-css' => '49898640', 4588 - 'phabricator-property-list-view-css' => '7cd2ded3', 4589 - 'phabricator-remarkup-css' => '7cd2ded3', 4588 + 'phabricator-remarkup-css' => '09637a26', 4590 4589 'phabricator-shaped-request' => '5e9e5c4e', 4591 - 'phabricator-side-menu-view-css' => '7cd2ded3', 4592 - 'phabricator-standard-page-view' => '7cd2ded3', 4593 - 'phabricator-tag-view-css' => '7cd2ded3', 4590 + 'phabricator-side-menu-view-css' => '09637a26', 4591 + 'phabricator-standard-page-view' => '09637a26', 4592 + 'phabricator-tag-view-css' => '09637a26', 4594 4593 'phabricator-textareautils' => '64eeda79', 4595 4594 'phabricator-tooltip' => '64eeda79', 4596 - 'phabricator-transaction-view-css' => '7cd2ded3', 4597 - 'phabricator-zindex-css' => '7cd2ded3', 4598 - 'phui-button-css' => '7cd2ded3', 4599 - 'phui-form-css' => '7cd2ded3', 4600 - 'phui-form-view-css' => '7cd2ded3', 4601 - 'phui-header-view-css' => '7cd2ded3', 4602 - 'phui-icon-view-css' => '7cd2ded3', 4603 - 'phui-list-view-css' => '7cd2ded3', 4604 - 'phui-object-item-list-view-css' => '7cd2ded3', 4605 - 'phui-spacing-css' => '7cd2ded3', 4606 - 'sprite-apps-large-css' => '7cd2ded3', 4607 - 'sprite-gradient-css' => '7cd2ded3', 4608 - 'sprite-icons-css' => '7cd2ded3', 4609 - 'sprite-menu-css' => '7cd2ded3', 4610 - 'sprite-status-css' => '7cd2ded3', 4611 - 'syntax-highlighting-css' => '7cd2ded3', 4595 + 'phabricator-transaction-view-css' => '09637a26', 4596 + 'phabricator-zindex-css' => '09637a26', 4597 + 'phui-button-css' => '09637a26', 4598 + 'phui-form-css' => '09637a26', 4599 + 'phui-form-view-css' => '09637a26', 4600 + 'phui-header-view-css' => '09637a26', 4601 + 'phui-icon-view-css' => '09637a26', 4602 + 'phui-list-view-css' => '09637a26', 4603 + 'phui-object-item-list-view-css' => '09637a26', 4604 + 'phui-property-list-view-css' => '09637a26', 4605 + 'phui-spacing-css' => '09637a26', 4606 + 'sprite-apps-large-css' => '09637a26', 4607 + 'sprite-gradient-css' => '09637a26', 4608 + 'sprite-icons-css' => '09637a26', 4609 + 'sprite-menu-css' => '09637a26', 4610 + 'sprite-status-css' => '09637a26', 4611 + 'syntax-highlighting-css' => '09637a26', 4612 4612 ), 4613 4613 ));
+6 -4
src/__phutil_library_map__.php
··· 788 788 'PHUIPagedFormView' => 'view/form/PHUIPagedFormView.php', 789 789 'PHUIPinboardItemView' => 'view/phui/PHUIPinboardItemView.php', 790 790 'PHUIPinboardView' => 'view/phui/PHUIPinboardView.php', 791 + 'PHUIPropertyGroupView' => 'view/phui/PHUIPropertyGroupView.php', 792 + 'PHUIPropertyListExample' => 'applications/uiexample/examples/PHUIPropertyListExample.php', 793 + 'PHUIPropertyListView' => 'view/phui/PHUIPropertyListView.php', 791 794 'PHUIRemarkupPreviewPanel' => 'view/phui/PHUIRemarkupPreviewPanel.php', 792 795 'PHUIStatusItemView' => 'view/phui/PHUIStatusItemView.php', 793 796 'PHUIStatusListView' => 'view/phui/PHUIStatusListView.php', ··· 1524 1527 'PhabricatorProjectTransaction' => 'applications/project/storage/PhabricatorProjectTransaction.php', 1525 1528 'PhabricatorProjectTransactionType' => 'applications/project/constants/PhabricatorProjectTransactionType.php', 1526 1529 'PhabricatorProjectUpdateController' => 'applications/project/controller/PhabricatorProjectUpdateController.php', 1527 - 'PhabricatorPropertyListExample' => 'applications/uiexample/examples/PhabricatorPropertyListExample.php', 1528 - 'PhabricatorPropertyListView' => 'view/layout/PhabricatorPropertyListView.php', 1529 1530 'PhabricatorQuery' => 'infrastructure/query/PhabricatorQuery.php', 1530 1531 'PhabricatorRecaptchaConfigOptions' => 'applications/config/option/PhabricatorRecaptchaConfigOptions.php', 1531 1532 'PhabricatorRedirectController' => 'applications/base/controller/PhabricatorRedirectController.php', ··· 2926 2927 'PHUIPagedFormView' => 'AphrontTagView', 2927 2928 'PHUIPinboardItemView' => 'AphrontView', 2928 2929 'PHUIPinboardView' => 'AphrontView', 2930 + 'PHUIPropertyGroupView' => 'AphrontTagView', 2931 + 'PHUIPropertyListExample' => 'PhabricatorUIExample', 2932 + 'PHUIPropertyListView' => 'AphrontView', 2929 2933 'PHUIRemarkupPreviewPanel' => 'AphrontTagView', 2930 2934 'PHUIStatusItemView' => 'AphrontTagView', 2931 2935 'PHUIStatusListView' => 'AphrontTagView', ··· 3726 3730 'PhabricatorProjectTransaction' => 'PhabricatorProjectDAO', 3727 3731 'PhabricatorProjectTransactionType' => 'PhabricatorProjectConstants', 3728 3732 'PhabricatorProjectUpdateController' => 'PhabricatorProjectController', 3729 - 'PhabricatorPropertyListExample' => 'PhabricatorUIExample', 3730 - 'PhabricatorPropertyListView' => 'AphrontView', 3731 3733 'PhabricatorRecaptchaConfigOptions' => 'PhabricatorApplicationConfigOptions', 3732 3734 'PhabricatorRedirectController' => 'PhabricatorController', 3733 3735 'PhabricatorRefreshCSRFController' => 'PhabricatorAuthController',
+2 -2
src/applications/config/controller/PhabricatorConfigAllController.php
··· 66 66 67 67 $versions = $this->loadVersions(); 68 68 69 - $version_property_list = id(new PhabricatorPropertyListView()); 69 + $version_property_list = id(new PHUIPropertyListView()); 70 70 foreach ($versions as $version) { 71 71 list($name, $hash) = $version; 72 72 $version_property_list->addProperty($name, $hash); ··· 74 74 75 75 $object_box = id(new PHUIObjectBoxView()) 76 76 ->setHeaderText(pht('Current Settings')) 77 - ->setPropertyList($version_property_list); 77 + ->addPropertyList($version_property_list); 78 78 79 79 $phabricator_root = dirname(phutil_get_library_root('phabricator')); 80 80 $version_path = $phabricator_root.'/conf/local/VERSION';
+9 -6
src/applications/countdown/controller/PhabricatorCountdownViewController.php
··· 45 45 ->setHeader($title); 46 46 47 47 $actions = $this->buildActionListView($countdown); 48 - $properties = $this->buildPropertyListView($countdown); 48 + $properties = $this->buildPropertyListView($countdown, $actions); 49 49 50 50 $object_box = id(new PHUIObjectBoxView()) 51 51 ->setHeader($header) 52 - ->setActionList($actions) 53 - ->setPropertyList($properties); 52 + ->addPropertyList($properties); 54 53 55 54 $content = array( 56 55 $crumbs, ··· 99 98 return $view; 100 99 } 101 100 102 - private function buildPropertyListView(PhabricatorCountdown $countdown) { 101 + private function buildPropertyListView( 102 + PhabricatorCountdown $countdown, 103 + PhabricatorActionListView $actions) { 104 + 103 105 $request = $this->getRequest(); 104 106 $viewer = $request->getUser(); 105 107 106 108 $this->loadHandles(array($countdown->getAuthorPHID())); 107 109 108 - $view = id(new PhabricatorPropertyListView()) 109 - ->setUser($viewer); 110 + $view = id(new PHUIPropertyListView()) 111 + ->setUser($viewer) 112 + ->setActionList($actions); 110 113 111 114 $view->addProperty( 112 115 pht('Author'),
+6 -3
src/applications/daemon/controller/PhabricatorDaemonLogViewController.php
··· 72 72 $event_panel->setNoBackground(); 73 73 $event_panel->appendChild($event_view); 74 74 75 + $object_box = id(new PHUIObjectBoxView()) 76 + ->setHeader($header) 77 + ->addPropertyList($properties); 78 + 75 79 return $this->buildApplicationPage( 76 80 array( 77 81 $crumbs, 78 - $header, 79 - $properties, 82 + $object_box, 80 83 $event_panel, 81 84 ), 82 85 array( ··· 88 91 $request = $this->getRequest(); 89 92 $viewer = $request->getUser(); 90 93 91 - $view = id(new PhabricatorPropertyListView()) 94 + $view = id(new PHUIPropertyListView()) 92 95 ->setUser($viewer); 93 96 94 97 $id = $daemon->getID();
+14 -8
src/applications/daemon/controller/PhabricatorWorkerTaskDetailController.php
··· 38 38 $task->getID(), 39 39 $task->getTaskClass())); 40 40 41 - $actions = $this->buildActionListView($task); 42 - $properties = $this->buildPropertyListView($task); 41 + $actions = $this->buildActionListView($task); 42 + $properties = $this->buildPropertyListView($task, $actions); 43 43 44 44 $retry_head = id(new PHUIHeaderView()) 45 45 ->setHeader(pht('Retries')); 46 46 47 47 $retry_info = $this->buildRetryListView($task); 48 48 49 + $object_box = id(new PHUIObjectBoxView()) 50 + ->setHeader($header) 51 + ->addPropertyList($properties); 52 + 49 53 $content = array( 50 - $header, 51 - $actions, 52 - $properties, 54 + $object_box, 53 55 $retry_head, 54 56 $retry_info, 55 57 ); ··· 114 116 return $view; 115 117 } 116 118 117 - private function buildPropertyListView(PhabricatorWorkerTask $task) { 118 - $view = new PhabricatorPropertyListView(); 119 + private function buildPropertyListView( 120 + PhabricatorWorkerTask $task, 121 + PhabricatorActionListView $actions) { 122 + 123 + $view = new PHUIPropertyListView(); 124 + $view->setActionList($actions); 119 125 120 126 if ($task->isArchived()) { 121 127 switch ($task->getResult()) { ··· 197 203 } 198 204 199 205 private function buildRetryListView(PhabricatorWorkerTask $task) { 200 - $view = new PhabricatorPropertyListView(); 206 + $view = new PHUIPropertyListView(); 201 207 202 208 $data = id(new PhabricatorWorkerTaskData())->load($task->getDataID()); 203 209 $task->setData($data->getData());
+1 -1
src/applications/differential/controller/DifferentialDiffViewController.php
··· 117 117 $property_head = id(new PHUIHeaderView()) 118 118 ->setHeader(pht('Properties')); 119 119 120 - $property_view = new PhabricatorPropertyListView(); 120 + $property_view = new PHUIPropertyListView(); 121 121 foreach ($dict as $key => $value) { 122 122 $property_view->addProperty($key, $value); 123 123 }
+3 -3
src/applications/differential/view/DifferentialRevisionDetailView.php
··· 68 68 $actions->addAction($obj); 69 69 } 70 70 71 - $properties = id(new PhabricatorPropertyListView()) 71 + $properties = id(new PHUIPropertyListView()) 72 72 ->setUser($user) 73 73 ->setObject($revision); 74 74 ··· 110 110 } 111 111 } 112 112 $properties->setHasKeyboardShortcuts(true); 113 + $properties->setActionList($actions); 113 114 114 115 $object_box = id(new PHUIObjectBoxView()) 115 116 ->setHeader($header) 116 - ->setActionList($actions) 117 - ->setPropertyList($properties); 117 + ->addPropertyList($properties); 118 118 119 119 return $object_box; 120 120 }
+7 -3
src/applications/diffusion/controller/DiffusionBrowseController.php
··· 120 120 return $view; 121 121 } 122 122 123 - protected function buildPropertyView(DiffusionRequest $drequest) { 123 + protected function buildPropertyView( 124 + DiffusionRequest $drequest, 125 + PhabricatorActionListView $actions) { 126 + 124 127 $viewer = $this->getRequest()->getUser(); 125 128 126 - $view = id(new PhabricatorPropertyListView()) 127 - ->setUser($viewer); 129 + $view = id(new PHUIPropertyListView()) 130 + ->setUser($viewer) 131 + ->setActionList($actions); 128 132 129 133 $stable_commit = $drequest->getStableCommitName(); 130 134 $callsign = $drequest->getRepository()->getCallsign();
+3 -2
src/applications/diffusion/controller/DiffusionBrowseDirectoryController.php
··· 21 21 $reason = $results->getReasonForEmptyResultSet(); 22 22 23 23 $content = array(); 24 + $actions = $this->buildActionView($drequest); 25 + $properties = $this->buildPropertyView($drequest, $actions); 24 26 25 27 $object_box = id(new PHUIObjectBoxView()) 26 28 ->setHeader($this->buildHeaderView($drequest)) 27 - ->setActionList($this->buildActionView($drequest)) 28 - ->setPropertyList($this->buildPropertyView($drequest)); 29 + ->addPropertyList($properties); 29 30 30 31 $content[] = $object_box; 31 32 $content[] = $this->renderSearchForm($collapsed = true);
+4 -4
src/applications/diffusion/controller/DiffusionBrowseFileController.php
··· 107 107 $show_color, 108 108 $binary_uri); 109 109 110 + $properties = $this->buildPropertyView($drequest, $action_list); 110 111 $object_box = id(new PHUIObjectBoxView()) 111 112 ->setHeader($this->buildHeaderView($drequest)) 112 - ->setActionList($action_list) 113 - ->setPropertyList($this->buildPropertyView($drequest)); 113 + ->addPropertyList($properties); 114 114 115 115 $content = array(); 116 116 $content[] = $object_box; ··· 822 822 } 823 823 824 824 private function buildImageCorpus($file_uri) { 825 - $properties = new PhabricatorPropertyListView(); 825 + $properties = new PHUIPropertyListView(); 826 826 827 827 $properties->addProperty( 828 828 pht('Image'), ··· 836 836 } 837 837 838 838 private function buildBinaryCorpus($file_uri, $data) { 839 - $properties = new PhabricatorPropertyListView(); 839 + $properties = new PHUIPropertyListView(); 840 840 841 841 $size = strlen($data); 842 842 $properties->addTextContent(
+4 -2
src/applications/diffusion/controller/DiffusionBrowseSearchController.php
··· 5 5 public function processRequest() { 6 6 $drequest = $this->diffusionRequest; 7 7 8 + $actions = $this->buildActionView($drequest); 9 + $properties = $this->buildPropertyView($drequest, $actions); 10 + 8 11 $object_box = id(new PHUIObjectBoxView()) 9 12 ->setHeader($this->buildHeaderView($drequest)) 10 - ->setActionList($this->buildActionView($drequest)) 11 - ->setPropertyList($this->buildPropertyView($drequest)); 13 + ->addPropertyList($properties); 12 14 13 15 $content = array(); 14 16
+9 -6
src/applications/diffusion/controller/DiffusionChangeController.php
··· 81 81 ->setUser($viewer) 82 82 ->setPolicyObject($drequest->getRepository()); 83 83 $actions = $this->buildActionView($drequest); 84 - $properties = $this->buildPropertyView($drequest); 84 + $properties = $this->buildPropertyView($drequest, $actions); 85 85 86 86 $object_box = id(new PHUIObjectBoxView()) 87 87 ->setHeader($header) 88 - ->setActionList($actions) 89 - ->setPropertyList($properties); 88 + ->addPropertyList($properties); 90 89 91 90 return $this->buildApplicationPage( 92 91 array( ··· 130 129 return $view; 131 130 } 132 131 133 - protected function buildPropertyView(DiffusionRequest $drequest) { 132 + protected function buildPropertyView( 133 + DiffusionRequest $drequest, 134 + PhabricatorActionListView $actions) { 135 + 134 136 $viewer = $this->getRequest()->getUser(); 135 137 136 - $view = id(new PhabricatorPropertyListView()) 137 - ->setUser($viewer); 138 + $view = id(new PHUIPropertyListView()) 139 + ->setUser($viewer) 140 + ->setActionList($actions); 138 141 139 142 $stable_commit = $drequest->getStableCommitName(); 140 143 $callsign = $drequest->getRepository()->getCallsign();
+3 -3
src/applications/diffusion/controller/DiffusionCommitController.php
··· 113 113 $commit_data, 114 114 $parents, 115 115 $audit_requests); 116 - $property_list = id(new PhabricatorPropertyListView()) 116 + $property_list = id(new PHUIPropertyListView()) 117 117 ->setHasKeyboardShortcuts(true) 118 118 ->setUser($user) 119 119 ->setObject($commit); ··· 137 137 ), 138 138 $message)); 139 139 $content[] = $top_anchor; 140 + $property_list->setActionList($headsup_actions); 140 141 141 142 $object_box = id(new PHUIObjectBoxView()) 142 143 ->setHeader($headsup_view) 143 - ->setActionList($headsup_actions) 144 - ->setPropertyList($property_list); 144 + ->addPropertyList($property_list); 145 145 146 146 $content[] = $object_box; 147 147 }
+9 -6
src/applications/diffusion/controller/DiffusionHistoryController.php
··· 70 70 ->setHeader($this->renderPathLinks($drequest, $mode = 'history')); 71 71 72 72 $actions = $this->buildActionView($drequest); 73 - $properties = $this->buildPropertyView($drequest); 73 + $properties = $this->buildPropertyView($drequest, $actions); 74 74 75 75 $object_box = id(new PHUIObjectBoxView()) 76 76 ->setHeader($header) 77 - ->setActionList($actions) 78 - ->setPropertyList($properties); 77 + ->addPropertyList($properties); 79 78 80 79 $crumbs = $this->buildCrumbs( 81 80 array( ··· 143 142 return $view; 144 143 } 145 144 146 - protected function buildPropertyView(DiffusionRequest $drequest) { 145 + protected function buildPropertyView( 146 + DiffusionRequest $drequest, 147 + PhabricatorActionListView $actions) { 148 + 147 149 $viewer = $this->getRequest()->getUser(); 148 150 149 - $view = id(new PhabricatorPropertyListView()) 150 - ->setUser($viewer); 151 + $view = id(new PHUIPropertyListView()) 152 + ->setUser($viewer) 153 + ->setActionList($actions); 151 154 152 155 $stable_commit = $drequest->getStableCommitName(); 153 156 $callsign = $drequest->getRepository()->getCallsign();
+8 -6
src/applications/diffusion/controller/DiffusionLintController.php
··· 160 160 $properties = $this->buildPropertyView( 161 161 $drequest, 162 162 $branch, 163 - $total); 163 + $total, 164 + $actions); 164 165 165 166 $object_box = id(new PHUIObjectBoxView()) 166 167 ->setHeader($header) 167 - ->setActionList($actions) 168 - ->setPropertyList($properties); 168 + ->addPropertyList($properties); 169 169 } else { 170 170 $object_box = null; 171 171 } ··· 316 316 protected function buildPropertyView( 317 317 DiffusionRequest $drequest, 318 318 PhabricatorRepositoryBranch $branch, 319 - $total) { 319 + $total, 320 + PhabricatorActionListView $actions) { 320 321 321 322 $viewer = $this->getRequest()->getUser(); 322 323 323 - $view = id(new PhabricatorPropertyListView()) 324 - ->setUser($viewer); 324 + $view = id(new PHUIPropertyListView()) 325 + ->setUser($viewer) 326 + ->setActions($actions); 325 327 326 328 $callsign = $drequest->getRepository()->getCallsign(); 327 329 $lint_commit = $branch->getLintCommit();
+4 -3
src/applications/diffusion/controller/DiffusionRepositoryController.php
··· 147 147 148 148 $actions = $this->buildActionList($repository); 149 149 150 - $view = id(new PhabricatorPropertyListView()) 150 + $view = id(new PHUIPropertyListView()) 151 151 ->setUser($user); 152 152 $view->addProperty(pht('Callsign'), $repository->getCallsign()); 153 153 ··· 174 174 $view->addTextContent($description); 175 175 } 176 176 177 + $view->setActionList($actions); 178 + 177 179 return id(new PHUIObjectBoxView()) 178 180 ->setHeader($header) 179 - ->setActionList($actions) 180 - ->setPropertyList($view); 181 + ->addPropertyList($view); 181 182 182 183 } 183 184
+9 -6
src/applications/diffusion/controller/DiffusionRepositoryEditBasicController.php
··· 65 65 } 66 66 } 67 67 68 - $content = array(); 69 - 70 68 $crumbs = $this->buildCrumbs(); 71 69 $crumbs->addCrumb( 72 70 id(new PhabricatorCrumbView()) 73 71 ->setName(pht('Edit Basics'))); 74 - $content[] = $crumbs; 75 72 76 73 $title = pht('Edit %s', $repository->getName()); 77 74 75 + $error_view = null; 78 76 if ($errors) { 79 - $content[] = id(new AphrontErrorView()) 77 + $error_view = id(new AphrontErrorView()) 80 78 ->setTitle(pht('Form Errors')) 81 79 ->setErrors($errors); 82 80 } ··· 101 99 ->appendChild(id(new PHUIFormDividerControl())) 102 100 ->appendRemarkupInstructions($this->getReadmeInstructions()); 103 101 104 - $content[] = $form; 102 + $object_box = id(new PHUIObjectBoxView()) 103 + ->setHeaderText($title) 104 + ->setForm($form) 105 + ->setFormError($error_view); 105 106 106 107 return $this->buildApplicationPage( 107 - $content, 108 + array( 109 + $crumbs, 110 + $object_box), 108 111 array( 109 112 'title' => $title, 110 113 'device' => true,
+42 -32
src/applications/diffusion/controller/DiffusionRepositoryEditController.php
··· 8 8 $drequest = $this->diffusionRequest; 9 9 $repository = $drequest->getRepository(); 10 10 11 - $content = array(); 12 - 13 11 $crumbs = $this->buildCrumbs(); 14 12 $crumbs->addCrumb( 15 13 id(new PhabricatorCrumbView()) 16 14 ->setName(pht('Edit'))); 17 - $content[] = $crumbs; 18 15 19 16 $title = pht('Edit %s', $repository->getName()); 20 17 ··· 28 25 ->setBackgroundColor(PhabricatorTagView::COLOR_BLACK)); 29 26 } 30 27 31 - $content[] = $header; 28 + $basic_actions = $this->buildBasicActions($repository); 29 + $basic_properties = 30 + $this->buildBasicProperties($repository, $basic_actions); 32 31 33 - $content[] = $this->buildBasicActions($repository); 34 - $content[] = $this->buildBasicProperties($repository); 32 + $policy_actions = $this->buildPolicyActions($repository); 33 + $policy_properties = 34 + $this->buildPolicyProperties($repository, $policy_actions); 35 35 36 - $content[] = id(new PHUIHeaderView()) 37 - ->setHeader(pht('Policies')); 38 - 39 - $content[] = $this->buildPolicyActions($repository); 40 - $content[] = $this->buildPolicyProperties($repository); 41 - 42 - $content[] = id(new PHUIHeaderView()) 43 - ->setHeader(pht('Text Encoding')); 44 - 45 - $content[] = $this->buildEncodingActions($repository); 46 - $content[] = $this->buildEncodingProperties($repository); 47 - 48 - $content[] = id(new PHUIHeaderView()) 49 - ->setHeader(pht('Edit History')); 36 + $encoding_actions = $this->buildEncodingActions($repository); 37 + $encoding_properties = 38 + $this->buildEncodingProperties($repository, $encoding_actions); 50 39 51 40 $xactions = id(new PhabricatorRepositoryTransactionQuery()) 52 41 ->setViewer($user) ··· 70 59 ->setTransactions($xactions) 71 60 ->setMarkupEngine($engine); 72 61 73 - $content[] = $xaction_view; 74 - 62 + $obj_box = id(new PHUIObjectBoxView()) 63 + ->setHeader($header) 64 + ->addPropertyList($basic_properties) 65 + ->addPropertyList($policy_properties) 66 + ->addPropertyList($encoding_properties); 75 67 76 68 return $this->buildApplicationPage( 77 - $content, 69 + array( 70 + $crumbs, 71 + $obj_box, 72 + $xaction_view, 73 + ), 78 74 array( 79 75 'title' => $title, 80 76 'device' => true, ··· 122 118 return $view; 123 119 } 124 120 125 - private function buildBasicProperties(PhabricatorRepository $repository) { 121 + private function buildBasicProperties( 122 + PhabricatorRepository $repository, 123 + PhabricatorActionListView $actions) { 124 + 126 125 $user = $this->getRequest()->getUser(); 127 126 128 - $view = id(new PhabricatorPropertyListView()) 129 - ->setUser($user); 127 + $view = id(new PHUIPropertyListView()) 128 + ->setUser($user) 129 + ->setActionList($actions); 130 130 131 131 $view->addProperty(pht('Name'), $repository->getName()); 132 132 $view->addProperty(pht('ID'), $repository->getID()); ··· 177 177 return $view; 178 178 } 179 179 180 - private function buildEncodingProperties(PhabricatorRepository $repository) { 180 + private function buildEncodingProperties( 181 + PhabricatorRepository $repository, 182 + PhabricatorActionListView $actions) { 183 + 181 184 $user = $this->getRequest()->getUser(); 182 185 183 - $view = id(new PhabricatorPropertyListView()) 184 - ->setUser($user); 186 + $view = id(new PHUIPropertyListView()) 187 + ->setUser($user) 188 + ->setActionList($actions) 189 + ->addSectionHeader(pht('Text Encoding')); 185 190 186 191 $encoding = $repository->getDetail('encoding'); 187 192 if (!$encoding) { ··· 217 222 return $view; 218 223 } 219 224 220 - private function buildPolicyProperties(PhabricatorRepository $repository) { 225 + private function buildPolicyProperties( 226 + PhabricatorRepository $repository, 227 + PhabricatorActionListView $actions) { 228 + 221 229 $viewer = $this->getRequest()->getUser(); 222 230 223 - $view = id(new PhabricatorPropertyListView()) 224 - ->setUser($viewer); 231 + $view = id(new PHUIPropertyListView()) 232 + ->setUser($viewer) 233 + ->setActionList($actions) 234 + ->addSectionHeader(pht('Policies')); 225 235 226 236 $descriptions = PhabricatorPolicyQuery::renderPolicyDescriptions( 227 237 $viewer,
+10 -6
src/applications/diffusion/controller/DiffusionRepositoryEditEncodingController.php
··· 56 56 } 57 57 } 58 58 59 - $content = array(); 60 - 61 59 $crumbs = $this->buildCrumbs(); 62 60 $crumbs->addCrumb( 63 61 id(new PhabricatorCrumbView()) 64 62 ->setName(pht('Edit Encoding'))); 65 - $content[] = $crumbs; 66 63 67 64 $title = pht('Edit %s', $repository->getName()); 68 65 66 + $error_view = null; 69 67 if ($errors) { 70 - $content[] = id(new AphrontErrorView()) 68 + $error_view = id(new AphrontErrorView()) 71 69 ->setTitle(pht('Form Errors')) 72 70 ->setErrors($errors); 73 71 } ··· 86 84 ->setValue(pht('Save Encoding')) 87 85 ->addCancelButton($edit_uri)); 88 86 89 - $content[] = $form; 87 + $object_box = id(new PHUIObjectBoxView()) 88 + ->setHeaderText($title) 89 + ->setForm($form) 90 + ->setFormError($error_view); 90 91 91 92 return $this->buildApplicationPage( 92 - $content, 93 + array( 94 + $crumbs, 95 + $object_box, 96 + ), 93 97 array( 94 98 'title' => $title, 95 99 'device' => true,
+3 -3
src/applications/diviner/controller/DivinerAtomController.php
··· 80 80 ->setBackgroundColor(PhabricatorTagView::COLOR_BLUE) 81 81 ->setName(DivinerAtom::getAtomTypeNameString($atom->getType()))); 82 82 83 - $properties = id(new PhabricatorPropertyListView()); 83 + $properties = id(new PHUIPropertyListView()); 84 84 85 85 $group = $atom->getProperty('group'); 86 86 if ($group) { ··· 255 255 } 256 256 257 257 private function buildExtendsAndImplements( 258 - PhabricatorPropertyListView $view, 258 + PHUIPropertyListView $view, 259 259 DivinerLiveSymbol $symbol) { 260 260 261 261 $lineage = $this->getExtendsLineage($symbol); ··· 335 335 } 336 336 337 337 private function buildDefined( 338 - PhabricatorPropertyListView $view, 338 + PHUIPropertyListView $view, 339 339 DivinerLiveSymbol $symbol) { 340 340 341 341 $atom = $symbol->getAtom();
+1 -1
src/applications/diviner/controller/DivinerBookController.php
··· 85 85 86 86 private function buildPropertyList(DivinerLiveBook $book) { 87 87 $user = $this->getRequest()->getUser(); 88 - $view = id(new PhabricatorPropertyListView()) 88 + $view = id(new PHUIPropertyListView()) 89 89 ->setUser($user); 90 90 91 91 $policies = PhabricatorPolicyQuery::renderPolicyDescriptions(
+8 -5
src/applications/drydock/controller/DrydockLeaseViewController.php
··· 25 25 ->setHeader($title); 26 26 27 27 $actions = $this->buildActionListView($lease); 28 - $properties = $this->buildPropertyListView($lease); 28 + $properties = $this->buildPropertyListView($lease, $actions); 29 29 30 30 $pager = new AphrontPagerView(); 31 31 $pager->setURI(new PhutilURI($lease_uri), 'offset'); ··· 47 47 48 48 $object_box = id(new PHUIObjectBoxView()) 49 49 ->setHeader($header) 50 - ->setActionList($actions) 51 - ->setPropertyList($properties); 50 + ->addPropertyList($properties); 52 51 53 52 return $this->buildApplicationPage( 54 53 array( ··· 84 83 return $view; 85 84 } 86 85 87 - private function buildPropertyListView(DrydockLease $lease) { 88 - $view = new PhabricatorPropertyListView(); 86 + private function buildPropertyListView( 87 + DrydockLease $lease, 88 + PhabricatorActionListView $actions) { 89 + 90 + $view = new PHUIPropertyListView(); 91 + $view->setActionList($actions); 89 92 90 93 switch ($lease->getStatus()) { 91 94 case DrydockLeaseStatus::STATUS_ACTIVE:
+8 -5
src/applications/drydock/controller/DrydockResourceViewController.php
··· 23 23 ->setHeader($title); 24 24 25 25 $actions = $this->buildActionListView($resource); 26 - $properties = $this->buildPropertyListView($resource); 26 + $properties = $this->buildPropertyListView($resource, $actions); 27 27 28 28 $resource_uri = 'resource/'.$resource->getID().'/'; 29 29 $resource_uri = $this->getApplicationURI($resource_uri); ··· 58 58 59 59 $object_box = id(new PHUIObjectBoxView()) 60 60 ->setHeader($header) 61 - ->setActionList($actions) 62 - ->setPropertyList($properties); 61 + ->addPropertyList($properties); 63 62 64 63 return $this->buildApplicationPage( 65 64 array( ··· 97 96 return $view; 98 97 } 99 98 100 - private function buildPropertyListView(DrydockResource $resource) { 101 - $view = new PhabricatorPropertyListView(); 99 + private function buildPropertyListView( 100 + DrydockResource $resource, 101 + PhabricatorActionListView $actions) { 102 + 103 + $view = new PHUIPropertyListView(); 104 + $view->setActionList($actions); 102 105 103 106 $status = $resource->getStatus(); 104 107 $status = DrydockResourceStatus::getNameForStatus($status);
+39 -24
src/applications/files/controller/PhabricatorFileInfoController.php
··· 44 44 } 45 45 46 46 $actions = $this->buildActionView($file); 47 - $properties = $this->buildPropertyView($file); 47 + $properties_array = $this->buildPropertyView($file, $actions); 48 48 $timeline = $this->buildTransactionView($file, $xactions); 49 49 $crumbs = $this->buildApplicationCrumbs(); 50 50 $crumbs->setActionList($actions); ··· 54 54 ->setHref($this->getApplicationURI("/info/{$phid}/"))); 55 55 56 56 $object_box = id(new PHUIObjectBoxView()) 57 - ->setHeader($header) 58 - ->setActionList($actions) 59 - ->setPropertyList($properties); 57 + ->setHeader($header); 58 + 59 + foreach ($properties_array as $property_item) { 60 + $object_box->addPropertyList($property_item); 61 + } 60 62 61 63 return $this->buildApplicationPage( 62 64 array( ··· 162 164 return $view; 163 165 } 164 166 165 - private function buildPropertyView(PhabricatorFile $file) { 167 + private function buildPropertyView( 168 + PhabricatorFile $file, 169 + PhabricatorActionListView $actions) { 166 170 $request = $this->getRequest(); 167 171 $user = $request->getUser(); 168 172 169 - $view = id(new PhabricatorPropertyListView()); 173 + $listview = array(); 174 + $properties = id(new PHUIPropertyListView()); 175 + $properties->setActionList($actions); 170 176 171 177 if ($file->getAuthorPHID()) { 172 - $view->addProperty( 178 + $properties->addProperty( 173 179 pht('Author'), 174 180 $this->getHandle($file->getAuthorPHID())->renderLink()); 175 181 } 176 182 177 - $view->addProperty( 183 + $properties->addProperty( 178 184 pht('Created'), 179 185 phabricator_datetime($file->getDateCreated(), $user)); 180 186 181 - $view->addProperty( 187 + $properties->addProperty( 182 188 pht('Size'), 183 189 phabricator_format_bytes($file->getByteSize())); 184 190 185 - $view->addSectionHeader(pht('Technical Details')); 191 + $properties->addSectionHeader(pht('Technical Details')); 186 192 187 - $view->addProperty( 193 + $properties->addProperty( 188 194 pht('Mime Type'), 189 195 $file->getMimeType()); 190 196 191 - $view->addProperty( 197 + $properties->addProperty( 192 198 pht('Engine'), 193 199 $file->getStorageEngine()); 194 200 195 - $view->addProperty( 201 + $properties->addProperty( 196 202 pht('Format'), 197 203 $file->getStorageFormat()); 198 204 199 - $view->addProperty( 205 + $properties->addProperty( 200 206 pht('Handle'), 201 207 $file->getStorageHandle()); 208 + 209 + $listview[] = $properties; 202 210 203 211 $metadata = $file->getMetadata(); 204 212 if (!empty($metadata)) { 205 - $view->addSectionHeader(pht('Metadata')); 213 + $mdata = id(new PHUIPropertyListView()) 214 + ->addSectionHeader(pht('Metadata')); 206 215 207 216 foreach ($metadata as $key => $value) { 208 - $view->addProperty( 217 + $mdata->addProperty( 209 218 PhabricatorFile::getMetadataName($key), 210 219 $value); 211 220 } 221 + $listview[] = $mdata; 212 222 } 213 223 214 224 $phids = $file->getObjectPHIDs(); 215 225 if ($phids) { 216 - $view->addSectionHeader(pht('Attached')); 217 - $view->addProperty( 226 + $attached = new PHUIPropertyListView(); 227 + $attached->addSectionHeader(pht('Attached')); 228 + $attached->addProperty( 218 229 pht('Attached To'), 219 230 $this->renderHandlesForPHIDs($phids)); 231 + $listview[] = $attached; 220 232 } 221 233 222 - 223 234 if ($file->isViewableImage()) { 224 235 225 236 $image = phutil_tag( 226 237 'img', 227 238 array( 228 239 'src' => $file->getViewURI(), 229 - 'class' => 'phabricator-property-list-image', 240 + 'class' => 'phui-property-list-image', 230 241 )); 231 242 232 243 $linked_image = phutil_tag( ··· 236 247 ), 237 248 $image); 238 249 239 - $view->addImageContent($linked_image); 250 + $media = id(new PHUIPropertyListView()) 251 + ->addImageContent($linked_image); 252 + $listview[] = $media; 240 253 } else if ($file->isAudio()) { 241 254 $audio = phutil_tag( 242 255 'audio', 243 256 array( 244 257 'controls' => 'controls', 245 - 'class' => 'phabricator-property-list-audio', 258 + 'class' => 'phui-property-list-audio', 246 259 ), 247 260 phutil_tag( 248 261 'source', ··· 250 263 'src' => $file->getViewURI(), 251 264 'type' => $file->getMimeType(), 252 265 ))); 253 - $view->addImageContent($audio); 266 + $media = id(new PHUIPropertyListView()) 267 + ->addImageContent($audio); 268 + $listview[] = $media; 254 269 } 255 270 256 - return $view; 271 + return $listview; 257 272 } 258 273 259 274 }
+9 -6
src/applications/herald/controller/HeraldRuleViewController.php
··· 39 39 } 40 40 41 41 $actions = $this->buildActionView($rule); 42 - $properties = $this->buildPropertyView($rule); 42 + $properties = $this->buildPropertyView($rule, $actions); 43 43 44 44 $crumbs = $this->buildApplicationCrumbs(); 45 45 $crumbs->addCrumb( ··· 48 48 49 49 $object_box = id(new PHUIObjectBoxView()) 50 50 ->setHeader($header) 51 - ->setActionList($actions) 52 - ->setPropertyList($properties); 51 + ->addPropertyList($properties); 53 52 54 53 $timeline = $this->buildTimeline($rule); 55 54 ··· 109 108 return $view; 110 109 } 111 110 112 - private function buildPropertyView(HeraldRule $rule) { 111 + private function buildPropertyView( 112 + HeraldRule $rule, 113 + PhabricatorActionListView $actions) { 114 + 113 115 $viewer = $this->getRequest()->getUser(); 114 116 115 117 $this->loadHandles(HeraldAdapter::getHandlePHIDs($rule)); 116 118 117 - $view = id(new PhabricatorPropertyListView()) 119 + $view = id(new PHUIPropertyListView()) 118 120 ->setUser($viewer) 119 - ->setObject($rule); 121 + ->setObject($rule) 122 + ->setActionList($actions); 120 123 121 124 $view->addProperty( 122 125 pht('Rule Type'),
+7 -6
src/applications/legalpad/controller/LegalpadDocumentViewController.php
··· 67 67 ->setPolicyObject($document); 68 68 69 69 $actions = $this->buildActionView($document); 70 - $properties = $this->buildPropertyView($document, $engine); 70 + $properties = $this->buildPropertyView($document, $engine, $actions); 71 71 72 72 $comment_form_id = celerity_generate_unique_node_id(); 73 73 ··· 88 88 89 89 $object_box = id(new PHUIObjectBoxView()) 90 90 ->setHeader($header) 91 - ->setActionList($actions) 92 - ->setPropertyList($properties); 91 + ->addPropertyList($properties); 93 92 94 93 $content = array( 95 94 $crumbs, ··· 149 148 150 149 private function buildPropertyView( 151 150 LegalpadDocument $document, 152 - PhabricatorMarkupEngine $engine) { 151 + PhabricatorMarkupEngine $engine, 152 + PhabricatorActionListView $actions) { 153 153 154 154 $user = $this->getRequest()->getUser(); 155 155 156 - $properties = id(new PhabricatorPropertyListView()) 156 + $properties = id(new PHUIPropertyListView()) 157 157 ->setUser($user) 158 - ->setObject($document); 158 + ->setObject($document) 159 + ->setActionList($actions); 159 160 160 161 $properties->addProperty( 161 162 pht('Last Updated'),
+20 -18
src/applications/macro/controller/PhabricatorMacroViewController.php
··· 35 35 ->setHref($this->getApplicationURI('/view/'.$macro->getID().'/')) 36 36 ->setName($title_short)); 37 37 38 - $properties = $this->buildPropertyView($macro, $file); 38 + $properties = $this->buildPropertyView($macro, $actions); 39 + if ($file) { 40 + $file_view = new PHUIPropertyListView(); 41 + $file_view->addImageContent( 42 + phutil_tag( 43 + 'img', 44 + array( 45 + 'src' => $file->getViewURI(), 46 + 'class' => 'phabricator-image-macro-hero', 47 + ))); 48 + } 39 49 40 50 $xactions = id(new PhabricatorMacroTransactionQuery()) 41 51 ->setViewer($request->getUser()) ··· 93 103 94 104 $object_box = id(new PHUIObjectBoxView()) 95 105 ->setHeader($header) 96 - ->setActionList($actions) 97 - ->setPropertyList($properties); 106 + ->addPropertyList($properties); 107 + 108 + if ($file_view) { 109 + $object_box->addPropertyList($file_view); 110 + } 98 111 99 112 $comment_box = id(new PHUIObjectBoxView()) 100 113 ->setFlush(true) ··· 153 166 154 167 private function buildPropertyView( 155 168 PhabricatorFileImageMacro $macro, 156 - PhabricatorFile $file = null) { 169 + PhabricatorActionListView $actions) { 157 170 158 - $view = id(new PhabricatorPropertyListView()) 171 + $view = id(new PHUIPropertyListView()) 159 172 ->setUser($this->getRequest()->getUser()) 160 - ->setObject($macro); 173 + ->setObject($macro) 174 + ->setActionList($actions); 161 175 162 176 switch ($macro->getAudioBehavior()) { 163 177 case PhabricatorFileImageMacro::AUDIO_BEHAVIOR_ONCE: ··· 171 185 $audio_phid = $macro->getAudioPHID(); 172 186 if ($audio_phid) { 173 187 $this->loadHandles(array($audio_phid)); 174 - 175 188 $view->addProperty( 176 189 pht('Audio'), 177 190 $this->getHandle($audio_phid)->renderLink()); 178 191 } 179 192 180 - 181 193 $view->invokeWillRenderEvent(); 182 - 183 - if ($file) { 184 - $view->addImageContent( 185 - phutil_tag( 186 - 'img', 187 - array( 188 - 'src' => $file->getViewURI(), 189 - 'class' => 'phabricator-image-macro-hero', 190 - ))); 191 - } 192 194 193 195 return $view; 194 196 }
+24 -9
src/applications/maniphest/controller/ManiphestTaskDetailController.php
··· 352 352 ->setActionList($actions); 353 353 354 354 $header = $this->buildHeaderView($task); 355 - $properties = $this->buildPropertyView($task, $field_list, $edges, $engine); 355 + $properties = $this->buildPropertyView( 356 + $task, $field_list, $edges, $actions); 357 + $description = $this->buildDescriptionView($task, $engine); 356 358 357 359 if (!$user->isLoggedIn()) { 358 360 // TODO: Eventually, everything should run through this. For now, we're ··· 365 367 366 368 $object_box = id(new PHUIObjectBoxView()) 367 369 ->setHeader($header) 368 - ->setActionList($actions) 369 - ->setPropertyList($properties); 370 + ->addPropertyList($properties); 371 + 372 + if ($description) { 373 + $object_box->addPropertyList($description); 374 + } 370 375 371 376 $comment_box = id(new PHUIObjectBoxView()) 372 377 ->setFlush(true) ··· 503 508 ManiphestTask $task, 504 509 PhabricatorCustomFieldList $field_list, 505 510 array $edges, 506 - PhabricatorMarkupEngine $engine) { 511 + PhabricatorActionListView $actions) { 507 512 508 513 $viewer = $this->getRequest()->getUser(); 509 514 510 - $view = id(new PhabricatorPropertyListView()) 515 + $view = id(new PHUIPropertyListView()) 511 516 ->setUser($viewer) 512 - ->setObject($task); 517 + ->setObject($task) 518 + ->setActionList($actions); 513 519 514 520 $view->addProperty( 515 521 pht('Assigned To'), ··· 633 639 634 640 $view->invokeWillRenderEvent(); 635 641 642 + return $view; 643 + } 644 + 645 + private function buildDescriptionView( 646 + ManiphestTask $task, 647 + PhabricatorMarkupEngine $engine) { 648 + 649 + $section = null; 636 650 if (strlen($task->getDescription())) { 637 - $view->addSectionHeader(pht('Description')); 638 - $view->addTextContent( 651 + $section = new PHUIPropertyListView(); 652 + $section->addSectionHeader(pht('Description')); 653 + $section->addTextContent( 639 654 phutil_tag( 640 655 'div', 641 656 array( ··· 644 659 $engine->getOutput($task, ManiphestTask::MARKUP_FIELD_DESCRIPTION))); 645 660 } 646 661 647 - return $view; 662 + return $section; 648 663 } 649 664 650 665 }
+8 -5
src/applications/meta/controller/PhabricatorApplicationDetailViewController.php
··· 39 39 $header->setStatus('open', 'red', pht('Uninstalled')); 40 40 } 41 41 42 - $properties = $this->buildPropertyView($selected); 43 42 $actions = $this->buildActionView($user, $selected); 43 + $properties = $this->buildPropertyView($selected, $actions); 44 44 45 45 $object_box = id(new PHUIObjectBoxView()) 46 46 ->setHeader($header) 47 - ->setActionList($actions) 48 - ->setPropertyList($properties); 47 + ->addPropertyList($properties); 49 48 50 49 return $this->buildApplicationPage( 51 50 array( ··· 58 57 )); 59 58 } 60 59 61 - private function buildPropertyView(PhabricatorApplication $application) { 60 + private function buildPropertyView( 61 + PhabricatorApplication $application, 62 + PhabricatorActionListView $actions) { 63 + 62 64 $viewer = $this->getRequest()->getUser(); 63 65 64 - $properties = id(new PhabricatorPropertyListView()) 66 + $properties = id(new PHUIPropertyListView()) 65 67 ->addProperty(pht('Description'), $application->getShortDescription()); 68 + $properties->setActionList($actions); 66 69 67 70 if ($application->isBeta()) { 68 71 $properties->addProperty(
+7 -6
src/applications/paste/controller/PhabricatorPasteViewController.php
··· 68 68 69 69 $header = $this->buildHeaderView($paste); 70 70 $actions = $this->buildActionView($user, $paste, $file); 71 - $properties = $this->buildPropertyView($paste, $fork_phids); 71 + $properties = $this->buildPropertyView($paste, $fork_phids, $actions); 72 72 73 73 $object_box = id(new PHUIObjectBoxView()) 74 74 ->setHeader($header) 75 - ->setActionList($actions) 76 - ->setPropertyList($properties); 75 + ->addPropertyList($properties); 77 76 78 77 $source_code = $this->buildSourceCodeView( 79 78 $paste, ··· 206 205 207 206 private function buildPropertyView( 208 207 PhabricatorPaste $paste, 209 - array $child_phids) { 208 + array $child_phids, 209 + PhabricatorActionListView $actions) { 210 210 211 211 $user = $this->getRequest()->getUser(); 212 - $properties = id(new PhabricatorPropertyListView()) 212 + $properties = id(new PHUIPropertyListView()) 213 213 ->setUser($user) 214 - ->setObject($paste); 214 + ->setObject($paste) 215 + ->setActionList($actions); 215 216 216 217 $properties->addProperty( 217 218 pht('Author'),
+9 -7
src/applications/people/controller/PhabricatorPeopleProfileController.php
··· 68 68 ->setHref($this->getApplicationURI('edit/'.$user->getID().'/'))); 69 69 } 70 70 71 - $properties = $this->buildPropertyView($user); 71 + $properties = $this->buildPropertyView($user, $actions); 72 72 73 73 $crumbs = $this->buildApplicationCrumbs(); 74 74 $crumbs->addCrumb( ··· 78 78 79 79 $object_box = id(new PHUIObjectBoxView()) 80 80 ->setHeader($header) 81 - ->setActionList($actions) 82 - ->setPropertyList($properties); 81 + ->addPropertyList($properties); 83 82 84 83 return $this->buildApplicationPage( 85 84 array( ··· 93 92 )); 94 93 } 95 94 96 - private function buildPropertyView(PhabricatorUser $user) { 97 - $viewer = $this->getRequest()->getUser(); 95 + private function buildPropertyView( 96 + PhabricatorUser $user, 97 + PhabricatorActionListView $actions) { 98 98 99 - $view = id(new PhabricatorPropertyListView()) 99 + $viewer = $this->getRequest()->getUser(); 100 + $view = id(new PHUIPropertyListView()) 100 101 ->setUser($viewer) 101 - ->setObject($user); 102 + ->setObject($user) 103 + ->setActionList($actions); 102 104 103 105 $field_list = PhabricatorCustomField::getObjectFields( 104 106 $user,
+9 -5
src/applications/phame/controller/blog/PhameBlogViewController.php
··· 44 44 $this->loadHandles($handle_phids); 45 45 46 46 $actions = $this->renderActions($blog, $user); 47 - $properties = $this->renderProperties($blog, $user); 47 + $properties = $this->renderProperties($blog, $user, $actions); 48 48 $post_list = $this->renderPostList( 49 49 $posts, 50 50 $user, ··· 65 65 66 66 $object_box = id(new PHUIObjectBoxView()) 67 67 ->setHeader($header) 68 - ->setActionList($actions) 69 - ->setPropertyList($properties); 68 + ->addPropertyList($properties); 70 69 71 70 $nav->appendChild( 72 71 array( ··· 83 82 )); 84 83 } 85 84 86 - private function renderProperties(PhameBlog $blog, PhabricatorUser $user) { 85 + private function renderProperties( 86 + PhameBlog $blog, 87 + PhabricatorUser $user, 88 + PhabricatorActionListView $actions) { 89 + 87 90 require_celerity_resource('aphront-tooltip-css'); 88 91 Javelin::initBehavior('phabricator-tooltips'); 89 92 90 - $properties = new PhabricatorPropertyListView(); 93 + $properties = new PHUIPropertyListView(); 94 + $properties->setActionList($actions); 91 95 92 96 $properties->addProperty( 93 97 pht('Skin'),
+7 -6
src/applications/phame/controller/post/PhamePostViewController.php
··· 32 32 $post->getBloggerPHID(), 33 33 )); 34 34 $actions = $this->renderActions($post, $user); 35 - $properties = $this->renderProperties($post, $user); 35 + $properties = $this->renderProperties($post, $user, $actions); 36 36 37 37 $crumbs = $this->buildApplicationCrumbs(); 38 38 $crumbs->setActionList($actions); ··· 50 50 51 51 $object_box = id(new PHUIObjectBoxView()) 52 52 ->setHeader($header) 53 - ->setActionList($actions) 54 - ->setPropertyList($properties); 53 + ->addPropertyList($properties); 55 54 56 55 if ($post->isDraft()) { 57 56 $object_box->appendChild( ··· 167 166 168 167 private function renderProperties( 169 168 PhamePost $post, 170 - PhabricatorUser $user) { 169 + PhabricatorUser $user, 170 + PhabricatorActionListView $actions) { 171 171 172 - $properties = id(new PhabricatorPropertyListView()) 172 + $properties = id(new PHUIPropertyListView()) 173 173 ->setUser($user) 174 - ->setObject($post); 174 + ->setObject($post) 175 + ->setActionList($actions); 175 176 176 177 $properties->addProperty( 177 178 pht('Blog'),
+3 -3
src/applications/phlux/controller/PhluxViewController.php
··· 55 55 56 56 $display_value = json_encode($var->getVariableValue()); 57 57 58 - $properties = id(new PhabricatorPropertyListView()) 58 + $properties = id(new PHUIPropertyListView()) 59 59 ->setUser($user) 60 60 ->setObject($var) 61 + ->setActionList($actions) 61 62 ->addProperty(pht('Value'), $display_value); 62 63 63 64 $xactions = id(new PhluxTransactionQuery()) ··· 76 77 77 78 $object_box = id(new PHUIObjectBoxView()) 78 79 ->setHeader($header) 79 - ->setActionList($actions) 80 - ->setPropertyList($properties); 80 + ->addPropertyList($properties); 81 81 82 82 return $this->buildApplicationPage( 83 83 array(
+8 -7
src/applications/pholio/controller/PholioMockViewController.php
··· 73 73 ->setPolicyObject($mock); 74 74 75 75 $actions = $this->buildActionView($mock); 76 - $properties = $this->buildPropertyView($mock, $engine); 76 + $properties = $this->buildPropertyView($mock, $engine, $actions); 77 77 78 78 require_celerity_resource('pholio-css'); 79 79 require_celerity_resource('pholio-inline-comments-css'); ··· 105 105 106 106 $object_box = id(new PHUIObjectBoxView()) 107 107 ->setHeader($header) 108 - ->setActionList($actions) 109 - ->setPropertyList($properties); 108 + ->addPropertyList($properties); 110 109 111 110 $content = array( 112 111 $crumbs, ··· 197 196 198 197 private function buildPropertyView( 199 198 PholioMock $mock, 200 - PhabricatorMarkupEngine $engine) { 199 + PhabricatorMarkupEngine $engine, 200 + PhabricatorActionListView $actions) { 201 201 202 202 $user = $this->getRequest()->getUser(); 203 203 204 - $properties = id(new PhabricatorPropertyListView()) 204 + $properties = id(new PHUIPropertyListView()) 205 205 ->setUser($user) 206 - ->setObject($mock); 206 + ->setObject($mock) 207 + ->setActionList($actions); 207 208 208 209 $properties->addProperty( 209 210 pht('Author'), ··· 222 223 $properties->invokeWillRenderEvent(); 223 224 224 225 $properties->addImageContent( 225 - $engine->getOutput($mock, PholioMock::MARKUP_FIELD_DESCRIPTION)); 226 + $engine->getOutput($mock, PholioMock::MARKUP_FIELD_DESCRIPTION)); 226 227 227 228 return $properties; 228 229 }
+3 -3
src/applications/phortune/controller/PhortuneAccountViewController.php
··· 50 50 51 51 $crumbs->setActionList($actions); 52 52 53 - $properties = id(new PhabricatorPropertyListView()) 53 + $properties = id(new PHUIPropertyListView()) 54 54 ->setObject($account) 55 55 ->setUser($user); 56 56 57 57 $properties->addProperty(pht('Balance'), $account->getBalanceInCents()); 58 + $properties->setActionList($actions); 58 59 59 60 $payment_methods = $this->buildPaymentMethodsSection($account); 60 61 $purchase_history = $this->buildPurchaseHistorySection($account); ··· 62 63 63 64 $object_box = id(new PHUIObjectBoxView()) 64 65 ->setHeader($header) 65 - ->setActionList($actions) 66 - ->setPropertyList($properties); 66 + ->addPropertyList($properties); 67 67 68 68 return $this->buildApplicationPage( 69 69 array(
+3 -3
src/applications/phortune/controller/PhortuneProductViewController.php
··· 59 59 ->setName(pht('#%d', $product->getID())) 60 60 ->setHref($request->getRequestURI())); 61 61 62 - $properties = id(new PhabricatorPropertyListView()) 62 + $properties = id(new PHUIPropertyListView()) 63 63 ->setUser($user) 64 + ->setActionList($actions) 64 65 ->addProperty(pht('Type'), $product->getTypeName()) 65 66 ->addProperty( 66 67 pht('Price'), ··· 83 84 84 85 $object_box = id(new PHUIObjectBoxView()) 85 86 ->setHeader($header) 86 - ->setActionList($actions) 87 - ->setPropertyList($properties); 87 + ->addPropertyList($properties); 88 88 89 89 return $this->buildApplicationPage( 90 90 array(
+5 -2
src/applications/phriction/controller/PhrictionDocumentController.php
··· 162 162 $header = id(new PHUIHeaderView()) 163 163 ->setHeader($page_title); 164 164 165 + $prop_list = new PHUIPropertyGroupView(); 166 + $prop_list->addPropertyList($properties); 167 + 165 168 $page_content = id(new PHUIDocumentView()) 166 169 ->setOffset(true) 167 170 ->setHeader($header) 168 171 ->appendChild( 169 172 array( 170 173 $actions, 171 - $properties, 174 + $prop_list, 172 175 $move_notice, 173 176 $core_content, 174 177 )); ··· 202 205 $slug) { 203 206 204 207 $viewer = $this->getRequest()->getUser(); 205 - $view = id(new PhabricatorPropertyListView()) 208 + $view = id(new PHUIPropertyListView()) 206 209 ->setUser($viewer) 207 210 ->setObject($document); 208 211
+16 -12
src/applications/ponder/controller/PonderQuestionViewController.php
··· 48 48 ->setHeader($question->getTitle()); 49 49 50 50 $actions = $this->buildActionListView($question); 51 - $properties = $this->buildPropertyListView($question); 51 + $properties = $this->buildPropertyListView($question, $actions); 52 52 53 53 $object_box = id(new PHUIObjectBoxView()) 54 54 ->setHeader($header) 55 - ->setActionList($actions) 56 - ->setPropertyList($properties); 55 + ->addPropertyList($properties); 57 56 58 57 $crumbs = $this->buildApplicationCrumbs($this->buildSideNavView()); 59 58 $crumbs->setActionList($actions); ··· 130 129 } 131 130 132 131 private function buildPropertyListView( 133 - PonderQuestion $question) { 132 + PonderQuestion $question, 133 + PhabricatorActionListView $actions) { 134 134 135 135 $viewer = $this->getRequest()->getUser(); 136 - $view = id(new PhabricatorPropertyListView()) 136 + $view = id(new PHUIPropertyListView()) 137 137 ->setUser($viewer) 138 - ->setObject($question); 138 + ->setObject($question) 139 + ->setActionList($actions); 139 140 140 141 $this->loadHandles(array($question->getAuthorPHID())); 141 142 ··· 265 266 ->setHeader($this->getHandle($author_phid)->getFullName()); 266 267 267 268 $actions = $this->buildAnswerActions($answer); 268 - $properties = $this->buildAnswerProperties($answer); 269 + $properties = $this->buildAnswerProperties($answer, $actions); 269 270 270 271 $object_box = id(new PHUIObjectBoxView()) 271 272 ->setHeader($header) 272 - ->setActionList($actions) 273 - ->setPropertyList($properties); 273 + ->addPropertyList($properties); 274 274 275 275 $out[] = $object_box; 276 276 $details = array(); ··· 339 339 return $view; 340 340 } 341 341 342 - private function buildAnswerProperties(PonderAnswer $answer) { 342 + private function buildAnswerProperties( 343 + PonderAnswer $answer, 344 + PhabricatorActionListView $actions) { 345 + 343 346 $viewer = $this->getRequest()->getUser(); 344 - $view = id(new PhabricatorPropertyListView()) 347 + $view = id(new PHUIPropertyListView()) 345 348 ->setUser($viewer) 346 - ->setObject($answer); 349 + ->setObject($answer) 350 + ->setActionList($actions); 347 351 348 352 $view->addProperty( 349 353 pht('Created'),
+8 -6
src/applications/project/controller/PhabricatorProjectProfileController.php
··· 59 59 ->setImage($picture); 60 60 61 61 $actions = $this->buildActionListView($project); 62 - $properties = $this->buildPropertyListView($project); 62 + $properties = $this->buildPropertyListView($project, $actions); 63 63 64 64 $crumbs = $this->buildApplicationCrumbs(); 65 65 $crumbs->addCrumb( ··· 68 68 69 69 $object_box = id(new PHUIObjectBoxView()) 70 70 ->setHeader($header) 71 - ->setActionList($actions) 72 - ->setPropertyList($properties); 71 + ->addPropertyList($properties); 73 72 74 73 return $this->buildApplicationPage( 75 74 array( ··· 240 239 return $view; 241 240 } 242 241 243 - private function buildPropertyListView(PhabricatorProject $project) { 242 + private function buildPropertyListView( 243 + PhabricatorProject $project, 244 + PhabricatorActionListView $actions) { 244 245 $request = $this->getRequest(); 245 246 $viewer = $request->getUser(); 246 247 247 - $view = id(new PhabricatorPropertyListView()) 248 + $view = id(new PHUIPropertyListView()) 248 249 ->setUser($viewer) 249 - ->setObject($project); 250 + ->setObject($project) 251 + ->setActionList($actions); 250 252 251 253 $view->addProperty( 252 254 pht('Created'),
+4 -4
src/applications/releeph/controller/branch/ReleephBranchViewController.php
··· 160 160 ->setHref($history_uri) 161 161 ->setIcon('transcript')); 162 162 163 - $properties = id(new PhabricatorPropertyListView()) 163 + $properties = id(new PHUIPropertyListView()) 164 164 ->setUser($viewer) 165 - ->setObject($branch); 165 + ->setObject($branch) 166 + ->setActionList($actions); 166 167 167 168 $properties->addProperty( 168 169 pht('Branch'), ··· 170 171 171 172 return id(new PHUIObjectBoxView()) 172 173 ->setHeader($header) 173 - ->setActionList($actions) 174 - ->setPropertyList($properties); 174 + ->addPropertyList($properties); 175 175 } 176 176 177 177 }
+4 -3
src/applications/releeph/controller/project/ReleephProjectViewController.php
··· 220 220 ->setHref($history_uri) 221 221 ->setIcon('transcript')); 222 222 223 - $properties = id(new PhabricatorPropertyListView()) 223 + $properties = id(new PHUIPropertyListView()) 224 224 ->setUser($viewer) 225 225 ->setObject($project); 226 226 227 227 $properties->addProperty( 228 228 pht('Repository'), 229 229 $project->getRepository()->getName()); 230 + 231 + $properties->setActionList($actions); 230 232 231 233 $pushers = $project->getPushers(); 232 234 if ($pushers) { ··· 238 240 239 241 return id(new PHUIObjectBoxView()) 240 242 ->setHeader($header) 241 - ->setActionList($actions) 242 - ->setPropertyList($properties); 243 + ->addPropertyList($properties); 243 244 } 244 245 245 246 }
+9 -6
src/applications/slowvote/controller/PhabricatorSlowvotePollController.php
··· 47 47 ->setPolicyObject($poll); 48 48 49 49 $actions = $this->buildActionView($poll); 50 - $properties = $this->buildPropertyView($poll); 50 + $properties = $this->buildPropertyView($poll, $actions); 51 51 52 52 $crumbs = $this->buildApplicationCrumbs(); 53 53 $crumbs->addCrumb( ··· 59 59 60 60 $object_box = id(new PHUIObjectBoxView()) 61 61 ->setHeader($header) 62 - ->setActionList($actions) 63 - ->setPropertyList($properties); 62 + ->addPropertyList($properties); 64 63 65 64 return $this->buildApplicationPage( 66 65 array( ··· 105 104 return $view; 106 105 } 107 106 108 - private function buildPropertyView(PhabricatorSlowvotePoll $poll) { 107 + private function buildPropertyView( 108 + PhabricatorSlowvotePoll $poll, 109 + PhabricatorActionListView $actions) { 110 + 109 111 $viewer = $this->getRequest()->getUser(); 110 112 111 - $view = id(new PhabricatorPropertyListView()) 113 + $view = id(new PHUIPropertyListView()) 112 114 ->setUser($viewer) 113 - ->setObject($poll); 115 + ->setObject($poll) 116 + ->setActionList($actions); 114 117 115 118 $view->invokeWillRenderEvent(); 116 119
+140
src/applications/uiexample/examples/PHUIPropertyListExample.php
··· 1 + <?php 2 + 3 + final class PHUIPropertyListExample extends PhabricatorUIExample { 4 + 5 + public function getName() { 6 + return 'Property List'; 7 + } 8 + 9 + public function getDescription() { 10 + return hsprintf( 11 + 'Use <tt>PHUIPropertyListView</tt> to render object properties.'); 12 + } 13 + 14 + public function renderExample() { 15 + $request = $this->getRequest(); 16 + $user = $request->getUser(); 17 + 18 + $details1 = id(new PHUIListItemView()) 19 + ->setName('Details') 20 + ->setHref('#') 21 + ->setSelected(true) 22 + ->setType(PHUIListItemView::TYPE_LINK); 23 + 24 + $details2 = id(new PHUIListItemView()) 25 + ->setName('Lint (Warn)') 26 + ->setHref('#') 27 + ->setStatusColor(PHUIListItemView::STATUS_WARN) 28 + ->setType(PHUIListItemView::TYPE_LINK); 29 + 30 + $details3 = id(new PHUIListItemView()) 31 + ->setName('Unit (3/5)') 32 + ->setHref('#') 33 + ->setStatusColor(PHUIListItemView::STATUS_FAIL) 34 + ->setType(PHUIListItemView::TYPE_LINK); 35 + 36 + $statustabs = id(new PHUIListView()) 37 + ->setType(PHUIListView::NAVBAR_LIST) 38 + ->addMenuItem($details1) 39 + ->addMenuItem($details2) 40 + ->addMenuItem($details3); 41 + 42 + $view = new PHUIPropertyListView(); 43 + $view->setTabs($statustabs); 44 + 45 + $view->addProperty( 46 + pht('Color'), 47 + pht('Yellow')); 48 + 49 + $view->addProperty( 50 + pht('Size'), 51 + pht('Mouse')); 52 + 53 + $view->addProperty( 54 + pht('Element'), 55 + pht('Electric')); 56 + 57 + $view->addTextContent( 58 + 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. '. 59 + 'Quisque rhoncus tempus massa, sit amet faucibus lectus bibendum '. 60 + 'viverra. Nunc tempus tempor quam id iaculis. Maecenas lectus '. 61 + 'velit, aliquam et consequat quis, tincidunt id dolor.'); 62 + 63 + 64 + $view2 = new PHUIPropertyListView(); 65 + $view2->addSectionHeader('Colors of the Rainbow'); 66 + 67 + $view2->addProperty('R', 'Red'); 68 + $view2->addProperty('O', 'Orange'); 69 + $view2->addProperty('Y', 'Yellow'); 70 + $view2->addProperty('G', 'Green'); 71 + $view2->addProperty('B', 'Blue'); 72 + $view2->addProperty('I', 'Indigo'); 73 + $view2->addProperty('V', 'Violet'); 74 + 75 + 76 + $view3 = new PHUIPropertyListView(); 77 + $view3->addSectionHeader('Haiku About Pasta'); 78 + 79 + $view3->addTextContent( 80 + hsprintf( 81 + 'this is a pasta<br />'. 82 + 'haiku. it is very bad.<br />'. 83 + 'what did you expect?')); 84 + 85 + $object_box1 = id(new PHUIObjectBoxView()) 86 + ->setHeaderText('PHUIPropertyListView Stackered') 87 + ->addPropertyList($view) 88 + ->addPropertyList($view2) 89 + ->addPropertyList($view3); 90 + 91 + $edge_cases_view = new PHUIPropertyListView(); 92 + 93 + $edge_cases_view->addProperty( 94 + pht('Description'), 95 + pht('These layouts test UI edge cases in the element. This block '. 96 + 'tests wrapping and overflow behavior.')); 97 + 98 + $edge_cases_view->addProperty( 99 + pht('A Very Very Very Very Very Very Very Very Very Long Property Label'), 100 + pht('This property label and property value are quite long. They '. 101 + 'demonstrate the wrapping behavior of the element, or lack thereof '. 102 + 'if something terrible has happened.')); 103 + 104 + $edge_cases_view->addProperty( 105 + pht('AVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongUnbrokenPropertyLabel'), 106 + pht('Thispropertylabelandpropertyvaluearequitelongandhave'. 107 + 'nospacestheydemonstratetheoverflowbehavioroftheelement'. 108 + 'orlackthereof.')); 109 + 110 + 111 + $edge_cases_view->addProperty( 112 + pht('Description'), 113 + pht('The next section is an empty text block.')); 114 + 115 + $edge_cases_view->addTextContent(''); 116 + 117 + $edge_cases_view->addProperty( 118 + pht('Description'), 119 + pht('This section should have multiple properties with the same name.')); 120 + 121 + $edge_cases_view->addProperty( 122 + pht('Joe'), 123 + pht('Smith')); 124 + $edge_cases_view->addProperty( 125 + pht('Joe'), 126 + pht('Smith')); 127 + $edge_cases_view->addProperty( 128 + pht('Joe'), 129 + pht('Smith')); 130 + 131 + $object_box2 = id(new PHUIObjectBoxView()) 132 + ->setHeaderText('Some Bad Examples') 133 + ->addPropertyList($edge_cases_view); 134 + 135 + return array( 136 + $object_box1, 137 + $object_box2, 138 + ); 139 + } 140 + }
-125
src/applications/uiexample/examples/PhabricatorPropertyListExample.php
··· 1 - <?php 2 - 3 - final class PhabricatorPropertyListExample extends PhabricatorUIExample { 4 - 5 - public function getName() { 6 - return 'Property List'; 7 - } 8 - 9 - public function getDescription() { 10 - return hsprintf( 11 - 'Use <tt>PhabricatorPropertyListView</tt> to render object properties.'); 12 - } 13 - 14 - public function renderExample() { 15 - $request = $this->getRequest(); 16 - $user = $request->getUser(); 17 - 18 - $view = new PhabricatorPropertyListView(); 19 - 20 - $view->addProperty( 21 - pht('Color'), 22 - pht('Yellow')); 23 - 24 - $view->addProperty( 25 - pht('Size'), 26 - pht('Mouse')); 27 - 28 - $view->addProperty( 29 - pht('Element'), 30 - pht('Electric')); 31 - 32 - $view->addTextContent( 33 - 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. '. 34 - 'Quisque rhoncus tempus massa, sit amet faucibus lectus bibendum '. 35 - 'viverra. Nunc tempus tempor quam id iaculis. Maecenas lectus '. 36 - 'velit, aliquam et consequat quis, tincidunt id dolor.'); 37 - 38 - 39 - $view->addSectionHeader('Colors of the Rainbow'); 40 - 41 - $view->addProperty('R', 'Red'); 42 - $view->addProperty('O', 'Orange'); 43 - $view->addProperty('Y', 'Yellow'); 44 - $view->addProperty('G', 'Green'); 45 - $view->addProperty('B', 'Blue'); 46 - $view->addProperty('I', 'Indigo'); 47 - $view->addProperty('V', 'Violet'); 48 - 49 - $view->addSectionHeader('Haiku About Pasta'); 50 - 51 - $view->addTextContent( 52 - hsprintf( 53 - 'this is a pasta<br />'. 54 - 'haiku. it is very bad.<br />'. 55 - 'what did you expect?')); 56 - 57 - $edge_cases_header = id(new PHUIHeaderView()) 58 - ->setHeader(pht('Edge Cases')); 59 - 60 - $edge_cases_view = new PhabricatorPropertyListView(); 61 - 62 - $edge_cases_view->addProperty( 63 - pht('Description'), 64 - pht('These layouts test UI edge cases in the element. This block '. 65 - 'tests wrapping and overflow behavior.')); 66 - 67 - $edge_cases_view->addProperty( 68 - pht('A Very Very Very Very Very Very Very Very Very Long Property Label'), 69 - pht('This property label and property value are quite long. They '. 70 - 'demonstrate the wrapping behavior of the element, or lack thereof '. 71 - 'if something terrible has happened.')); 72 - 73 - $edge_cases_view->addProperty( 74 - pht('AVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongUnbrokenPropertyLabel'), 75 - pht('Thispropertylabelandpropertyvaluearequitelongandhave'. 76 - 'nospacestheydemonstratetheoverflowbehavioroftheelement'. 77 - 'orlackthereof.')); 78 - 79 - 80 - $edge_cases_view->addProperty( 81 - pht('Description'), 82 - pht('The next section is an empty text block.')); 83 - 84 - $edge_cases_view->addTextContent(''); 85 - 86 - $edge_cases_view->addProperty( 87 - pht('Description'), 88 - pht('This section should have multiple properties with the same name.')); 89 - 90 - $edge_cases_view->addProperty( 91 - pht('Joe'), 92 - pht('Smith')); 93 - $edge_cases_view->addProperty( 94 - pht('Joe'), 95 - pht('Smith')); 96 - $edge_cases_view->addProperty( 97 - pht('Joe'), 98 - pht('Smith')); 99 - 100 - $edge_cases_view->addProperty( 101 - pht('Description'), 102 - pht('The next section shows adjacent section headers.')); 103 - 104 - $edge_cases_view->addSectionHeader('Several'); 105 - $edge_cases_view->addSectionHeader('Adjacent'); 106 - $edge_cases_view->addSectionHeader('Section'); 107 - $edge_cases_view->addSectionHeader('Headers'); 108 - 109 - $edge_cases_view->addProperty( 110 - pht('Description'), 111 - pht('The next section is several adjacent text blocks.')); 112 - 113 - $edge_cases_view->addTextContent('Lorem'); 114 - $edge_cases_view->addTextContent('ipsum'); 115 - $edge_cases_view->addTextContent('dolor'); 116 - $edge_cases_view->addTextContent('sit'); 117 - $edge_cases_view->addTextContent('amet...'); 118 - 119 - return array( 120 - $view, 121 - $edge_cases_header, 122 - $edge_cases_view, 123 - ); 124 - } 125 - }
+1 -1
src/infrastructure/customfield/field/PhabricatorCustomFieldList.php
··· 85 85 public function appendFieldsToPropertyList( 86 86 PhabricatorCustomFieldInterface $object, 87 87 PhabricatorUser $viewer, 88 - PhabricatorPropertyListView $view) { 88 + PHUIPropertyListView $view) { 89 89 90 90 $this->readFieldsFromStorage($object); 91 91 $fields = $this->fields;
+22 -13
src/view/layout/PhabricatorPropertyListView.php src/view/phui/PHUIPropertyListView.php
··· 1 1 <?php 2 2 3 - final class PhabricatorPropertyListView extends AphrontView { 3 + final class PHUIPropertyListView extends AphrontView { 4 4 5 5 private $parts = array(); 6 6 private $hasKeyboardShortcuts; 7 7 private $object; 8 8 private $invokedWillRenderEvent; 9 9 private $actionList; 10 + private $tabs; 10 11 11 12 protected function canAppendChild() { 12 13 return false; ··· 49 50 return $this; 50 51 } 51 52 53 + public function setTabs(PHUIListView $tabs) { 54 + $this->tabs = $tabs; 55 + return $tabs; 56 + } 57 + 52 58 public function addSectionHeader($name) { 53 59 $this->parts[] = array( 54 60 'type' => 'section', ··· 90 96 public function render() { 91 97 $this->invokeWillRenderEvent(); 92 98 93 - require_celerity_resource('phabricator-property-list-view-css'); 99 + require_celerity_resource('phui-property-list-view-css'); 94 100 95 101 $items = array(); 96 102 foreach ($this->parts as $part) { ··· 114 120 return phutil_tag( 115 121 'div', 116 122 array( 117 - 'class' => 'phabricator-property-list-view', 123 + 'class' => 'phui-property-list-section', 118 124 ), 119 - $items); 125 + array( 126 + $this->tabs, 127 + $items, 128 + )); 120 129 } 121 130 122 131 private function renderPropertyPart(array $part) { ··· 132 141 $items[] = phutil_tag( 133 142 'dt', 134 143 array( 135 - 'class' => 'phabricator-property-list-key', 144 + 'class' => 'phui-property-list-key', 136 145 ), 137 146 array($key, ' ')); 138 147 139 148 $items[] = phutil_tag( 140 149 'dd', 141 150 array( 142 - 'class' => 'phabricator-property-list-value', 151 + 'class' => 'phui-property-list-value', 143 152 ), 144 153 array($value, ' ')); 145 154 } ··· 147 156 $list = phutil_tag( 148 157 'dl', 149 158 array( 150 - 'class' => 'phabricator-property-list-properties', 159 + 'class' => 'phui-property-list-properties', 151 160 ), 152 161 $items); 153 162 ··· 159 168 $list = phutil_tag( 160 169 'div', 161 170 array( 162 - 'class' => 'phabricator-property-list-properties-wrap', 171 + 'class' => 'phui-property-list-properties-wrap', 163 172 ), 164 173 array($shortcuts, $list)); 165 174 ··· 168 177 $action_list = phutil_tag( 169 178 'div', 170 179 array( 171 - 'class' => 'phabricator-property-list-actions', 180 + 'class' => 'phui-property-list-actions', 172 181 ), 173 182 $this->actionList); 174 183 $this->actionList = null; ··· 177 186 return phutil_tag( 178 187 'div', 179 188 array( 180 - 'class' => 'phabricator-property-list-container grouped', 189 + 'class' => 'phui-property-list-container grouped', 181 190 ), 182 191 array($action_list, $list)); 183 192 } ··· 186 195 return phutil_tag( 187 196 'div', 188 197 array( 189 - 'class' => 'phabricator-property-list-section-header', 198 + 'class' => 'phui-property-list-section-header', 190 199 ), 191 200 $part['name']); 192 201 } 193 202 194 203 private function renderTextPart(array $part) { 195 204 $classes = array(); 196 - $classes[] = 'phabricator-property-list-text-content'; 205 + $classes[] = 'phui-property-list-text-content'; 197 206 if ($part['type'] == 'image') { 198 - $classes[] = 'phabricator-property-list-image-content'; 207 + $classes[] = 'phui-property-list-image-content'; 199 208 } 200 209 return phutil_tag( 201 210 'div',
+12 -13
src/view/phui/PHUIObjectBoxView.php
··· 8 8 private $validationException; 9 9 private $header; 10 10 private $flush; 11 - private $propertyList; 12 - private $actionList; 13 - 14 - public function setActionList(PhabricatorActionListView $action_list) { 15 - $this->actionList = $action_list; 16 - return $this; 17 - } 11 + private $propertyList = array(); 18 12 19 - public function setPropertyList(PhabricatorPropertyListView $property_list) { 20 - $this->propertyList = $property_list; 13 + // This is mostly a conveinence method to lessen code dupe 14 + // when building objectboxes. 15 + public function addPropertyList(PHUIPropertyListView $property_list) { 16 + $this->propertyList[] = $property_list; 21 17 return $this; 22 18 } 23 19 ··· 78 74 } 79 75 } 80 76 81 - $property_list = $this->propertyList; 82 - if ($this->actionList && $this->propertyList) { 83 - $property_list->setActionList($this->actionList); 77 + $property_list = null; 78 + if ($this->propertyList) { 79 + $property_list = new PHUIPropertyGroupView(); 80 + foreach ($this->propertyList as $item) { 81 + $property_list->addPropertyList($item); 82 + } 84 83 } 85 84 86 85 $content = id(new PHUIBoxView()) ··· 90 89 $this->formError, 91 90 $exception_errors, 92 91 $this->form, 93 - $this->propertyList, 92 + $property_list, 94 93 $this->renderChildren(), 95 94 )) 96 95 ->setBorder(true)
+24
src/view/phui/PHUIPropertyGroupView.php
··· 1 + <?php 2 + 3 + final class PHUIPropertyGroupView extends AphrontTagView { 4 + 5 + private $items; 6 + 7 + public function addPropertyList(PHUIPropertyListView $item) { 8 + $this->items[] = $item; 9 + } 10 + 11 + protected function canAppendChild() { 12 + return false; 13 + } 14 + 15 + protected function getTagAttributes() { 16 + return array( 17 + 'class' => 'phui-property-list-view', 18 + ); 19 + } 20 + 21 + protected function getTagContent() { 22 + return $this->items; 23 + } 24 + }
+1 -1
webroot/rsrc/css/diviner/diviner-shared.css
··· 73 73 width: 100%; 74 74 } 75 75 76 - .phabricator-property-list-view + .diviner-document-section { 76 + .phui-property-list-view + .diviner-document-section { 77 77 margin-top: -1px; 78 78 } 79 79
+30 -27
webroot/rsrc/css/layout/phabricator-property-list-view.css webroot/rsrc/css/phui/phui-property-list-view.css
··· 1 1 /** 2 - * @provides phabricator-property-list-view-css 2 + * @provides phui-property-list-view-css 3 3 */ 4 4 5 - .phabricator-property-list-view { 5 + .phui-property-list-view { 6 6 background-color: #fff; 7 7 } 8 8 9 - .phabricator-property-list-view .keyboard-shortcuts-available { 9 + .phui-property-list-view .keyboard-shortcuts-available { 10 10 float: right; 11 11 height: 16px; 12 12 margin: 12px 10px -28px 0px; ··· 23 23 display: none; 24 24 } 25 25 26 - .phabricator-property-list-container + 27 - .phabricator-property-list-section-header { 28 - border-color: {$lightgreyborder}; 26 + .phui-property-list-section + 27 + .phui-property-list-section { 28 + border-color: {$thinblueborder}; 29 29 border-style: solid; 30 30 border-width: 1px 0 0; 31 31 } 32 32 33 - .device-desktop .phabricator-property-list-container { 33 + .device-desktop .phui-property-list-container { 34 34 padding: 12px 0 12px 0; 35 35 width: 100%; 36 36 } 37 37 38 - .device .phabricator-property-list-container { 38 + .device .phui-property-list-container { 39 39 padding: 12px 0 4px 0; 40 40 } 41 41 42 - .phabricator-property-list-key { 42 + .phui-property-list-key { 43 43 color: {$bluetext}; 44 44 font-weight: bold; 45 45 overflow: hidden; 46 46 white-space: nowrap; 47 47 } 48 48 49 - .device-desktop .phabricator-property-list-key { 49 + .device-desktop .phui-property-list-key { 50 50 width: 18%; 51 51 margin-left: 1%; 52 52 text-align: right; ··· 55 55 margin-bottom: 4px; 56 56 } 57 57 58 - .device .phabricator-property-list-key { 58 + .device .phui-property-list-key { 59 59 padding-left: 8px; 60 60 } 61 61 62 - .phabricator-property-list-value { 62 + .phui-property-list-value { 63 63 color: {$darkgreytext}; 64 64 overflow: hidden; 65 65 line-height: 17px; 66 66 } 67 67 68 - .device-desktop .phabricator-property-list-value { 68 + .device-desktop .phui-property-list-value { 69 69 width: 78%; 70 70 margin-left: 1%; 71 71 float: left; 72 72 margin-bottom: 4px; 73 73 } 74 74 75 - .device .phabricator-property-list-value { 75 + .device .phui-property-list-value { 76 76 padding-left: 16px; 77 77 margin-bottom: 8px; 78 78 } 79 79 80 - .phabricator-property-list-section-header { 80 + .phui-property-list-section-header { 81 81 color: {$bluetext}; 82 82 padding: 12px 16px 0px; 83 83 text-transform: uppercase; 84 84 font-weight: 700; 85 85 } 86 86 87 - .phabricator-property-list-section-header + .phabricator-property-list-text-content { 88 - border-top: none; 87 + .device .phui-property-list-section-header { 88 + padding-left: 8px; 89 89 } 90 90 91 - .phabricator-property-list-text-content { 91 + .phui-property-list-text-content { 92 92 padding: 12px 16px; 93 93 background: #fff; 94 94 overflow: hidden; 95 - border-top: 1px solid {$lightblueborder}; 95 + } 96 + 97 + .device .phui-property-list-text-content { 98 + padding: 8px; 96 99 } 97 100 98 101 /* In the common case where we immediately follow a header, move back up 30px ··· 104 107 105 108 .device-desktop .phui-header-view 106 109 + .phabricator-action-list-view 107 - + .phabricator-property-list-view { 110 + + .phui-property-list-view { 108 111 margin-top: 0px; 109 112 } 110 113 111 114 112 - .phabricator-property-list-image { 115 + .phui-property-list-image { 113 116 margin: auto; 114 117 max-width: 95%; 115 118 } 116 119 117 - .phabricator-property-list-audio { 120 + .phui-property-list-audio { 118 121 display: block; 119 122 margin: 16px auto; 120 123 width: 50%; ··· 123 126 124 127 /* When tags appear in property lists, give them a little more vertical 125 128 spacing. */ 126 - .phabricator-property-list-view .phabricator-tag-view { 129 + .phui-property-list-view .phabricator-tag-view { 127 130 margin: 2px 0; 128 131 } 129 132 130 - .phabricator-property-list-properties-wrap { 133 + .phui-property-list-properties-wrap { 131 134 float: left; 132 135 width: 78%; 133 136 } 134 137 135 - .device .phabricator-property-list-properties-wrap { 138 + .device .phui-property-list-properties-wrap { 136 139 width: auto; 137 140 border: none; 138 141 } 139 142 140 - .phabricator-property-list-actions { 143 + .phui-property-list-actions { 141 144 width: 20%; 142 145 float: right; 143 146 margin-right: 12px; 144 147 border-left: 1px solid {$thinblueborder}; 145 148 } 146 149 147 - .device .phabricator-property-list-actions { 150 + .device .phui-property-list-actions { 148 151 float: none; 149 152 width: auto; 150 153 margin: -12px 0 12px 0;
+4 -4
webroot/rsrc/css/phui/phui-document.css
··· 86 86 text-shadow: 0 1px 2px #fff; 87 87 } 88 88 89 - .phui-document-content .phabricator-property-list-container { 89 + .phui-document-content .phui-property-list-container { 90 90 border-color: #dde8ef; 91 91 } 92 92 93 - .phui-document-content .phabricator-property-list-view { 93 + .phui-document-content .phui-property-list-view { 94 94 border: none; 95 95 box-shadow: none; 96 96 margin: 0; 97 97 background-color: #f6f7f8; 98 98 } 99 99 100 - .phui-document-content .phabricator-property-list-value { 100 + .phui-document-content .phui-property-list-value { 101 101 width: auto; 102 102 } 103 103 ··· 158 158 padding-right: 160px; 159 159 } 160 160 161 - .phui-document-view .phabricator-property-list-view { 161 + .phui-document-view .phui-property-list-view { 162 162 border-bottom: 1px solid {$thinblueborder}; 163 163 }
+1 -1
webroot/rsrc/css/phui/phui-header-view.css
··· 33 33 border-top-width: 0; 34 34 } 35 35 36 - .phabricator-property-list-view + .diviner-document-section { 36 + .phui-property-list-view + .diviner-document-section { 37 37 margin-top: -1px; 38 38 } 39 39