@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.

Clean up AphrontError boxes, Diffusion Headers

Summary: Two basic changes here, first we fixed up the Diffusion headers to roll out more PHUIObjectBoxes. Second we added some specific styles for when Errors are inside an ObjectBox at the first position.

Test Plan: Tested a number of different layouts for browsing respositories as well as wherever I could find cases with PHUIObjectBox Form Errors (see images attached). Still some minor tightening due after this diff, but didnt want to overload it.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: Korvin, epriestley, aran

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

+79 -43
+5 -5
resources/celerity/map.php
··· 7 7 return array( 8 8 'names' => 9 9 array( 10 - 'core.pkg.css' => '5ebae357', 10 + 'core.pkg.css' => '3c41daee', 11 11 'core.pkg.js' => 'c907bd96', 12 12 'darkconsole.pkg.js' => 'ca8671ce', 13 13 'differential.pkg.css' => '827749c1', ··· 23 23 'rsrc/css/aphront/context-bar.css' => '1c3b0529', 24 24 'rsrc/css/aphront/dark-console.css' => '6378ef3d', 25 25 'rsrc/css/aphront/dialog-view.css' => 'dd9db96c', 26 - 'rsrc/css/aphront/error-view.css' => '3281a87d', 26 + 'rsrc/css/aphront/error-view.css' => '472968e0', 27 27 'rsrc/css/aphront/lightbox-attachment.css' => '686f8885', 28 28 'rsrc/css/aphront/list-filter-view.css' => '9577c6da', 29 29 'rsrc/css/aphront/multi-column.css' => '05bbd016', ··· 136 136 'rsrc/css/phui/phui-icon.css' => '29e83226', 137 137 'rsrc/css/phui/phui-info-panel.css' => '27ea50a1', 138 138 'rsrc/css/phui/phui-list.css' => '2edb76cf', 139 - 'rsrc/css/phui/phui-object-box.css' => '90077bf8', 139 + 'rsrc/css/phui/phui-object-box.css' => '4f916b80', 140 140 'rsrc/css/phui/phui-object-item-list-view.css' => 'd65c06e7', 141 141 'rsrc/css/phui/phui-pinboard-view.css' => '53c5fca0', 142 142 'rsrc/css/phui/phui-property-list-view.css' => '354465ae', ··· 475 475 'aphront-contextbar-view-css' => '1c3b0529', 476 476 'aphront-dark-console-css' => '6378ef3d', 477 477 'aphront-dialog-view-css' => 'dd9db96c', 478 - 'aphront-error-view-css' => '3281a87d', 478 + 'aphront-error-view-css' => '472968e0', 479 479 'aphront-list-filter-view-css' => '9577c6da', 480 480 'aphront-multi-column-view-css' => '05bbd016', 481 481 'aphront-notes' => '6acadd3f', ··· 740 740 'phui-icon-view-css' => '29e83226', 741 741 'phui-info-panel-css' => '27ea50a1', 742 742 'phui-list-view-css' => '2edb76cf', 743 - 'phui-object-box-css' => '90077bf8', 743 + 'phui-object-box-css' => '4f916b80', 744 744 'phui-object-item-list-view-css' => 'd65c06e7', 745 745 'phui-pinboard-view-css' => '53c5fca0', 746 746 'phui-property-list-view-css' => '354465ae',
+7 -6
src/applications/differential/controller/DifferentialDiffCreateController.php
··· 84 84 85 85 $form_box = id(new PHUIObjectBoxView()) 86 86 ->setHeaderText(pht('Create New Diff')) 87 - ->setFormError($errors) 88 87 ->setForm($form); 89 88 89 + if ($errors) { 90 + $error_view = id(new AphrontErrorView()) 91 + ->setSeverity(AphrontErrorView::SEVERITY_ERROR) 92 + ->appendChild($errors); 93 + $form_box->setFormError($error_view); 94 + } 95 + 90 96 $crumbs = $this->buildApplicationCrumbs(); 91 97 $crumbs->addTextCrumb(pht('Create Diff')); 92 - 93 - if ($errors) { 94 - $errors = id(new AphrontErrorView()) 95 - ->setErrors($errors); 96 - } 97 98 98 99 return $this->buildApplicationPage( 99 100 array(
+16 -12
src/applications/diffusion/controller/DiffusionCommitController.php
··· 247 247 // changes inline even if there are more than the soft limit. 248 248 $show_all_details = $request->getBool('show_all'); 249 249 250 - $change_panel = new AphrontPanelView(); 251 - $change_panel->setHeader("Changes (".number_format($count).")"); 250 + $change_panel = new PHUIObjectBoxView(); 251 + $header = new PHUIHeaderView(); 252 + $header->setHeader("Changes (".number_format($count).")"); 252 253 $change_panel->setID('toc'); 253 254 if ($count > self::CHANGES_LIMIT && !$show_all_details) { 254 - $show_all_button = phutil_tag( 255 - 'a', 256 - array( 257 - 'class' => 'button green', 258 - 'href' => '?show_all=true', 259 - ), 260 - pht('Show All Changes')); 255 + 256 + $icon = id(new PHUIIconView()) 257 + ->setSpriteSheet(PHUIIconView::SPRITE_ICONS) 258 + ->setSpriteIcon('transcript'); 259 + 260 + $button = id(new PHUIButtonView()) 261 + ->setText(pht('Show All Changes')) 262 + ->setHref('?show_all=true') 263 + ->setTag('a') 264 + ->setIcon($icon); 261 265 262 266 $warning_view = id(new AphrontErrorView()) 263 267 ->setSeverity(AphrontErrorView::SEVERITY_WARNING) ··· 265 269 ->appendChild( 266 270 pht("This commit is very large. Load each file individually.")); 267 271 268 - $change_panel->appendChild($warning_view); 269 - $change_panel->addButton($show_all_button); 272 + $change_panel->setFormError($warning_view); 273 + $header->addActionLink($button); 270 274 } 271 275 272 276 $change_panel->appendChild($change_table); 273 - $change_panel->setNoBackground(); 277 + $change_panel->setHeader($header); 274 278 275 279 $content[] = $change_panel; 276 280
+37 -16
src/applications/diffusion/controller/DiffusionRepositoryController.php
··· 294 294 $header->setSubHeader(pht('Showing %d branches.', $limit)); 295 295 } 296 296 297 + $icon = id(new PHUIIconView()) 298 + ->setSpriteSheet(PHUIIconView::SPRITE_ICONS) 299 + ->setSpriteIcon('fork'); 300 + 297 301 $button = new PHUIButtonView(); 298 302 $button->setText(pht("Show All Branches")); 299 303 $button->setTag('a'); 304 + $button->setIcon($icon); 300 305 $button->setHref($drequest->generateURI( 301 306 array( 302 307 'action' => 'branches', ··· 455 460 } 456 461 457 462 $history_table->setIsHead(true); 458 - 459 463 $callsign = $drequest->getRepository()->getCallsign(); 460 - $all = phutil_tag( 461 - 'a', 462 - array( 463 - 'href' => $drequest->generateURI( 464 - array( 465 - 'action' => 'history', 466 - )), 467 - ), 468 - pht('View Full Commit History')); 464 + 465 + $icon = id(new PHUIIconView()) 466 + ->setSpriteSheet(PHUIIconView::SPRITE_ICONS) 467 + ->setSpriteIcon('transcript'); 468 + 469 + $button = id(new PHUIButtonView()) 470 + ->setText(pht('View Full History')) 471 + ->setHref($drequest->generateURI( 472 + array( 473 + 'action' => 'history', 474 + ))) 475 + ->setTag('a') 476 + ->setIcon($icon); 469 477 470 478 $panel = new PHUIObjectBoxView(); 471 - $panel->setHeaderText(pht("Recent Commits · %s", $all)); 479 + $header = id(new PHUIHeaderView()) 480 + ->setHeader(pht('Recent Commits')) 481 + ->addActionLink($button); 482 + $panel->setHeader($header); 472 483 $panel->appendChild($history_table); 473 484 474 485 return $panel; ··· 509 520 $browse_uri = $drequest->generateURI(array('action' => 'browse')); 510 521 511 522 $browse_panel = new PHUIObjectBoxView(); 512 - $browse_panel->setHeaderText( 513 - phutil_tag( 514 - 'a', 515 - array('href' => $browse_uri), 516 - pht('Browse Repository'))); 523 + $header = id(new PHUIHeaderView()) 524 + ->setHeader(pht('Repository')); 525 + 526 + $icon = id(new PHUIIconView()) 527 + ->setSpriteSheet(PHUIIconView::SPRITE_ICONS) 528 + ->setSpriteIcon('data'); 529 + 530 + $button = new PHUIButtonView(); 531 + $button->setText(pht('Browse Repository')); 532 + $button->setTag('a'); 533 + $button->setIcon($icon); 534 + $button->setHref($browse_uri); 535 + 536 + $header->addActionLink($button); 537 + $browse_panel->setHeader($header); 517 538 $browse_panel->appendChild($browse_table); 518 539 519 540 return $browse_panel;
+7
src/view/phui/PHUIObjectBoxView.php
··· 8 8 private $validationException; 9 9 private $header; 10 10 private $flush; 11 + private $id; 11 12 12 13 private $tabs = array(); 13 14 private $propertyLists = array(); ··· 70 71 71 72 public function setForm($form) { 72 73 $this->form = $form; 74 + return $this; 75 + } 76 + 77 + public function setID($id) { 78 + $this->id = $id; 73 79 return $this; 74 80 } 75 81 ··· 196 202 $this->renderChildren(), 197 203 )) 198 204 ->setBorder(true) 205 + ->setID($this->id) 199 206 ->addMargin(PHUI::MARGIN_LARGE_TOP) 200 207 ->addMargin(PHUI::MARGIN_LARGE_LEFT) 201 208 ->addMargin(PHUI::MARGIN_LARGE_RIGHT)
+3 -2
webroot/rsrc/css/aphront/error-view.css
··· 16 16 margin: 16px; 17 17 } 18 18 .aphront-error-view-dialogue { 19 - margin: 0px 0px 16px 0px; 19 + margin: 0 0 16px 0; 20 20 } 21 21 22 22 .device-phone .aphront-error-view { ··· 33 33 } 34 34 35 35 h1.aphront-error-view-head { 36 - padding: 10px 10px 0 10px; 36 + padding: 12px 8px 0 12px; 37 37 font-weight: bold; 38 + font-size: 15px; 38 39 color: {$darkgreytext}; 39 40 } 40 41
+4 -2
webroot/rsrc/css/phui/phui-object-box.css
··· 22 22 padding: 8px 0; 23 23 } 24 24 25 - .phui-object-box .aphront-error-view { 26 - margin-bottom: 0; 25 + .phui-object-box .phui-header-shell + .aphront-error-view { 26 + margin: 0; 27 + border-width: 0; 28 + border-bottom: 1px solid {$lightblueborder}; 27 29 } 28 30 29 31 .device-phone .phui-object-box {