@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
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Reduce code duplication on comment editing UI

Summary: Ref T2009. This has two more copies of the scaffolding.

Test Plan: Created, edited, deleted, replied to inline comments.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T2009

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

+18 -41
+17 -8
src/infrastructure/diff/PhabricatorInlineCommentController.php
··· 130 130 $this->renderTextArea( 131 131 nonempty($text, $inline->getContent()))); 132 132 133 + $view = $this->buildScaffoldForView($edit_dialog); 134 + 133 135 return id(new AphrontAjaxResponse()) 134 - ->setContent($edit_dialog->render()); 136 + ->setContent($view->render()); 135 137 case 'create': 136 138 $text = $this->getCommentText(); 137 139 ··· 184 186 $text_area = $this->renderTextArea($this->getCommentText()); 185 187 $edit_dialog->appendChild($text_area); 186 188 189 + $view = $this->buildScaffoldForView($edit_dialog); 190 + 187 191 return id(new AphrontAjaxResponse()) 188 - ->setContent($edit_dialog->render()); 192 + ->setContent($view->render()); 189 193 } 190 194 } 191 195 ··· 276 280 ->setHandles($handles) 277 281 ->setEditable(true); 278 282 279 - $renderer = DifferentialChangesetHTMLRenderer::getHTMLRendererByKey( 280 - $this->getRenderer()); 281 - 282 - $view = $renderer->getRowScaffoldForInline($view); 283 - $view = id(new PHUIDiffInlineCommentTableScaffold()) 284 - ->addRowScaffold($view); 283 + $view = $this->buildScaffoldForView($view); 285 284 286 285 return id(new AphrontAjaxResponse()) 287 286 ->setContent( ··· 298 297 ->setName('text') 299 298 ->setValue($text) 300 299 ->setDisableFullScreen(true); 300 + } 301 + 302 + private function buildScaffoldForView(PHUIDiffInlineCommentView $view) { 303 + $renderer = DifferentialChangesetHTMLRenderer::getHTMLRendererByKey( 304 + $this->getRenderer()); 305 + 306 + $view = $renderer->getRowScaffoldForInline($view); 307 + 308 + return id(new PHUIDiffInlineCommentTableScaffold()) 309 + ->addRowScaffold($view); 301 310 } 302 311 303 312 }
+1 -26
src/infrastructure/diff/view/PHUIDiffInlineCommentEditView.php
··· 104 104 $this->renderBody(), 105 105 )); 106 106 107 - if ($this->renderer == '1up') { 108 - $cells = array( 109 - phutil_tag('th', array()), 110 - phutil_tag('th', array()), 111 - phutil_tag( 112 - 'td', 113 - array('colspan' => 3, 'class' => 'right3'), 114 - $content), 115 - ); 116 - } else { 117 - $cells = array( 118 - phutil_tag('th', array()), 119 - phutil_tag( 120 - 'td', 121 - array('class' => 'left'), 122 - $this->onRight ? null : $content), 123 - phutil_tag('th', array()), 124 - phutil_tag( 125 - 'td', 126 - array('colspan' => 3, 'class' => 'right3'), 127 - $this->onRight ? $content : null), 128 - ); 129 - } 130 - 131 - $row = phutil_tag('tr', array('class' => 'inline-comment-splint'), $cells); 132 - return phutil_tag('table', array(), $row); 107 + return $content; 133 108 } 134 109 135 110 private function renderInputs() {
-7
webroot/rsrc/css/application/differential/changeset-view.css
··· 423 423 text-decoration: none; 424 424 } 425 425 426 - /* Create a wide band of color behind the inline edit interface so it is easy 427 - to find by skimming the page while scrolling. 428 - */ 429 - tr.inline-comment-splint { 430 - background: #f9f1d5; 431 - } 432 - 433 426 tr.differential-inline-hidden { 434 427 display: none; 435 428 }