Page MenuHomePhabricator

Adds Remarkup Rendering to Calendar Events' Descriptions.
ClosedPublic

Authored by SalmonKiller on Jun 19 2015, 5:12 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 14, 7:19 AM
Unknown Object (File)
Sat, Apr 13, 11:44 PM
Unknown Object (File)
Sat, Apr 13, 7:56 PM
Unknown Object (File)
Sat, Apr 13, 6:07 PM
Unknown Object (File)
Sat, Apr 13, 6:07 PM
Unknown Object (File)
Sat, Apr 13, 4:50 PM
Unknown Object (File)
Sat, Apr 13, 4:23 PM
Unknown Object (File)
Sat, Apr 13, 4:23 PM
Subscribers

Details

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.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

SalmonKiller retitled this revision from to Adds Remarkup Rendering to Calendar Events' Descriptions..
SalmonKiller updated this object.
SalmonKiller edited the test plan for this revision. (Show Details)
lpriestley edited edge metadata.
lpriestley added inline comments.
src/applications/calendar/controller/PhabricatorCalendarEventViewController.php
369

There should be an icon added here to represent the description section. See the Spaces application for an example.

This revision now requires changes to proceed.Jun 19 2015, 5:19 AM
SalmonKiller edited edge metadata.

Added Description Icon

lpriestley edited edge metadata.
epriestley edited edge metadata.

One small thing we should fix while we're in here:

Events aren't required to have a description. If they don't have one we'll render an empty "description" header with no description. This is the existing behavior, but is confusing/inconsistent/undesirable.

empty.png (1×1 px, 152 KB)

It would be better not to render this section at all if the event doesn't have a description. You can do this with:

$description = $event->getDescription();
if (strlen($description)) {
  // Render the description, then addTextContent(...)
}

So, events with a description should work just like they do with this patch, but events with no description should just not render the section at all.

This revision now requires changes to proceed.Jun 19 2015, 12:25 PM
SalmonKiller edited edge metadata.

Removed the description header if the description is empty.

epriestley edited edge metadata.

Great -- one minor tweak and we're good to go.

src/applications/calendar/controller/PhabricatorCalendarEventViewController.php
365–378

Oh, just do this inside the if() block too. Rendering remarkup is moderately expensive and we can skip it if we know there's no description.

This revision now requires changes to proceed.Jun 19 2015, 3:29 PM
SalmonKiller edited edge metadata.

Moved initializer for the description inside the if statement.

epriestley edited edge metadata.

Perfect, thanks!

This revision is now accepted and ready to land.Jun 19 2015, 3:32 PM
This revision was automatically updated to reflect the committed changes.