1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 03:50:54 +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;
}
public function handleRequest(AphrontRequest $request) {
$viewer = $request->getViewer();
$id = $request->getURIData('id');
@ -22,6 +21,7 @@ final class FundInitiativeViewController
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb($initiative->getMonogram());
$crumbs->setBorder(true);
$title = pht(
'%s %s',
@ -43,32 +43,32 @@ final class FundInitiativeViewController
->setHeader($initiative->getName())
->setUser($viewer)
->setPolicyObject($initiative)
->setStatus($status_icon, $status_color, $status_name);
->setStatus($status_icon, $status_color, $status_name)
->setHeaderIcon('fa-heart');
$properties = $this->buildPropertyListView($initiative);
$actions = $this->buildActionListView($initiative);
$properties->setActionList($actions);
$box = id(new PHUIObjectBoxView())
->setHeader($header)
->addPropertyList($properties);
$details = $this->buildPropertySectionView($initiative);
$timeline = $this->buildTransactionTimeline(
$initiative,
new FundInitiativeTransactionQuery());
$timeline
->setShouldTerminate(true);
$timeline->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(
$crumbs,
$box,
$timeline,
),
array(
'title' => $title,
'pageObjects' => array($initiative->getPHID()),
$view,
));
}
@ -79,6 +79,17 @@ final class FundInitiativeViewController
->setUser($viewer)
->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();
$merchant_phid = $initiative->getMerchantPHID();
@ -94,8 +105,6 @@ final class FundInitiativeViewController
pht('Total Funding'),
$initiative->getTotalAsCurrency()->formatForDisplay());
$view->invokeWillRenderEvent();
$description = $initiative->getDescription();
if (strlen($description)) {
$description = new PHUIRemarkupView($viewer, $description);