@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator

Update misc bits of Ponder to TwoColumnView

Summary: Brings in the new headers, layout into Ponder History, editing.

Test Plan: Edit Question, Edit Answer, Question History, Answer History

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D15530

+63 -40
+17 -9
src/applications/ponder/controller/PonderAnswerEditController.php
··· 91 91 $crumbs = $this->buildApplicationCrumbs(); 92 92 $crumbs->addTextCrumb("Q{$qid}", $answer_uri); 93 93 $crumbs->addTextCrumb(pht('Edit Answer')); 94 + $crumbs->setBorder(true); 94 95 95 - $form_box = id(new PHUIObjectBoxView()) 96 - ->setHeaderText(pht('Edit Answer')) 96 + $header = id(new PHUIHeaderView()) 97 + ->setHeader(pht('Edit Answer')) 98 + ->setHeaderIcon('fa-pencil'); 99 + 100 + $box = id(new PHUIObjectBoxView()) 101 + ->setHeaderText(pht('Answer')) 97 102 ->setFormErrors($errors) 103 + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 98 104 ->setForm($form); 99 105 100 106 $preview = id(new PHUIRemarkupPreviewPanel()) ··· 102 108 ->setControlID($answer_content_id) 103 109 ->setPreviewURI($this->getApplicationURI('preview/')); 104 110 105 - return $this->buildApplicationPage( 106 - array( 107 - $crumbs, 108 - $form_box, 111 + $view = id(new PHUITwoColumnView()) 112 + ->setHeader($header) 113 + ->setFooter(array( 114 + $box, 109 115 $preview, 110 - ), 111 - array( 112 - 'title' => pht('Edit Answer'), 113 116 )); 117 + 118 + return $this->newPage() 119 + ->setTitle(pht('Edit Answer')) 120 + ->setCrumbs($crumbs) 121 + ->appendChild($view); 114 122 115 123 } 116 124 }
+13 -9
src/applications/ponder/controller/PonderAnswerHistoryController.php
··· 18 18 return new Aphront404Response(); 19 19 } 20 20 21 - 22 21 $timeline = $this->buildTransactionTimeline( 23 22 $answer, 24 23 new PonderAnswerTransactionQuery()); ··· 32 31 $crumbs->addTextCrumb("Q{$qid}", "/Q{$qid}"); 33 32 $crumbs->addTextCrumb("A{$aid}", "/Q{$qid}#{$aid}"); 34 33 $crumbs->addTextCrumb(pht('History')); 34 + $crumbs->setBorder(true); 35 35 36 - return $this->buildApplicationPage( 37 - array( 38 - $crumbs, 39 - $timeline, 40 - ), 41 - array( 42 - 'title' => pht('Answer History'), 43 - )); 36 + $header = id(new PHUIHeaderView()) 37 + ->setHeader(pht('Answer History')) 38 + ->setHeaderIcon('fa-history'); 39 + 40 + $view = id(new PHUITwoColumnView()) 41 + ->setHeader($header) 42 + ->setFooter($timeline); 43 + 44 + return $this->newPage() 45 + ->setTitle(pht('Answer History')) 46 + ->setCrumbs($crumbs) 47 + ->appendChild($view); 44 48 } 45 49 46 50 }
-5
src/applications/ponder/controller/PonderQuestionCommentController.php
··· 19 19 } 20 20 21 21 $is_preview = $request->isPreviewRequest(); 22 - // $draft = PhabricatorDraft::buildFromRequest($request); 23 22 24 23 $qid = $question->getID(); 25 24 $view_uri = "/Q{$qid}"; ··· 44 43 ->setCancelURI($view_uri) 45 44 ->setException($ex); 46 45 } 47 - 48 - // if ($draft) { 49 - // $draft->replaceOrDelete(); 50 - // } 51 46 52 47 if ($request->isAjax() && $is_preview) { 53 48 return id(new PhabricatorApplicationTransactionResponse())
+20 -9
src/applications/ponder/controller/PonderQuestionEditController.php
··· 183 183 $crumbs->addTextCrumb("Q{$id}", "/Q{$id}"); 184 184 $crumbs->addTextCrumb(pht('Edit')); 185 185 $title = pht('Edit Question'); 186 + $header = id(new PHUIHeaderView()) 187 + ->setHeader($title) 188 + ->setHeaderIcon('fa-pencil'); 186 189 } else { 187 190 $crumbs->addTextCrumb(pht('Ask Question')); 188 191 $title = pht('Ask New Question'); 192 + $header = id(new PHUIHeaderView()) 193 + ->setHeader($title) 194 + ->setHeaderIcon('fa-plus-square'); 189 195 } 196 + $crumbs->setBorder(true); 190 197 191 - $form_box = id(new PHUIObjectBoxView()) 192 - ->setHeaderText($title) 198 + $box = id(new PHUIObjectBoxView()) 199 + ->setHeaderText(pht('Question')) 193 200 ->setFormErrors($errors) 201 + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 194 202 ->setForm($form); 195 203 196 - return $this->buildApplicationPage( 197 - array( 198 - $crumbs, 199 - $form_box, 204 + $view = id(new PHUITwoColumnView()) 205 + ->setHeader($header) 206 + ->setFooter(array( 207 + $box, 200 208 $preview, 201 209 $answer_preview, 202 - ), 203 - array( 204 - 'title' => $title, 205 210 )); 211 + 212 + return $this->newPage() 213 + ->setTitle($title) 214 + ->setCrumbs($crumbs) 215 + ->appendChild($view); 216 + 206 217 } 207 218 208 219 }
+13 -8
src/applications/ponder/controller/PonderQuestionHistoryController.php
··· 29 29 $crumbs->setBorder(true); 30 30 $crumbs->addTextCrumb("Q{$qid}", "/Q{$qid}"); 31 31 $crumbs->addTextCrumb(pht('History')); 32 + $crumbs->setBorder(true); 32 33 33 - return $this->buildApplicationPage( 34 - array( 35 - $crumbs, 36 - $timeline, 37 - ), 38 - array( 39 - 'title' => pht('Question History'), 40 - )); 34 + $header = id(new PHUIHeaderView()) 35 + ->setHeader($question->getTitle()) 36 + ->setHeaderIcon('fa-history'); 37 + 38 + $view = id(new PHUITwoColumnView()) 39 + ->setHeader($header) 40 + ->setFooter($timeline); 41 + 42 + return $this->newPage() 43 + ->setTitle(pht('Question History')) 44 + ->setCrumbs($crumbs) 45 + ->appendChild($view); 41 46 } 42 47 43 48 }