From da9a3621696b963fba229b48dff646249f2c97b9 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 21 Oct 2013 11:34:45 -0700 Subject: [PATCH] Shuffle project information around on detail page Summary: Ref T4007. Fixes T4009. Ref T4008. - Move blurb to a text section. - Make it render as remarkup. - Put policy information and status information in header. Test Plan: See screenshot. Reviewers: chad, btrahan Reviewed By: chad CC: aran Maniphest Tasks: T4009, T4007, T4008 Differential Revision: https://secure.phabricator.com/D7373 --- .../PhabricatorProjectProfileController.php | 20 +++++++++++++++++-- ...habricatorProjectProfileEditController.php | 4 ++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/applications/project/controller/PhabricatorProjectProfileController.php b/src/applications/project/controller/PhabricatorProjectProfileController.php index ef2c6ad4fe..d10998444c 100644 --- a/src/applications/project/controller/PhabricatorProjectProfileController.php +++ b/src/applications/project/controller/PhabricatorProjectProfileController.php @@ -59,11 +59,19 @@ final class PhabricatorProjectProfileController $header = id(new PHUIHeaderView()) ->setHeader($project->getName()) - ->setSubheader(phutil_utf8_shorten($profile->getBlurb(), 1024)) + ->setUser($user) + ->setPolicyObject($project) ->setImage($picture); + if ($project->getStatus() == PhabricatorProjectStatus::STATUS_ACTIVE) { + $header->setStatus('oh-ok', '', pht('Active')); + } else { + $header->setStatus('policy-noone', '', pht('Archived')); + } + + $actions = $this->buildActionListView($project); - $properties = $this->buildPropertyListView($project, $actions); + $properties = $this->buildPropertyListView($project, $profile, $actions); $crumbs = $this->buildApplicationCrumbs(); $crumbs->addCrumb( @@ -253,6 +261,7 @@ final class PhabricatorProjectProfileController private function buildPropertyListView( PhabricatorProject $project, + PhabricatorProjectProfile $profile, PhabricatorActionListView $actions) { $request = $this->getRequest(); $viewer = $request->getUser(); @@ -266,6 +275,13 @@ final class PhabricatorProjectProfileController pht('Created'), phabricator_datetime($project->getDateCreated(), $viewer)); + $view->addSectionHeader(pht('Description')); + $view->addTextContent( + PhabricatorMarkupEngine::renderOneObject( + id(new PhabricatorMarkupOneOff())->setContent($profile->getBlurb()), + 'default', + $viewer)); + return $view; } diff --git a/src/applications/project/controller/PhabricatorProjectProfileEditController.php b/src/applications/project/controller/PhabricatorProjectProfileEditController.php index ec5419a6de..3b57e1b907 100644 --- a/src/applications/project/controller/PhabricatorProjectProfileEditController.php +++ b/src/applications/project/controller/PhabricatorProjectProfileEditController.php @@ -127,8 +127,8 @@ final class PhabricatorProjectProfileEditController ->setOptions($options) ->setValue($project->getStatus())) ->appendChild( - id(new AphrontFormTextAreaControl()) - ->setLabel(pht('Blurb')) + id(new PhabricatorRemarkupControl()) + ->setLabel(pht('Description')) ->setName('blurb') ->setValue($profile->getBlurb())) ->appendChild(