Allow repositories to be associated with projects

Summary: Ref T4264. Ref T2628. Ref T3102. Allows you to associate repositories with projects. In the future, you'll be able to write Herald object rules against projects, use Herald fields like "Repository's projects", and search by project.

Test Plan: See screenshots.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T3102, T4264, T2628

Differential Revision: https://secure.phabricator.com/D7881
This commit is contained in:
epriestley
2014-01-03 12:24:09 -08:00
parent f981d50f5d
commit 637e3f38f3
9 changed files with 110 additions and 2 deletions

View File

@@ -165,6 +165,16 @@ final class DiffusionRepositoryController extends DiffusionController {
->setUser($user);
$view->addProperty(pht('Callsign'), $repository->getCallsign());
$project_phids = PhabricatorEdgeQuery::loadDestinationPHIDs(
$repository->getPHID(),
PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT);
if ($project_phids) {
$this->loadHandles($project_phids);
$view->addProperty(
pht('Projects'),
$this->renderHandlesForPHIDs($project_phids));
}
if ($repository->isHosted()) {
$serve_off = PhabricatorRepository::SERVE_OFF;
$callsign = $repository->getCallsign();