diff --git a/src/applications/phriction/controller/PhrictionController.php b/src/applications/phriction/controller/PhrictionController.php --- a/src/applications/phriction/controller/PhrictionController.php +++ b/src/applications/phriction/controller/PhrictionController.php @@ -2,6 +2,14 @@ abstract class PhrictionController extends PhabricatorController { + private $showingWelcomeDocument = false; + + public function setShowingWelcomeDocument($show_welcome) { + $this->showingWelcomeDocument = $show_welcome; + return $this; + + } + public function buildSideNavView($for_app = false) { $user = $this->getRequest()->getUser(); @@ -37,12 +45,14 @@ ->setIcon('fa-home')); } - $crumbs->addAction( - id(new PHUIListItemView()) - ->setName(pht('New Document')) - ->setHref('/phriction/new/?slug='.$this->getDocumentSlug()) - ->setWorkflow(true) - ->setIcon('fa-plus-square')); + if (!$this->showingWelcomeDocument) { + $crumbs->addAction( + id(new PHUIListItemView()) + ->setName(pht('New Document')) + ->setHref('/phriction/new/?slug='.$this->getDocumentSlug()) + ->setWorkflow(true) + ->setIcon('fa-plus-square')); + } return $crumbs; } diff --git a/src/applications/phriction/controller/PhrictionDocumentController.php b/src/applications/phriction/controller/PhrictionDocumentController.php --- a/src/applications/phriction/controller/PhrictionDocumentController.php +++ b/src/applications/phriction/controller/PhrictionDocumentController.php @@ -9,6 +9,7 @@ return true; } + public function handleRequest(AphrontRequest $request) { $viewer = $request->getViewer(); $this->slug = $request->getURIData('slug'); @@ -35,15 +36,15 @@ ->needContent(true) ->executeOne(); if (!$document) { - $document = PhrictionDocument::initializeNewDocument($viewer, $slug); - if ($slug == '/') { $title = pht('Welcome to Phriction'); $subtitle = pht('Phriction is a simple and easy to use wiki for '. 'keeping track of documents and their changes.'); $page_title = pht('Welcome'); $create_text = pht('Edit this Document'); + $this->setShowingWelcomeDocument(true); + } else { $title = pht('No Document Here');