Changeset View
Changeset View
Standalone View
Standalone View
src/applications/drydock/controller/DrydockLeaseViewController.php
Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | $view->addAction( | ||||
->setDisabled(!$can_release || !$can_edit)); | ->setDisabled(!$can_release || !$can_edit)); | ||||
return $view; | return $view; | ||||
} | } | ||||
private function buildPropertyListView( | private function buildPropertyListView( | ||||
DrydockLease $lease, | DrydockLease $lease, | ||||
PhabricatorActionListView $actions) { | PhabricatorActionListView $actions) { | ||||
$viewer = $this->getViewer(); | |||||
$view = new PHUIPropertyListView(); | $view = new PHUIPropertyListView(); | ||||
$view->setActionList($actions); | $view->setActionList($actions); | ||||
switch ($lease->getStatus()) { | switch ($lease->getStatus()) { | ||||
case DrydockLeaseStatus::STATUS_ACTIVE: | case DrydockLeaseStatus::STATUS_ACTIVE: | ||||
$status = pht('Active'); | $status = pht('Active'); | ||||
break; | break; | ||||
Show All 32 Lines | if ($resource !== null) { | ||||
pht('Resource'), | pht('Resource'), | ||||
$this->getViewer()->renderHandle($resource->getPHID())); | $this->getViewer()->renderHandle($resource->getPHID())); | ||||
} else { | } else { | ||||
$view->addProperty( | $view->addProperty( | ||||
pht('Resource'), | pht('Resource'), | ||||
pht('No Resource')); | pht('No Resource')); | ||||
} | } | ||||
$until = $lease->getUntil(); | |||||
if ($until) { | |||||
$until_display = phabricator_datetime($until, $viewer); | |||||
} else { | |||||
$until_display = phutil_tag('em', array(), pht('Never')); | |||||
} | |||||
$view->addProperty(pht('Expires'), $until_display); | |||||
$attributes = $lease->getAttributes(); | $attributes = $lease->getAttributes(); | ||||
if ($attributes) { | if ($attributes) { | ||||
$view->addSectionHeader( | $view->addSectionHeader( | ||||
pht('Attributes'), 'fa-list-ul'); | pht('Attributes'), 'fa-list-ul'); | ||||
foreach ($attributes as $key => $value) { | foreach ($attributes as $key => $value) { | ||||
$view->addProperty($key, $value); | $view->addProperty($key, $value); | ||||
} | } | ||||
} | } | ||||
return $view; | return $view; | ||||
} | } | ||||
} | } |