1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-20 20:40:56 +01:00

Update Fund for PHUITwoColumnView

Summary: Updates the Fund application to use a two column layout

Test Plan: Make an initiative.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D15383
This commit is contained in:
Chad Little 2016-03-02 11:18:35 -08:00
parent b9a13e56e4
commit 86d6191633

View file

@ -7,7 +7,6 @@ final class FundInitiativeViewController
return true; return true;
} }
public function handleRequest(AphrontRequest $request) { public function handleRequest(AphrontRequest $request) {
$viewer = $request->getViewer(); $viewer = $request->getViewer();
$id = $request->getURIData('id'); $id = $request->getURIData('id');
@ -22,6 +21,7 @@ final class FundInitiativeViewController
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb($initiative->getMonogram()); $crumbs->addTextCrumb($initiative->getMonogram());
$crumbs->setBorder(true);
$title = pht( $title = pht(
'%s %s', '%s %s',
@ -43,32 +43,32 @@ final class FundInitiativeViewController
->setHeader($initiative->getName()) ->setHeader($initiative->getName())
->setUser($viewer) ->setUser($viewer)
->setPolicyObject($initiative) ->setPolicyObject($initiative)
->setStatus($status_icon, $status_color, $status_name); ->setStatus($status_icon, $status_color, $status_name)
->setHeaderIcon('fa-heart');
$properties = $this->buildPropertyListView($initiative); $properties = $this->buildPropertyListView($initiative);
$actions = $this->buildActionListView($initiative); $actions = $this->buildActionListView($initiative);
$properties->setActionList($actions); $details = $this->buildPropertySectionView($initiative);
$box = id(new PHUIObjectBoxView())
->setHeader($header)
->addPropertyList($properties);
$timeline = $this->buildTransactionTimeline( $timeline = $this->buildTransactionTimeline(
$initiative, $initiative,
new FundInitiativeTransactionQuery()); new FundInitiativeTransactionQuery());
$timeline $timeline->setShouldTerminate(true);
->setShouldTerminate(true);
return $this->buildApplicationPage( $view = id(new PHUITwoColumnView())
->setHeader($header)
->setMainColumn($timeline)
->setPropertyList($properties)
->addPropertySection(pht('DETAILS'), $details)
->setActionList($actions);
return $this->newPage()
->setTitle($title)
->setCrumbs($crumbs)
->setPageObjectPHIDs(array($initiative->getPHID()))
->appendChild(
array( array(
$crumbs, $view,
$box,
$timeline,
),
array(
'title' => $title,
'pageObjects' => array($initiative->getPHID()),
)); ));
} }
@ -79,6 +79,17 @@ final class FundInitiativeViewController
->setUser($viewer) ->setUser($viewer)
->setObject($initiative); ->setObject($initiative);
$view->invokeWillRenderEvent();
return $view;
}
private function buildPropertySectionView(FundInitiative $initiative) {
$viewer = $this->getRequest()->getUser();
$view = id(new PHUIPropertyListView())
->setUser($viewer);
$owner_phid = $initiative->getOwnerPHID(); $owner_phid = $initiative->getOwnerPHID();
$merchant_phid = $initiative->getMerchantPHID(); $merchant_phid = $initiative->getMerchantPHID();
@ -94,8 +105,6 @@ final class FundInitiativeViewController
pht('Total Funding'), pht('Total Funding'),
$initiative->getTotalAsCurrency()->formatForDisplay()); $initiative->getTotalAsCurrency()->formatForDisplay());
$view->invokeWillRenderEvent();
$description = $initiative->getDescription(); $description = $initiative->getDescription();
if (strlen($description)) { if (strlen($description)) {
$description = new PHUIRemarkupView($viewer, $description); $description = new PHUIRemarkupView($viewer, $description);