Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15308991
D19863.id47430.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D19863.id47430.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D19863: Make it less confusing to create root-level Phriction doc
Attached
Detach File
Event Timeline
Log In to Comment