1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +01:00

[drydock/core] Show blueprints / resources as links in Drydock view controllers

Summary: Ref T2015. This updates the blueprint / resource references in the Drydock view controllers to render as handles.

Test Plan: Viewed the controllers, saw links.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: devurandom, joshuaspence, Korvin, epriestley

Maniphest Tasks: T2015

Differential Revision: https://secure.phabricator.com/D10873
This commit is contained in:
epriestley 2015-09-23 10:52:17 -07:00
parent 789df89c84
commit 0a37145072
2 changed files with 20 additions and 4 deletions

View file

@ -130,9 +130,20 @@ final class DrydockLeaseViewController extends DrydockLeaseController {
pht('Resource Type'),
$lease->getResourceType());
$view->addProperty(
pht('Resource'),
$lease->getResourceID());
$resource = id(new DrydockResourceQuery())
->setViewer($this->getViewer())
->withIDs(array($lease->getResourceID()))
->executeOne();
if ($resource !== null) {
$view->addProperty(
pht('Resource'),
$this->getViewer()->renderHandle($resource->getPHID()));
} else {
$view->addProperty(
pht('Resource'),
pht('No Resource'));
}
$attributes = $lease->getAttributes();
if ($attributes) {

View file

@ -29,7 +29,12 @@ final class DrydockResourcePHIDType extends PhabricatorPHIDType {
$resource = $objects[$phid];
$id = $resource->getID();
$handle->setName($resource->getName());
$handle->setName(
pht(
'Resource %d: %s',
$id,
$resource->getName()));
$handle->setURI("/drydock/resource/{$id}/");
}
}