From 40851e5b2529438f6871f399735b82dcf9a5da55 Mon Sep 17 00:00:00 2001 From: Paul Kassianik Date: Fri, 19 Jun 2015 08:32:50 -0700 Subject: [PATCH] Adds Remarkup Rendering to Calendar Events' Descriptions. Summary: Closes T8032 Test Plan: Verify that when editing a calendar event's description, there is a UI bar helping with adding markup to the description. Also verify that markup is displayed correctly on the event page once the event has been updated. Reviewers: lpriestley, #blessed_reviewers, epriestley Reviewed By: lpriestley, #blessed_reviewers, epriestley Subscribers: epriestley, Korvin Maniphest Tasks: T8032 Differential Revision: https://secure.phabricator.com/D13355 --- .../PhabricatorCalendarEventEditController.php | 5 +++-- .../PhabricatorCalendarEventViewController.php | 17 +++++++++++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/applications/calendar/controller/PhabricatorCalendarEventEditController.php b/src/applications/calendar/controller/PhabricatorCalendarEventEditController.php index 47736f38fe..d374dc4a05 100644 --- a/src/applications/calendar/controller/PhabricatorCalendarEventEditController.php +++ b/src/applications/calendar/controller/PhabricatorCalendarEventEditController.php @@ -437,10 +437,11 @@ final class PhabricatorCalendarEventEditController ->setValue($end_disabled); } - $description = id(new AphrontFormTextAreaControl()) + $description = id(new PhabricatorRemarkupControl()) ->setLabel(pht('Description')) ->setName('description') - ->setValue($description); + ->setValue($description) + ->setUser($viewer); $view_policies = id(new AphrontFormPolicyControl()) ->setUser($viewer) diff --git a/src/applications/calendar/controller/PhabricatorCalendarEventViewController.php b/src/applications/calendar/controller/PhabricatorCalendarEventViewController.php index b6eb901bb8..0aea0c5607 100644 --- a/src/applications/calendar/controller/PhabricatorCalendarEventViewController.php +++ b/src/applications/calendar/controller/PhabricatorCalendarEventViewController.php @@ -362,10 +362,19 @@ final class PhabricatorCalendarEventViewController pht('Icon'), $icon_display); - $properties->addSectionHeader( - pht('Description'), - PHUIPropertyListView::ICON_SUMMARY); - $properties->addTextContent($event->getDescription()); + if (strlen($event->getDescription())) { + + $description = PhabricatorMarkupEngine::renderOneObject( + id(new PhabricatorMarkupOneOff())->setContent($event->getDescription()), + 'default', + $viewer); + + $properties->addSectionHeader( + pht('Description'), + PHUIPropertyListView::ICON_SUMMARY); + + $properties->addTextContent($description); + } return $properties; }