Page MenuHomePhabricator

D16414.id39471.diff
No OneTemporary

D16414.id39471.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -127,6 +127,7 @@
'rsrc/css/phui/phui-box.css' => '5c8387cf',
'rsrc/css/phui/phui-button.css' => '4a5fbe3d',
'rsrc/css/phui/phui-chart.css' => '6bf6f78e',
+ 'rsrc/css/phui/phui-cms.css' => '33064557',
'rsrc/css/phui/phui-crumbs-view.css' => '9dac418c',
'rsrc/css/phui/phui-curtain-view.css' => '7148ae25',
'rsrc/css/phui/phui-document-pro.css' => 'dc3d46ed',
@@ -832,6 +833,7 @@
'phui-calendar-list-css' => 'fcc9fb41',
'phui-calendar-month-css' => '8e10e92c',
'phui-chart-css' => '6bf6f78e',
+ 'phui-cms-css' => '33064557',
'phui-crumbs-view-css' => '9dac418c',
'phui-curtain-view-css' => '7148ae25',
'phui-document-summary-view-css' => '9ca48bdf',
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -1598,6 +1598,7 @@
'PHUIButtonBarView' => 'view/phui/PHUIButtonBarView.php',
'PHUIButtonExample' => 'applications/uiexample/examples/PHUIButtonExample.php',
'PHUIButtonView' => 'view/phui/PHUIButtonView.php',
+ 'PHUICMSView' => 'view/phui/PHUICMSView.php',
'PHUICalendarDayView' => 'view/phui/calendar/PHUICalendarDayView.php',
'PHUICalendarListView' => 'view/phui/calendar/PHUICalendarListView.php',
'PHUICalendarMonthView' => 'view/phui/calendar/PHUICalendarMonthView.php',
@@ -2630,6 +2631,11 @@
'PhabricatorGlobalLock' => 'infrastructure/util/PhabricatorGlobalLock.php',
'PhabricatorGlobalUploadTargetView' => 'applications/files/view/PhabricatorGlobalUploadTargetView.php',
'PhabricatorGoogleAuthProvider' => 'applications/auth/provider/PhabricatorGoogleAuthProvider.php',
+ 'PhabricatorGuideApplication' => 'applications/guides/application/PhabricatorGuideApplication.php',
+ 'PhabricatorGuideController' => 'applications/guides/controller/PhabricatorGuideController.php',
+ 'PhabricatorGuideInstallController' => 'applications/guides/controller/PhabricatorGuideInstallController.php',
+ 'PhabricatorGuideQuickStartController' => 'applications/guides/controller/PhabricatorGuideQuickStartController.php',
+ 'PhabricatorGuideWelcomeController' => 'applications/guides/controller/PhabricatorGuideWelcomeController.php',
'PhabricatorHTTPParameterTypeTableView' => 'applications/config/view/PhabricatorHTTPParameterTypeTableView.php',
'PhabricatorHandleList' => 'applications/phid/handle/pool/PhabricatorHandleList.php',
'PhabricatorHandleObjectSelectorDataView' => 'applications/phid/handle/view/PhabricatorHandleObjectSelectorDataView.php',
@@ -6245,6 +6251,7 @@
'PHUIButtonBarView' => 'AphrontTagView',
'PHUIButtonExample' => 'PhabricatorUIExample',
'PHUIButtonView' => 'AphrontTagView',
+ 'PHUICMSView' => 'AphrontTagView',
'PHUICalendarDayView' => 'AphrontView',
'PHUICalendarListView' => 'AphrontTagView',
'PHUICalendarMonthView' => 'AphrontView',
@@ -7431,6 +7438,11 @@
'PhabricatorGlobalLock' => 'PhutilLock',
'PhabricatorGlobalUploadTargetView' => 'AphrontView',
'PhabricatorGoogleAuthProvider' => 'PhabricatorOAuth2AuthProvider',
+ 'PhabricatorGuideApplication' => 'PhabricatorApplication',
+ 'PhabricatorGuideController' => 'PhabricatorController',
+ 'PhabricatorGuideInstallController' => 'PhabricatorGuideController',
+ 'PhabricatorGuideQuickStartController' => 'PhabricatorGuideController',
+ 'PhabricatorGuideWelcomeController' => 'PhabricatorGuideController',
'PhabricatorHTTPParameterTypeTableView' => 'AphrontView',
'PhabricatorHandleList' => array(
'Phobject',
diff --git a/src/applications/guides/application/PhabricatorGuideApplication.php b/src/applications/guides/application/PhabricatorGuideApplication.php
new file mode 100644
--- /dev/null
+++ b/src/applications/guides/application/PhabricatorGuideApplication.php
@@ -0,0 +1,41 @@
+<?php
+
+final class PhabricatorGuideApplication extends PhabricatorApplication {
+
+ public function getBaseURI() {
+ return '/guides/';
+ }
+
+ public function getName() {
+ return pht('Guides');
+ }
+
+ public function getShortDescription() {
+ return pht('Short Tutorials');
+ }
+
+ public function getIcon() {
+ return 'fa-map-o';
+ }
+
+ public function isPrototype() {
+ return true;
+ }
+
+ public function getApplicationGroup() {
+ return self::GROUP_UTILITIES;
+ }
+
+ public function getRoutes() {
+ return array(
+ '/guides/' => array(
+ '' => 'PhabricatorGuideWelcomeController',
+ 'install/'
+ => 'PhabricatorGuideInstallController',
+ 'quickstart/'
+ => 'PhabricatorGuideQuickStartController',
+ ),
+ );
+ }
+
+}
diff --git a/src/applications/guides/controller/PhabricatorGuideController.php b/src/applications/guides/controller/PhabricatorGuideController.php
new file mode 100644
--- /dev/null
+++ b/src/applications/guides/controller/PhabricatorGuideController.php
@@ -0,0 +1,21 @@
+<?php
+
+abstract class PhabricatorGuideController extends PhabricatorController {
+
+ public function buildSideNavView($filter = null, $for_app = false) {
+
+ $nav = new AphrontSideNavFilterView();
+ $nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
+ $nav->addLabel(pht('Guides'));
+ $nav->addFilter('/', pht('Welcome'));
+ $nav->addFilter('install/', pht('Installation Guide'));
+ $nav->addFilter('quickstart/', pht('Quick Start Guide'));
+
+ return $nav;
+ }
+
+ public function buildApplicationMenu() {
+ return $this->buildSideNavView(null, true)->getMenu();
+ }
+
+}
diff --git a/src/applications/guides/controller/PhabricatorGuideInstallController.php b/src/applications/guides/controller/PhabricatorGuideInstallController.php
new file mode 100644
--- /dev/null
+++ b/src/applications/guides/controller/PhabricatorGuideInstallController.php
@@ -0,0 +1,46 @@
+<?php
+
+final class PhabricatorGuideInstallController
+ extends PhabricatorGuideController {
+
+ public function shouldAllowPublic() {
+ return false;
+ }
+
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+
+ $title = pht('Installation Guide');
+
+ $nav = $this->buildSideNavView();
+ $nav->selectFilter('install/');
+
+ $header = id(new PHUIHeaderView())
+ ->setHeader($title)
+ ->setProfileHeader(true);
+
+ $crumbs = $this->buildApplicationCrumbs()
+ ->addTextCrumb(pht('Installation'));
+
+ $content = null;
+
+ $view = id(new PHUICMSView())
+ ->setCrumbs($crumbs)
+ ->setNavigation($nav)
+ ->setHeader($header)
+ ->setContent($content);
+
+ return $this->newPage()
+ ->setTitle($title)
+ ->addClass('phui-cms-body')
+ ->appendChild($view);
+
+ }
+
+ private function getGuideContent() {
+
+ $guide = null;
+
+ return $guide;
+ }
+}
diff --git a/src/applications/guides/controller/PhabricatorGuideQuickStartController.php b/src/applications/guides/controller/PhabricatorGuideQuickStartController.php
new file mode 100644
--- /dev/null
+++ b/src/applications/guides/controller/PhabricatorGuideQuickStartController.php
@@ -0,0 +1,46 @@
+<?php
+
+final class PhabricatorGuideQuickStartController
+ extends PhabricatorGuideController {
+
+ public function shouldAllowPublic() {
+ return false;
+ }
+
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+
+ $title = pht('Quick Start Guide');
+
+ $nav = $this->buildSideNavView();
+ $nav->selectFilter('quickstart/');
+
+ $header = id(new PHUIHeaderView())
+ ->setHeader($title)
+ ->setProfileHeader(true);
+
+ $crumbs = $this->buildApplicationCrumbs()
+ ->addTextCrumb(pht('Quick Start'));
+
+ $content = null;
+
+ $view = id(new PHUICMSView())
+ ->setCrumbs($crumbs)
+ ->setNavigation($nav)
+ ->setHeader($header)
+ ->setContent($content);
+
+ return $this->newPage()
+ ->setTitle($title)
+ ->addClass('phui-cms-body')
+ ->appendChild($view);
+
+ }
+
+ private function getGuideContent() {
+
+ $guide = null;
+
+ return $guide;
+ }
+}
diff --git a/src/applications/guides/controller/PhabricatorGuideWelcomeController.php b/src/applications/guides/controller/PhabricatorGuideWelcomeController.php
new file mode 100644
--- /dev/null
+++ b/src/applications/guides/controller/PhabricatorGuideWelcomeController.php
@@ -0,0 +1,46 @@
+<?php
+
+final class PhabricatorGuideWelcomeController
+ extends PhabricatorGuideController {
+
+ public function shouldAllowPublic() {
+ return false;
+ }
+
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+
+ $title = pht('Welcome to Phabricator');
+
+ $nav = $this->buildSideNavView();
+ $nav->selectFilter('/');
+
+ $header = id(new PHUIHeaderView())
+ ->setHeader($title)
+ ->setProfileHeader(true);
+
+ $crumbs = $this->buildApplicationCrumbs()
+ ->addTextCrumb(pht('Welcome'));
+
+ $content = null;
+
+ $view = id(new PHUICMSView())
+ ->setCrumbs($crumbs)
+ ->setNavigation($nav)
+ ->setHeader($header)
+ ->setContent($content);
+
+ return $this->newPage()
+ ->setTitle($title)
+ ->addClass('phui-cms-body')
+ ->appendChild($view);
+
+ }
+
+ private function getGuideContent() {
+
+ $guide = null;
+
+ return $guide;
+ }
+}
diff --git a/src/view/phui/PHUICMSView.php b/src/view/phui/PHUICMSView.php
new file mode 100644
--- /dev/null
+++ b/src/view/phui/PHUICMSView.php
@@ -0,0 +1,118 @@
+<?php
+
+final class PHUICMSView extends AphrontTagView {
+
+ private $header;
+ private $nav;
+ private $crumbs;
+ private $content;
+ private $toc;
+ private $comments;
+
+ public function setHeader(PHUIHeaderView $header) {
+ $this->header = $header;
+ return $this;
+ }
+
+ public function setNavigation(AphrontSideNavFilterView $nav) {
+ $this->nav = $nav;
+ return $this;
+ }
+
+ public function setCrumbs(PHUICrumbsView $crumbs) {
+ $this->crumbs = $crumbs;
+ return $this;
+ }
+
+ public function setContent($content) {
+ $this->content = $content;
+ return $this;
+ }
+
+ public function setToc($toc) {
+ $this->toc = $toc;
+ return $this;
+ }
+
+ public function setComments($comments) {
+ $this->comments = $comments;
+ }
+
+ protected function getTagName() {
+ return 'div';
+ }
+
+ protected function getTagAttributes() {
+ require_celerity_resource('phui-cms-css');
+
+ $classes = array();
+ $classes[] = 'phui-cms-view';
+
+ if ($this->comments) {
+ $classes[] = 'phui-cms-has-comments';
+ }
+
+ return array(
+ 'class' => implode(' ', $classes),
+ );
+
+ }
+
+ protected function getTagContent() {
+
+ $content = phutil_tag(
+ 'div',
+ array(
+ 'class' => 'phui-cms-page-content',
+ ),
+ array(
+ $this->header,
+ $this->content,
+ ));
+
+ $comments = null;
+ if ($this->comments) {
+ $comments = phutil_tag(
+ 'div',
+ array(
+ 'class' => 'phui-cms-comments',
+ ),
+ array(
+ $this->comments,
+ ));
+ }
+
+ $navigation = $this->nav;
+ $navigation->appendChild($content);
+ $navigation->appendChild($comments);
+
+ $page = phutil_tag(
+ 'div',
+ array(
+ 'class' => 'phui-cms-inner',
+ ),
+ array(
+ $navigation,
+ ));
+
+ $cms_view = phutil_tag(
+ 'div',
+ array(
+ 'class' => 'phui-cms-wrap',
+ ),
+ array(
+ $this->crumbs,
+ $page,
+ ));
+
+ $classes = array();
+ $classes[] = 'phui-cms-page';
+
+ return phutil_tag(
+ 'div',
+ array(
+ 'class' => implode(' ', $classes),
+ ),
+ $cms_view);
+ }
+}
diff --git a/webroot/rsrc/css/phui/phui-cms.css b/webroot/rsrc/css/phui/phui-cms.css
new file mode 100644
--- /dev/null
+++ b/webroot/rsrc/css/phui/phui-cms.css
@@ -0,0 +1,47 @@
+/**
+ * @provides phui-cms-css
+ */
+
+
+.phui-cms-body {
+ background-color: #f0f0f2;
+}
+
+.phui-cms-view .phui-crumbs-view {
+ border-bottom: 1px solid {$thinblueborder};
+}
+
+.phui-cms-page {
+ max-width: 1140px;
+ margin: 0 auto;
+ background-color: #fff;
+ border-left: 1px solid {$lightblueborder};
+ border-right: 1px solid {$lightblueborder};
+ border-bottom: 1px solid {$lightblueborder};
+ margin-bottom: 20px;
+}
+
+.phui-cms-view .phui-basic-nav.phui-navigation-shell .phabricator-nav-local {
+ background-color: {$page.background};
+ width: 240px;
+ border-right: 1px solid {$thinblueborder};
+}
+
+.phui-cms-view .phabricator-nav-content {
+ padding: 0;
+}
+
+.phui-cms-view .phui-document-container {
+ border: none;
+}
+
+.phui-cms-view .phui-profile-header {
+ padding: 32px 20px;
+ border-bottom: 1px solid {$thinblueborder};
+}
+
+.phui-cms-view .phui-document-view.phui-document-view-pro {
+ width: auto;
+ padding: 32px 20px;
+ margin: 0;
+}

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 14, 7:21 AM (4 d, 9 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6756326
Default Alt Text
D16414.id39471.diff (12 KB)

Event Timeline