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

Rough in Guides Application

Summary: Ref T11132, Ref T11478. Builds out a basic PHUICMSView and Guides Application, no content / modules.

Test Plan: Go to /guides/, see blank states for new guides.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T11132, T11478

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

+379
+2
resources/celerity/map.php
··· 127 127 'rsrc/css/phui/phui-box.css' => '5c8387cf', 128 128 'rsrc/css/phui/phui-button.css' => '4a5fbe3d', 129 129 'rsrc/css/phui/phui-chart.css' => '6bf6f78e', 130 + 'rsrc/css/phui/phui-cms.css' => '33064557', 130 131 'rsrc/css/phui/phui-crumbs-view.css' => '9dac418c', 131 132 'rsrc/css/phui/phui-curtain-view.css' => '7148ae25', 132 133 'rsrc/css/phui/phui-document-pro.css' => 'dc3d46ed', ··· 832 833 'phui-calendar-list-css' => 'fcc9fb41', 833 834 'phui-calendar-month-css' => '8e10e92c', 834 835 'phui-chart-css' => '6bf6f78e', 836 + 'phui-cms-css' => '33064557', 835 837 'phui-crumbs-view-css' => '9dac418c', 836 838 'phui-curtain-view-css' => '7148ae25', 837 839 'phui-document-summary-view-css' => '9ca48bdf',
+12
src/__phutil_library_map__.php
··· 1597 1597 'PHUIButtonBarView' => 'view/phui/PHUIButtonBarView.php', 1598 1598 'PHUIButtonExample' => 'applications/uiexample/examples/PHUIButtonExample.php', 1599 1599 'PHUIButtonView' => 'view/phui/PHUIButtonView.php', 1600 + 'PHUICMSView' => 'view/phui/PHUICMSView.php', 1600 1601 'PHUICalendarDayView' => 'view/phui/calendar/PHUICalendarDayView.php', 1601 1602 'PHUICalendarListView' => 'view/phui/calendar/PHUICalendarListView.php', 1602 1603 'PHUICalendarMonthView' => 'view/phui/calendar/PHUICalendarMonthView.php', ··· 2629 2630 'PhabricatorGlobalLock' => 'infrastructure/util/PhabricatorGlobalLock.php', 2630 2631 'PhabricatorGlobalUploadTargetView' => 'applications/files/view/PhabricatorGlobalUploadTargetView.php', 2631 2632 'PhabricatorGoogleAuthProvider' => 'applications/auth/provider/PhabricatorGoogleAuthProvider.php', 2633 + 'PhabricatorGuideApplication' => 'applications/guides/application/PhabricatorGuideApplication.php', 2634 + 'PhabricatorGuideController' => 'applications/guides/controller/PhabricatorGuideController.php', 2635 + 'PhabricatorGuideInstallController' => 'applications/guides/controller/PhabricatorGuideInstallController.php', 2636 + 'PhabricatorGuideQuickStartController' => 'applications/guides/controller/PhabricatorGuideQuickStartController.php', 2637 + 'PhabricatorGuideWelcomeController' => 'applications/guides/controller/PhabricatorGuideWelcomeController.php', 2632 2638 'PhabricatorHTTPParameterTypeTableView' => 'applications/config/view/PhabricatorHTTPParameterTypeTableView.php', 2633 2639 'PhabricatorHandleList' => 'applications/phid/handle/pool/PhabricatorHandleList.php', 2634 2640 'PhabricatorHandleObjectSelectorDataView' => 'applications/phid/handle/view/PhabricatorHandleObjectSelectorDataView.php', ··· 6243 6249 'PHUIButtonBarView' => 'AphrontTagView', 6244 6250 'PHUIButtonExample' => 'PhabricatorUIExample', 6245 6251 'PHUIButtonView' => 'AphrontTagView', 6252 + 'PHUICMSView' => 'AphrontTagView', 6246 6253 'PHUICalendarDayView' => 'AphrontView', 6247 6254 'PHUICalendarListView' => 'AphrontTagView', 6248 6255 'PHUICalendarMonthView' => 'AphrontView', ··· 7429 7436 'PhabricatorGlobalLock' => 'PhutilLock', 7430 7437 'PhabricatorGlobalUploadTargetView' => 'AphrontView', 7431 7438 'PhabricatorGoogleAuthProvider' => 'PhabricatorOAuth2AuthProvider', 7439 + 'PhabricatorGuideApplication' => 'PhabricatorApplication', 7440 + 'PhabricatorGuideController' => 'PhabricatorController', 7441 + 'PhabricatorGuideInstallController' => 'PhabricatorGuideController', 7442 + 'PhabricatorGuideQuickStartController' => 'PhabricatorGuideController', 7443 + 'PhabricatorGuideWelcomeController' => 'PhabricatorGuideController', 7432 7444 'PhabricatorHTTPParameterTypeTableView' => 'AphrontView', 7433 7445 'PhabricatorHandleList' => array( 7434 7446 'Phobject',
+41
src/applications/guides/application/PhabricatorGuideApplication.php
··· 1 + <?php 2 + 3 + final class PhabricatorGuideApplication extends PhabricatorApplication { 4 + 5 + public function getBaseURI() { 6 + return '/guides/'; 7 + } 8 + 9 + public function getName() { 10 + return pht('Guides'); 11 + } 12 + 13 + public function getShortDescription() { 14 + return pht('Short Tutorials'); 15 + } 16 + 17 + public function getIcon() { 18 + return 'fa-map-o'; 19 + } 20 + 21 + public function isPrototype() { 22 + return true; 23 + } 24 + 25 + public function getApplicationGroup() { 26 + return self::GROUP_UTILITIES; 27 + } 28 + 29 + public function getRoutes() { 30 + return array( 31 + '/guides/' => array( 32 + '' => 'PhabricatorGuideWelcomeController', 33 + 'install/' 34 + => 'PhabricatorGuideInstallController', 35 + 'quickstart/' 36 + => 'PhabricatorGuideQuickStartController', 37 + ), 38 + ); 39 + } 40 + 41 + }
+21
src/applications/guides/controller/PhabricatorGuideController.php
··· 1 + <?php 2 + 3 + abstract class PhabricatorGuideController extends PhabricatorController { 4 + 5 + public function buildSideNavView($filter = null, $for_app = false) { 6 + 7 + $nav = new AphrontSideNavFilterView(); 8 + $nav->setBaseURI(new PhutilURI($this->getApplicationURI())); 9 + $nav->addLabel(pht('Guides')); 10 + $nav->addFilter('/', pht('Welcome')); 11 + $nav->addFilter('install/', pht('Installation Guide')); 12 + $nav->addFilter('quickstart/', pht('Quick Start Guide')); 13 + 14 + return $nav; 15 + } 16 + 17 + public function buildApplicationMenu() { 18 + return $this->buildSideNavView(null, true)->getMenu(); 19 + } 20 + 21 + }
+46
src/applications/guides/controller/PhabricatorGuideInstallController.php
··· 1 + <?php 2 + 3 + final class PhabricatorGuideInstallController 4 + extends PhabricatorGuideController { 5 + 6 + public function shouldAllowPublic() { 7 + return false; 8 + } 9 + 10 + public function handleRequest(AphrontRequest $request) { 11 + $viewer = $request->getViewer(); 12 + 13 + $title = pht('Installation Guide'); 14 + 15 + $nav = $this->buildSideNavView(); 16 + $nav->selectFilter('install/'); 17 + 18 + $header = id(new PHUIHeaderView()) 19 + ->setHeader($title) 20 + ->setProfileHeader(true); 21 + 22 + $crumbs = $this->buildApplicationCrumbs() 23 + ->addTextCrumb(pht('Installation')); 24 + 25 + $content = null; 26 + 27 + $view = id(new PHUICMSView()) 28 + ->setCrumbs($crumbs) 29 + ->setNavigation($nav) 30 + ->setHeader($header) 31 + ->setContent($content); 32 + 33 + return $this->newPage() 34 + ->setTitle($title) 35 + ->addClass('phui-cms-body') 36 + ->appendChild($view); 37 + 38 + } 39 + 40 + private function getGuideContent() { 41 + 42 + $guide = null; 43 + 44 + return $guide; 45 + } 46 + }
+46
src/applications/guides/controller/PhabricatorGuideQuickStartController.php
··· 1 + <?php 2 + 3 + final class PhabricatorGuideQuickStartController 4 + extends PhabricatorGuideController { 5 + 6 + public function shouldAllowPublic() { 7 + return false; 8 + } 9 + 10 + public function handleRequest(AphrontRequest $request) { 11 + $viewer = $request->getViewer(); 12 + 13 + $title = pht('Quick Start Guide'); 14 + 15 + $nav = $this->buildSideNavView(); 16 + $nav->selectFilter('quickstart/'); 17 + 18 + $header = id(new PHUIHeaderView()) 19 + ->setHeader($title) 20 + ->setProfileHeader(true); 21 + 22 + $crumbs = $this->buildApplicationCrumbs() 23 + ->addTextCrumb(pht('Quick Start')); 24 + 25 + $content = null; 26 + 27 + $view = id(new PHUICMSView()) 28 + ->setCrumbs($crumbs) 29 + ->setNavigation($nav) 30 + ->setHeader($header) 31 + ->setContent($content); 32 + 33 + return $this->newPage() 34 + ->setTitle($title) 35 + ->addClass('phui-cms-body') 36 + ->appendChild($view); 37 + 38 + } 39 + 40 + private function getGuideContent() { 41 + 42 + $guide = null; 43 + 44 + return $guide; 45 + } 46 + }
+46
src/applications/guides/controller/PhabricatorGuideWelcomeController.php
··· 1 + <?php 2 + 3 + final class PhabricatorGuideWelcomeController 4 + extends PhabricatorGuideController { 5 + 6 + public function shouldAllowPublic() { 7 + return false; 8 + } 9 + 10 + public function handleRequest(AphrontRequest $request) { 11 + $viewer = $request->getViewer(); 12 + 13 + $title = pht('Welcome to Phabricator'); 14 + 15 + $nav = $this->buildSideNavView(); 16 + $nav->selectFilter('/'); 17 + 18 + $header = id(new PHUIHeaderView()) 19 + ->setHeader($title) 20 + ->setProfileHeader(true); 21 + 22 + $crumbs = $this->buildApplicationCrumbs() 23 + ->addTextCrumb(pht('Welcome')); 24 + 25 + $content = null; 26 + 27 + $view = id(new PHUICMSView()) 28 + ->setCrumbs($crumbs) 29 + ->setNavigation($nav) 30 + ->setHeader($header) 31 + ->setContent($content); 32 + 33 + return $this->newPage() 34 + ->setTitle($title) 35 + ->addClass('phui-cms-body') 36 + ->appendChild($view); 37 + 38 + } 39 + 40 + private function getGuideContent() { 41 + 42 + $guide = null; 43 + 44 + return $guide; 45 + } 46 + }
+118
src/view/phui/PHUICMSView.php
··· 1 + <?php 2 + 3 + final class PHUICMSView extends AphrontTagView { 4 + 5 + private $header; 6 + private $nav; 7 + private $crumbs; 8 + private $content; 9 + private $toc; 10 + private $comments; 11 + 12 + public function setHeader(PHUIHeaderView $header) { 13 + $this->header = $header; 14 + return $this; 15 + } 16 + 17 + public function setNavigation(AphrontSideNavFilterView $nav) { 18 + $this->nav = $nav; 19 + return $this; 20 + } 21 + 22 + public function setCrumbs(PHUICrumbsView $crumbs) { 23 + $this->crumbs = $crumbs; 24 + return $this; 25 + } 26 + 27 + public function setContent($content) { 28 + $this->content = $content; 29 + return $this; 30 + } 31 + 32 + public function setToc($toc) { 33 + $this->toc = $toc; 34 + return $this; 35 + } 36 + 37 + public function setComments($comments) { 38 + $this->comments = $comments; 39 + } 40 + 41 + protected function getTagName() { 42 + return 'div'; 43 + } 44 + 45 + protected function getTagAttributes() { 46 + require_celerity_resource('phui-cms-css'); 47 + 48 + $classes = array(); 49 + $classes[] = 'phui-cms-view'; 50 + 51 + if ($this->comments) { 52 + $classes[] = 'phui-cms-has-comments'; 53 + } 54 + 55 + return array( 56 + 'class' => implode(' ', $classes), 57 + ); 58 + 59 + } 60 + 61 + protected function getTagContent() { 62 + 63 + $content = phutil_tag( 64 + 'div', 65 + array( 66 + 'class' => 'phui-cms-page-content', 67 + ), 68 + array( 69 + $this->header, 70 + $this->content, 71 + )); 72 + 73 + $comments = null; 74 + if ($this->comments) { 75 + $comments = phutil_tag( 76 + 'div', 77 + array( 78 + 'class' => 'phui-cms-comments', 79 + ), 80 + array( 81 + $this->comments, 82 + )); 83 + } 84 + 85 + $navigation = $this->nav; 86 + $navigation->appendChild($content); 87 + $navigation->appendChild($comments); 88 + 89 + $page = phutil_tag( 90 + 'div', 91 + array( 92 + 'class' => 'phui-cms-inner', 93 + ), 94 + array( 95 + $navigation, 96 + )); 97 + 98 + $cms_view = phutil_tag( 99 + 'div', 100 + array( 101 + 'class' => 'phui-cms-wrap', 102 + ), 103 + array( 104 + $this->crumbs, 105 + $page, 106 + )); 107 + 108 + $classes = array(); 109 + $classes[] = 'phui-cms-page'; 110 + 111 + return phutil_tag( 112 + 'div', 113 + array( 114 + 'class' => implode(' ', $classes), 115 + ), 116 + $cms_view); 117 + } 118 + }
+47
webroot/rsrc/css/phui/phui-cms.css
··· 1 + /** 2 + * @provides phui-cms-css 3 + */ 4 + 5 + 6 + .phui-cms-body { 7 + background-color: #f0f0f2; 8 + } 9 + 10 + .phui-cms-view .phui-crumbs-view { 11 + border-bottom: 1px solid {$thinblueborder}; 12 + } 13 + 14 + .phui-cms-page { 15 + max-width: 1140px; 16 + margin: 0 auto; 17 + background-color: #fff; 18 + border-left: 1px solid {$lightblueborder}; 19 + border-right: 1px solid {$lightblueborder}; 20 + border-bottom: 1px solid {$lightblueborder}; 21 + margin-bottom: 20px; 22 + } 23 + 24 + .phui-cms-view .phui-basic-nav.phui-navigation-shell .phabricator-nav-local { 25 + background-color: {$page.background}; 26 + width: 240px; 27 + border-right: 1px solid {$thinblueborder}; 28 + } 29 + 30 + .phui-cms-view .phabricator-nav-content { 31 + padding: 0; 32 + } 33 + 34 + .phui-cms-view .phui-document-container { 35 + border: none; 36 + } 37 + 38 + .phui-cms-view .phui-profile-header { 39 + padding: 32px 20px; 40 + border-bottom: 1px solid {$thinblueborder}; 41 + } 42 + 43 + .phui-cms-view .phui-document-view.phui-document-view-pro { 44 + width: auto; 45 + padding: 32px 20px; 46 + margin: 0; 47 + }