mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-22 05:20:56 +01:00
Basic NUX states for Phriction
Summary: Adds a basic nux for `/` and not found documents. Ref T10023 Test Plan: Visit a clean install, see Welcome page. Visit a non built page, see not found UX Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T10023 Differential Revision: https://secure.phabricator.com/D14854
This commit is contained in:
parent
536d3a2185
commit
551732b962
1 changed files with 24 additions and 11 deletions
|
@ -38,20 +38,33 @@ final class PhrictionDocumentController
|
||||||
|
|
||||||
$document = PhrictionDocument::initializeNewDocument($viewer, $slug);
|
$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');
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$title = pht('No Document Here');
|
||||||
|
$subtitle = pht('There is no document here, but you may create it.');
|
||||||
|
$page_title = pht('Page Not Found');
|
||||||
|
$create_text = pht('Create this Document');
|
||||||
|
}
|
||||||
|
|
||||||
$create_uri = '/phriction/edit/?slug='.$slug;
|
$create_uri = '/phriction/edit/?slug='.$slug;
|
||||||
|
$create_button = id(new PHUIButtonView())
|
||||||
|
->setTag('a')
|
||||||
|
->setText($create_text)
|
||||||
|
->setHref($create_uri)
|
||||||
|
->setColor(PHUIButtonView::GREEN);
|
||||||
|
|
||||||
$notice = new PHUIInfoView();
|
$core_content = id(new PHUIBigInfoView())
|
||||||
$notice->setSeverity(PHUIInfoView::SEVERITY_WARNING);
|
->setIcon('fa-book')
|
||||||
$notice->setTitle(pht('No content here!'));
|
->setTitle($title)
|
||||||
$notice->appendChild(
|
->setDescription($subtitle)
|
||||||
pht(
|
->addAction($create_button);
|
||||||
'No document found at %s. You can <strong>'.
|
|
||||||
'<a href="%s">create a new document here</a></strong>.',
|
|
||||||
phutil_tag('tt', array(), $slug),
|
|
||||||
$create_uri));
|
|
||||||
$core_content = $notice;
|
|
||||||
|
|
||||||
$page_title = pht('Page Not Found');
|
|
||||||
} else {
|
} else {
|
||||||
$version = $request->getInt('v');
|
$version = $request->getInt('v');
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue