mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 00:42:41 +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);
|
||||
|
||||
$create_uri = '/phriction/edit/?slug='.$slug;
|
||||
|
||||
$notice = new PHUIInfoView();
|
||||
$notice->setSeverity(PHUIInfoView::SEVERITY_WARNING);
|
||||
$notice->setTitle(pht('No content here!'));
|
||||
$notice->appendChild(
|
||||
pht(
|
||||
'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;
|
||||
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_button = id(new PHUIButtonView())
|
||||
->setTag('a')
|
||||
->setText($create_text)
|
||||
->setHref($create_uri)
|
||||
->setColor(PHUIButtonView::GREEN);
|
||||
|
||||
$core_content = id(new PHUIBigInfoView())
|
||||
->setIcon('fa-book')
|
||||
->setTitle($title)
|
||||
->setDescription($subtitle)
|
||||
->addAction($create_button);
|
||||
|
||||
} else {
|
||||
$version = $request->getInt('v');
|
||||
|
||||
|
|
Loading…
Reference in a new issue