Page MenuHomePhabricator

D19863.id47430.diff
No OneTemporary

D19863.id47430.diff

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');

File Metadata

Mime Type
text/plain
Expires
Fri, Mar 7, 6:48 AM (5 d, 3 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7324856
Default Alt Text
D19863.id47430.diff (2 KB)

Event Timeline