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

Add pattern search to diffusion home

Summary: Moves the method up to DiffusionController, so it can be more universally used. Also now center aligns tabs on mobile. Still todo, get search nicely toggled on mobile

Test Plan: Test mobile, desktop. Test search from home, from browse, and browsing a specific path.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

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

+79 -54
+5 -5
resources/celerity/map.php
··· 9 9 'names' => array( 10 10 'conpherence.pkg.css' => 'e68cf1fa', 11 11 'conpherence.pkg.js' => 'b5b51108', 12 - 'core.pkg.css' => '03047373', 12 + 'core.pkg.css' => 'dd8bcea0', 13 13 'core.pkg.js' => '5d80e0db', 14 14 'darkconsole.pkg.js' => '1f9a31bc', 15 15 'differential.pkg.css' => '45951e9e', ··· 75 75 'rsrc/css/application/diffusion/diffusion-readme.css' => '419dd5b6', 76 76 'rsrc/css/application/diffusion/diffusion-repository.css' => 'ee6f20ec', 77 77 'rsrc/css/application/diffusion/diffusion-source.css' => '750add59', 78 - 'rsrc/css/application/diffusion/diffusion.css' => 'dc8d51d0', 78 + 'rsrc/css/application/diffusion/diffusion.css' => '34d507b9', 79 79 'rsrc/css/application/feed/feed.css' => 'ecd4ec57', 80 80 'rsrc/css/application/files/global-drag-and-drop.css' => 'b556a948', 81 81 'rsrc/css/application/flag/flag.css' => 'bba8f811', ··· 178 178 'rsrc/css/phui/phui-status.css' => 'd5263e49', 179 179 'rsrc/css/phui/phui-tag-view.css' => 'b4719c50', 180 180 'rsrc/css/phui/phui-timeline-view.css' => 'f21db7ca', 181 - 'rsrc/css/phui/phui-two-column-view.css' => 'ae38a939', 181 + 'rsrc/css/phui/phui-two-column-view.css' => '81b0f3ce', 182 182 'rsrc/css/phui/workboards/phui-workboard-color.css' => '783cdff5', 183 183 'rsrc/css/phui/workboards/phui-workboard.css' => '3bc85455', 184 184 'rsrc/css/phui/workboards/phui-workcard.css' => 'cca5fa92', ··· 570 570 'differential-revision-history-css' => '0e8eb855', 571 571 'differential-revision-list-css' => 'f3c47d33', 572 572 'differential-table-of-contents-css' => 'ae4b7a55', 573 - 'diffusion-css' => 'dc8d51d0', 573 + 'diffusion-css' => '34d507b9', 574 574 'diffusion-icons-css' => '0c15255e', 575 575 'diffusion-readme-css' => '419dd5b6', 576 576 'diffusion-repository-css' => 'ee6f20ec', ··· 874 874 'phui-tag-view-css' => 'b4719c50', 875 875 'phui-theme-css' => '9f261c6b', 876 876 'phui-timeline-view-css' => 'f21db7ca', 877 - 'phui-two-column-view-css' => 'ae38a939', 877 + 'phui-two-column-view-css' => '81b0f3ce', 878 878 'phui-workboard-color-css' => '783cdff5', 879 879 'phui-workboard-view-css' => '3bc85455', 880 880 'phui-workcard-view-css' => 'cca5fa92',
+4 -48
src/applications/diffusion/controller/DiffusionBrowseController.php
··· 56 56 private function browseSearch() { 57 57 $drequest = $this->getDiffusionRequest(); 58 58 $header = $this->buildHeaderView($drequest); 59 + $path = nonempty(basename($drequest->getPath()), '/'); 59 60 60 61 $search_results = $this->renderSearchResults(); 61 - $search_form = $this->renderSearchForm(); 62 + $search_form = $this->renderSearchForm($path); 62 63 63 64 $search_form = phutil_tag( 64 65 'div', ··· 1473 1474 return "{$summary}\n{$date} \xC2\xB7 {$author}"; 1474 1475 } 1475 1476 1476 - protected function renderSearchForm() { 1477 - $drequest = $this->getDiffusionRequest(); 1478 - $viewer = $this->getViewer(); 1479 - switch ($drequest->getRepository()->getVersionControlSystem()) { 1480 - case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN: 1481 - return null; 1482 - } 1483 - 1484 - $search_term = $this->getRequest()->getStr('grep'); 1485 - require_celerity_resource('diffusion-icons-css'); 1486 - require_celerity_resource('diffusion-css'); 1487 - 1488 - $bar = javelin_tag( 1489 - 'input', 1490 - array( 1491 - 'type' => 'text', 1492 - 'id' => 'diffusion-search-input', 1493 - 'name' => 'grep', 1494 - 'class' => 'diffusion-search-input', 1495 - 'sigil' => 'diffusion-search-input', 1496 - 'placeholder' => pht('Pattern Search'), 1497 - 'value' => $search_term, 1498 - )); 1499 - 1500 - $form = phabricator_form( 1501 - $viewer, 1502 - array( 1503 - 'method' => 'GET', 1504 - 'sigil' => 'diffusion-search-form', 1505 - 'class' => 'diffusion-search-form', 1506 - 'id' => 'diffusion-search-form', 1507 - ), 1508 - array( 1509 - $bar, 1510 - )); 1511 - 1512 - $form_view = phutil_tag( 1513 - 'div', 1514 - array( 1515 - 'class' => 'diffusion-search-form-view', 1516 - ), 1517 - $form); 1518 - 1519 - return $form_view; 1520 - } 1521 - 1522 1477 protected function markupText($text) { 1523 1478 $engine = PhabricatorMarkupEngine::newDiffusionMarkupEngine(); 1524 1479 $engine->setConfig('viewer', $this->getRequest()->getUser()); ··· 1538 1493 $viewer = $this->getViewer(); 1539 1494 1540 1495 $tag = $this->renderCommitHashTag($drequest); 1541 - $search = $this->renderSearchForm(); 1496 + $path = nonempty(basename($drequest->getPath()), '/'); 1497 + $search = $this->renderSearchForm($path); 1542 1498 1543 1499 $header = id(new PHUIHeaderView()) 1544 1500 ->setUser($viewer)
+52
src/applications/diffusion/controller/DiffusionController.php
··· 410 410 ->setContent($readme_corpus); 411 411 } 412 412 413 + protected function renderSearchForm($path = '/') { 414 + $drequest = $this->getDiffusionRequest(); 415 + $viewer = $this->getViewer(); 416 + switch ($drequest->getRepository()->getVersionControlSystem()) { 417 + case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN: 418 + return null; 419 + } 420 + 421 + $search_term = $this->getRequest()->getStr('grep'); 422 + require_celerity_resource('diffusion-icons-css'); 423 + require_celerity_resource('diffusion-css'); 424 + 425 + $href = $drequest->generateURI(array( 426 + 'action' => 'browse', 427 + 'path' => $path, 428 + )); 429 + 430 + $bar = javelin_tag( 431 + 'input', 432 + array( 433 + 'type' => 'text', 434 + 'id' => 'diffusion-search-input', 435 + 'name' => 'grep', 436 + 'class' => 'diffusion-search-input', 437 + 'sigil' => 'diffusion-search-input', 438 + 'placeholder' => pht('Pattern Search'), 439 + 'value' => $search_term, 440 + )); 441 + 442 + $form = phabricator_form( 443 + $viewer, 444 + array( 445 + 'method' => 'GET', 446 + 'action' => $href, 447 + 'sigil' => 'diffusion-search-form', 448 + 'class' => 'diffusion-search-form', 449 + 'id' => 'diffusion-search-form', 450 + ), 451 + array( 452 + $bar, 453 + )); 454 + 455 + $form_view = phutil_tag( 456 + 'div', 457 + array( 458 + 'class' => 'diffusion-search-form-view', 459 + ), 460 + $form); 461 + 462 + return $form_view; 463 + } 464 + 413 465 protected function buildTabsView($key) { 414 466 $drequest = $this->getDiffusionRequest(); 415 467 $repository = $drequest->getRepository();
+3
src/applications/diffusion/controller/DiffusionRepositoryController.php
··· 300 300 301 301 private function buildHeaderView(PhabricatorRepository $repository) { 302 302 $viewer = $this->getViewer(); 303 + $search = $this->renderSearchForm(); 304 + 303 305 $header = id(new PHUIHeaderView()) 304 306 ->setHeader($repository->getName()) 305 307 ->setUser($viewer) ··· 307 309 ->setProfileHeader(true) 308 310 ->setImage($repository->getProfileImageURI()) 309 311 ->setImageEditURL('/diffusion/picture/'.$repository->getID().'/') 312 + ->addActionItem($search) 310 313 ->addClass('diffusion-profile-header'); 311 314 312 315 if (!$repository->isTracked()) {
+6 -1
webroot/rsrc/css/application/diffusion/diffusion.css
··· 12 12 display: block; 13 13 } 14 14 15 + .device-phone .diffusion-profile-header .phui-header-col1 { 16 + display: none; 17 + } 18 + 15 19 .diffusion-action-bar { 16 20 margin-bottom: 16px; 17 21 } ··· 145 149 padding-left: 12px; 146 150 } 147 151 148 - .device-phone .diffusion-browse-header .diffusion-search-form-view { 152 + .device-phone .diffusion-browse-header .diffusion-search-form-view, 153 + .device-phone .diffusion-profile-header .diffusion-search-form-view { 149 154 display: none; 150 155 } 151 156
+9
webroot/rsrc/css/phui/phui-two-column-view.css
··· 185 185 padding: 0 12px; 186 186 } 187 187 188 + .device-phone .phui-two-column-tabs .phui-list-view.phui-list-tabbar { 189 + text-align: center; 190 + } 191 + 192 + .device-phone .phui-two-column-tabs .phui-list-view.phui-list-tabbar > li { 193 + float: none; 194 + display: inline-block; 195 + } 196 + 188 197 /* Info View */ 189 198 190 199 .phui-two-column-view .phui-info-view {