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
This commit is contained in:
@@ -120,11 +120,15 @@ abstract class DiffusionBrowseController extends DiffusionController {
|
||||
return $view;
|
||||
}
|
||||
|
||||
protected function buildPropertyView(DiffusionRequest $drequest) {
|
||||
protected function buildPropertyView(
|
||||
DiffusionRequest $drequest,
|
||||
PhabricatorActionListView $actions) {
|
||||
|
||||
$viewer = $this->getRequest()->getUser();
|
||||
|
||||
$view = id(new PhabricatorPropertyListView())
|
||||
->setUser($viewer);
|
||||
$view = id(new PHUIPropertyListView())
|
||||
->setUser($viewer)
|
||||
->setActionList($actions);
|
||||
|
||||
$stable_commit = $drequest->getStableCommitName();
|
||||
$callsign = $drequest->getRepository()->getCallsign();
|
||||
|
||||
@@ -21,11 +21,12 @@ final class DiffusionBrowseDirectoryController
|
||||
$reason = $results->getReasonForEmptyResultSet();
|
||||
|
||||
$content = array();
|
||||
$actions = $this->buildActionView($drequest);
|
||||
$properties = $this->buildPropertyView($drequest, $actions);
|
||||
|
||||
$object_box = id(new PHUIObjectBoxView())
|
||||
->setHeader($this->buildHeaderView($drequest))
|
||||
->setActionList($this->buildActionView($drequest))
|
||||
->setPropertyList($this->buildPropertyView($drequest));
|
||||
->addPropertyList($properties);
|
||||
|
||||
$content[] = $object_box;
|
||||
$content[] = $this->renderSearchForm($collapsed = true);
|
||||
|
||||
@@ -107,10 +107,10 @@ final class DiffusionBrowseFileController extends DiffusionBrowseController {
|
||||
$show_color,
|
||||
$binary_uri);
|
||||
|
||||
$properties = $this->buildPropertyView($drequest, $action_list);
|
||||
$object_box = id(new PHUIObjectBoxView())
|
||||
->setHeader($this->buildHeaderView($drequest))
|
||||
->setActionList($action_list)
|
||||
->setPropertyList($this->buildPropertyView($drequest));
|
||||
->addPropertyList($properties);
|
||||
|
||||
$content = array();
|
||||
$content[] = $object_box;
|
||||
@@ -822,7 +822,7 @@ final class DiffusionBrowseFileController extends DiffusionBrowseController {
|
||||
}
|
||||
|
||||
private function buildImageCorpus($file_uri) {
|
||||
$properties = new PhabricatorPropertyListView();
|
||||
$properties = new PHUIPropertyListView();
|
||||
|
||||
$properties->addProperty(
|
||||
pht('Image'),
|
||||
@@ -836,7 +836,7 @@ final class DiffusionBrowseFileController extends DiffusionBrowseController {
|
||||
}
|
||||
|
||||
private function buildBinaryCorpus($file_uri, $data) {
|
||||
$properties = new PhabricatorPropertyListView();
|
||||
$properties = new PHUIPropertyListView();
|
||||
|
||||
$size = strlen($data);
|
||||
$properties->addTextContent(
|
||||
|
||||
@@ -5,10 +5,12 @@ final class DiffusionBrowseSearchController extends DiffusionBrowseController {
|
||||
public function processRequest() {
|
||||
$drequest = $this->diffusionRequest;
|
||||
|
||||
$actions = $this->buildActionView($drequest);
|
||||
$properties = $this->buildPropertyView($drequest, $actions);
|
||||
|
||||
$object_box = id(new PHUIObjectBoxView())
|
||||
->setHeader($this->buildHeaderView($drequest))
|
||||
->setActionList($this->buildActionView($drequest))
|
||||
->setPropertyList($this->buildPropertyView($drequest));
|
||||
->addPropertyList($properties);
|
||||
|
||||
$content = array();
|
||||
|
||||
|
||||
@@ -81,12 +81,11 @@ final class DiffusionChangeController extends DiffusionController {
|
||||
->setUser($viewer)
|
||||
->setPolicyObject($drequest->getRepository());
|
||||
$actions = $this->buildActionView($drequest);
|
||||
$properties = $this->buildPropertyView($drequest);
|
||||
$properties = $this->buildPropertyView($drequest, $actions);
|
||||
|
||||
$object_box = id(new PHUIObjectBoxView())
|
||||
->setHeader($header)
|
||||
->setActionList($actions)
|
||||
->setPropertyList($properties);
|
||||
->addPropertyList($properties);
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
array(
|
||||
@@ -130,11 +129,15 @@ final class DiffusionChangeController extends DiffusionController {
|
||||
return $view;
|
||||
}
|
||||
|
||||
protected function buildPropertyView(DiffusionRequest $drequest) {
|
||||
protected function buildPropertyView(
|
||||
DiffusionRequest $drequest,
|
||||
PhabricatorActionListView $actions) {
|
||||
|
||||
$viewer = $this->getRequest()->getUser();
|
||||
|
||||
$view = id(new PhabricatorPropertyListView())
|
||||
->setUser($viewer);
|
||||
$view = id(new PHUIPropertyListView())
|
||||
->setUser($viewer)
|
||||
->setActionList($actions);
|
||||
|
||||
$stable_commit = $drequest->getStableCommitName();
|
||||
$callsign = $drequest->getRepository()->getCallsign();
|
||||
|
||||
@@ -113,7 +113,7 @@ final class DiffusionCommitController extends DiffusionController {
|
||||
$commit_data,
|
||||
$parents,
|
||||
$audit_requests);
|
||||
$property_list = id(new PhabricatorPropertyListView())
|
||||
$property_list = id(new PHUIPropertyListView())
|
||||
->setHasKeyboardShortcuts(true)
|
||||
->setUser($user)
|
||||
->setObject($commit);
|
||||
@@ -137,11 +137,11 @@ final class DiffusionCommitController extends DiffusionController {
|
||||
),
|
||||
$message));
|
||||
$content[] = $top_anchor;
|
||||
$property_list->setActionList($headsup_actions);
|
||||
|
||||
$object_box = id(new PHUIObjectBoxView())
|
||||
->setHeader($headsup_view)
|
||||
->setActionList($headsup_actions)
|
||||
->setPropertyList($property_list);
|
||||
->addPropertyList($property_list);
|
||||
|
||||
$content[] = $object_box;
|
||||
}
|
||||
|
||||
@@ -70,12 +70,11 @@ final class DiffusionHistoryController extends DiffusionController {
|
||||
->setHeader($this->renderPathLinks($drequest, $mode = 'history'));
|
||||
|
||||
$actions = $this->buildActionView($drequest);
|
||||
$properties = $this->buildPropertyView($drequest);
|
||||
$properties = $this->buildPropertyView($drequest, $actions);
|
||||
|
||||
$object_box = id(new PHUIObjectBoxView())
|
||||
->setHeader($header)
|
||||
->setActionList($actions)
|
||||
->setPropertyList($properties);
|
||||
->addPropertyList($properties);
|
||||
|
||||
$crumbs = $this->buildCrumbs(
|
||||
array(
|
||||
@@ -143,11 +142,15 @@ final class DiffusionHistoryController extends DiffusionController {
|
||||
return $view;
|
||||
}
|
||||
|
||||
protected function buildPropertyView(DiffusionRequest $drequest) {
|
||||
protected function buildPropertyView(
|
||||
DiffusionRequest $drequest,
|
||||
PhabricatorActionListView $actions) {
|
||||
|
||||
$viewer = $this->getRequest()->getUser();
|
||||
|
||||
$view = id(new PhabricatorPropertyListView())
|
||||
->setUser($viewer);
|
||||
$view = id(new PHUIPropertyListView())
|
||||
->setUser($viewer)
|
||||
->setActionList($actions);
|
||||
|
||||
$stable_commit = $drequest->getStableCommitName();
|
||||
$callsign = $drequest->getRepository()->getCallsign();
|
||||
|
||||
@@ -160,12 +160,12 @@ final class DiffusionLintController extends DiffusionController {
|
||||
$properties = $this->buildPropertyView(
|
||||
$drequest,
|
||||
$branch,
|
||||
$total);
|
||||
$total,
|
||||
$actions);
|
||||
|
||||
$object_box = id(new PHUIObjectBoxView())
|
||||
->setHeader($header)
|
||||
->setActionList($actions)
|
||||
->setPropertyList($properties);
|
||||
->addPropertyList($properties);
|
||||
} else {
|
||||
$object_box = null;
|
||||
}
|
||||
@@ -316,12 +316,14 @@ final class DiffusionLintController extends DiffusionController {
|
||||
protected function buildPropertyView(
|
||||
DiffusionRequest $drequest,
|
||||
PhabricatorRepositoryBranch $branch,
|
||||
$total) {
|
||||
$total,
|
||||
PhabricatorActionListView $actions) {
|
||||
|
||||
$viewer = $this->getRequest()->getUser();
|
||||
|
||||
$view = id(new PhabricatorPropertyListView())
|
||||
->setUser($viewer);
|
||||
$view = id(new PHUIPropertyListView())
|
||||
->setUser($viewer)
|
||||
->setActions($actions);
|
||||
|
||||
$callsign = $drequest->getRepository()->getCallsign();
|
||||
$lint_commit = $branch->getLintCommit();
|
||||
|
||||
@@ -147,7 +147,7 @@ final class DiffusionRepositoryController extends DiffusionController {
|
||||
|
||||
$actions = $this->buildActionList($repository);
|
||||
|
||||
$view = id(new PhabricatorPropertyListView())
|
||||
$view = id(new PHUIPropertyListView())
|
||||
->setUser($user);
|
||||
$view->addProperty(pht('Callsign'), $repository->getCallsign());
|
||||
|
||||
@@ -174,10 +174,11 @@ final class DiffusionRepositoryController extends DiffusionController {
|
||||
$view->addTextContent($description);
|
||||
}
|
||||
|
||||
$view->setActionList($actions);
|
||||
|
||||
return id(new PHUIObjectBoxView())
|
||||
->setHeader($header)
|
||||
->setActionList($actions)
|
||||
->setPropertyList($view);
|
||||
->addPropertyList($view);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -65,18 +65,16 @@ final class DiffusionRepositoryEditBasicController extends DiffusionController {
|
||||
}
|
||||
}
|
||||
|
||||
$content = array();
|
||||
|
||||
$crumbs = $this->buildCrumbs();
|
||||
$crumbs->addCrumb(
|
||||
id(new PhabricatorCrumbView())
|
||||
->setName(pht('Edit Basics')));
|
||||
$content[] = $crumbs;
|
||||
|
||||
$title = pht('Edit %s', $repository->getName());
|
||||
|
||||
$error_view = null;
|
||||
if ($errors) {
|
||||
$content[] = id(new AphrontErrorView())
|
||||
$error_view = id(new AphrontErrorView())
|
||||
->setTitle(pht('Form Errors'))
|
||||
->setErrors($errors);
|
||||
}
|
||||
@@ -101,10 +99,15 @@ final class DiffusionRepositoryEditBasicController extends DiffusionController {
|
||||
->appendChild(id(new PHUIFormDividerControl()))
|
||||
->appendRemarkupInstructions($this->getReadmeInstructions());
|
||||
|
||||
$content[] = $form;
|
||||
$object_box = id(new PHUIObjectBoxView())
|
||||
->setHeaderText($title)
|
||||
->setForm($form)
|
||||
->setFormError($error_view);
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
$content,
|
||||
array(
|
||||
$crumbs,
|
||||
$object_box),
|
||||
array(
|
||||
'title' => $title,
|
||||
'device' => true,
|
||||
|
||||
@@ -8,13 +8,10 @@ final class DiffusionRepositoryEditController extends DiffusionController {
|
||||
$drequest = $this->diffusionRequest;
|
||||
$repository = $drequest->getRepository();
|
||||
|
||||
$content = array();
|
||||
|
||||
$crumbs = $this->buildCrumbs();
|
||||
$crumbs->addCrumb(
|
||||
id(new PhabricatorCrumbView())
|
||||
->setName(pht('Edit')));
|
||||
$content[] = $crumbs;
|
||||
|
||||
$title = pht('Edit %s', $repository->getName());
|
||||
|
||||
@@ -28,25 +25,17 @@ final class DiffusionRepositoryEditController extends DiffusionController {
|
||||
->setBackgroundColor(PhabricatorTagView::COLOR_BLACK));
|
||||
}
|
||||
|
||||
$content[] = $header;
|
||||
$basic_actions = $this->buildBasicActions($repository);
|
||||
$basic_properties =
|
||||
$this->buildBasicProperties($repository, $basic_actions);
|
||||
|
||||
$content[] = $this->buildBasicActions($repository);
|
||||
$content[] = $this->buildBasicProperties($repository);
|
||||
$policy_actions = $this->buildPolicyActions($repository);
|
||||
$policy_properties =
|
||||
$this->buildPolicyProperties($repository, $policy_actions);
|
||||
|
||||
$content[] = id(new PHUIHeaderView())
|
||||
->setHeader(pht('Policies'));
|
||||
|
||||
$content[] = $this->buildPolicyActions($repository);
|
||||
$content[] = $this->buildPolicyProperties($repository);
|
||||
|
||||
$content[] = id(new PHUIHeaderView())
|
||||
->setHeader(pht('Text Encoding'));
|
||||
|
||||
$content[] = $this->buildEncodingActions($repository);
|
||||
$content[] = $this->buildEncodingProperties($repository);
|
||||
|
||||
$content[] = id(new PHUIHeaderView())
|
||||
->setHeader(pht('Edit History'));
|
||||
$encoding_actions = $this->buildEncodingActions($repository);
|
||||
$encoding_properties =
|
||||
$this->buildEncodingProperties($repository, $encoding_actions);
|
||||
|
||||
$xactions = id(new PhabricatorRepositoryTransactionQuery())
|
||||
->setViewer($user)
|
||||
@@ -70,11 +59,18 @@ final class DiffusionRepositoryEditController extends DiffusionController {
|
||||
->setTransactions($xactions)
|
||||
->setMarkupEngine($engine);
|
||||
|
||||
$content[] = $xaction_view;
|
||||
|
||||
$obj_box = id(new PHUIObjectBoxView())
|
||||
->setHeader($header)
|
||||
->addPropertyList($basic_properties)
|
||||
->addPropertyList($policy_properties)
|
||||
->addPropertyList($encoding_properties);
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
$content,
|
||||
array(
|
||||
$crumbs,
|
||||
$obj_box,
|
||||
$xaction_view,
|
||||
),
|
||||
array(
|
||||
'title' => $title,
|
||||
'device' => true,
|
||||
@@ -122,11 +118,15 @@ final class DiffusionRepositoryEditController extends DiffusionController {
|
||||
return $view;
|
||||
}
|
||||
|
||||
private function buildBasicProperties(PhabricatorRepository $repository) {
|
||||
private function buildBasicProperties(
|
||||
PhabricatorRepository $repository,
|
||||
PhabricatorActionListView $actions) {
|
||||
|
||||
$user = $this->getRequest()->getUser();
|
||||
|
||||
$view = id(new PhabricatorPropertyListView())
|
||||
->setUser($user);
|
||||
$view = id(new PHUIPropertyListView())
|
||||
->setUser($user)
|
||||
->setActionList($actions);
|
||||
|
||||
$view->addProperty(pht('Name'), $repository->getName());
|
||||
$view->addProperty(pht('ID'), $repository->getID());
|
||||
@@ -177,11 +177,16 @@ final class DiffusionRepositoryEditController extends DiffusionController {
|
||||
return $view;
|
||||
}
|
||||
|
||||
private function buildEncodingProperties(PhabricatorRepository $repository) {
|
||||
private function buildEncodingProperties(
|
||||
PhabricatorRepository $repository,
|
||||
PhabricatorActionListView $actions) {
|
||||
|
||||
$user = $this->getRequest()->getUser();
|
||||
|
||||
$view = id(new PhabricatorPropertyListView())
|
||||
->setUser($user);
|
||||
$view = id(new PHUIPropertyListView())
|
||||
->setUser($user)
|
||||
->setActionList($actions)
|
||||
->addSectionHeader(pht('Text Encoding'));
|
||||
|
||||
$encoding = $repository->getDetail('encoding');
|
||||
if (!$encoding) {
|
||||
@@ -217,11 +222,16 @@ final class DiffusionRepositoryEditController extends DiffusionController {
|
||||
return $view;
|
||||
}
|
||||
|
||||
private function buildPolicyProperties(PhabricatorRepository $repository) {
|
||||
private function buildPolicyProperties(
|
||||
PhabricatorRepository $repository,
|
||||
PhabricatorActionListView $actions) {
|
||||
|
||||
$viewer = $this->getRequest()->getUser();
|
||||
|
||||
$view = id(new PhabricatorPropertyListView())
|
||||
->setUser($viewer);
|
||||
$view = id(new PHUIPropertyListView())
|
||||
->setUser($viewer)
|
||||
->setActionList($actions)
|
||||
->addSectionHeader(pht('Policies'));
|
||||
|
||||
$descriptions = PhabricatorPolicyQuery::renderPolicyDescriptions(
|
||||
$viewer,
|
||||
|
||||
@@ -56,18 +56,16 @@ final class DiffusionRepositoryEditEncodingController
|
||||
}
|
||||
}
|
||||
|
||||
$content = array();
|
||||
|
||||
$crumbs = $this->buildCrumbs();
|
||||
$crumbs->addCrumb(
|
||||
id(new PhabricatorCrumbView())
|
||||
->setName(pht('Edit Encoding')));
|
||||
$content[] = $crumbs;
|
||||
|
||||
$title = pht('Edit %s', $repository->getName());
|
||||
|
||||
$error_view = null;
|
||||
if ($errors) {
|
||||
$content[] = id(new AphrontErrorView())
|
||||
$error_view = id(new AphrontErrorView())
|
||||
->setTitle(pht('Form Errors'))
|
||||
->setErrors($errors);
|
||||
}
|
||||
@@ -86,10 +84,16 @@ final class DiffusionRepositoryEditEncodingController
|
||||
->setValue(pht('Save Encoding'))
|
||||
->addCancelButton($edit_uri));
|
||||
|
||||
$content[] = $form;
|
||||
$object_box = id(new PHUIObjectBoxView())
|
||||
->setHeaderText($title)
|
||||
->setForm($form)
|
||||
->setFormError($error_view);
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
$content,
|
||||
array(
|
||||
$crumbs,
|
||||
$object_box,
|
||||
),
|
||||
array(
|
||||
'title' => $title,
|
||||
'device' => true,
|
||||
|
||||
Reference in New Issue
Block a user