From ffb69c3c97afb1b2dc9ae1b033b99662cb7efc49 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 15 Jul 2011 14:24:50 -0700 Subject: [PATCH] Add a cancel button to Phriction's edit interface Summary: So you don't have to edit if you don't want to. Test Plan: Hit "cancel" on an edit of an existing page and an edit of a new page. Reviewed By: codeblock Reviewers: hsb, codeblock, jungejason, tuomaspelkonen, aran CC: aran, codeblock Differential Revision: 675 --- .../phriction/controller/edit/PhrictionEditController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/applications/phriction/controller/edit/PhrictionEditController.php b/src/applications/phriction/controller/edit/PhrictionEditController.php index e50ba57b17..4a502b862f 100644 --- a/src/applications/phriction/controller/edit/PhrictionEditController.php +++ b/src/applications/phriction/controller/edit/PhrictionEditController.php @@ -150,6 +150,8 @@ class PhrictionEditController ), 'Formatting Reference'); + $cancel_uri = PhrictionDocument::getSlugURI($document->getSlug()); + $form = id(new AphrontFormView()) ->setUser($user) ->setAction($request->getRequestURI()->getPath()) @@ -173,6 +175,7 @@ class PhrictionEditController ->setCaption($remarkup_reference)) ->appendChild( id(new AphrontFormSubmitControl()) + ->addCancelButton($cancel_uri) ->setValue($submit_button)); $panel = id(new AphrontPanelView())