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

Make it less confusing to create root-level Phriction doc

Summary: Without an existing root document, Phriction shows a nice little "fake" document as the landing page, which has its own nice "Edit this document" button. When showing that page, don't also render the standard "New Document" breadcrumb in the top right. That button always prompts first for a slug name, which is silly when the root document doesn't exist (because the slug name is required to be '').

Test Plan: Loaded Phriction with and without a root document.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

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

+19 -8
+16 -6
src/applications/phriction/controller/PhrictionController.php
··· 2 2 3 3 abstract class PhrictionController extends PhabricatorController { 4 4 5 + private $showingWelcomeDocument = false; 6 + 7 + public function setShowingWelcomeDocument($show_welcome) { 8 + $this->showingWelcomeDocument = $show_welcome; 9 + return $this; 10 + 11 + } 12 + 5 13 public function buildSideNavView($for_app = false) { 6 14 $user = $this->getRequest()->getUser(); 7 15 ··· 37 45 ->setIcon('fa-home')); 38 46 } 39 47 40 - $crumbs->addAction( 41 - id(new PHUIListItemView()) 42 - ->setName(pht('New Document')) 43 - ->setHref('/phriction/new/?slug='.$this->getDocumentSlug()) 44 - ->setWorkflow(true) 45 - ->setIcon('fa-plus-square')); 48 + if (!$this->showingWelcomeDocument) { 49 + $crumbs->addAction( 50 + id(new PHUIListItemView()) 51 + ->setName(pht('New Document')) 52 + ->setHref('/phriction/new/?slug='.$this->getDocumentSlug()) 53 + ->setWorkflow(true) 54 + ->setIcon('fa-plus-square')); 55 + } 46 56 47 57 return $crumbs; 48 58 }
+3 -2
src/applications/phriction/controller/PhrictionDocumentController.php
··· 9 9 return true; 10 10 } 11 11 12 + 12 13 public function handleRequest(AphrontRequest $request) { 13 14 $viewer = $request->getViewer(); 14 15 $this->slug = $request->getURIData('slug'); ··· 35 36 ->needContent(true) 36 37 ->executeOne(); 37 38 if (!$document) { 38 - 39 39 $document = PhrictionDocument::initializeNewDocument($viewer, $slug); 40 - 41 40 if ($slug == '/') { 42 41 $title = pht('Welcome to Phriction'); 43 42 $subtitle = pht('Phriction is a simple and easy to use wiki for '. 44 43 'keeping track of documents and their changes.'); 45 44 $page_title = pht('Welcome'); 46 45 $create_text = pht('Edit this Document'); 46 + $this->setShowingWelcomeDocument(true); 47 + 47 48 48 49 } else { 49 50 $title = pht('No Document Here');