From bde9ac43e71aa9e440705084b65c15ae85f37485 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Mon, 21 Dec 2015 09:55:45 -0800 Subject: [PATCH] Add various NUX states Summary: Adds basic NUX UI to Countdown, Paste, Phurl, Ponder, Slowvote, Macro, and Pholio. Test Plan: Review each with ?nux=true. Click on Create Button. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D14840 --- .../PhabricatorCountdownApplication.php | 2 ++ .../PhabricatorCountdownController.php | 2 +- .../PhabricatorCountdownSearchEngine.php | 20 +++++++++++++++++++ .../query/PhabricatorMacroSearchEngine.php | 19 ++++++++++++++++++ .../query/PhabricatorPasteSearchEngine.php | 19 ++++++++++++++++++ .../PhabricatorPholioApplication.php | 3 ++- .../pholio/controller/PholioController.php | 2 +- .../pholio/query/PholioMockSearchEngine.php | 20 +++++++++++++++++++ .../query/PhabricatorPhurlURLSearchEngine.php | 19 ++++++++++++++++++ .../query/PonderQuestionSearchEngine.php | 19 ++++++++++++++++++ .../query/PhabricatorSlowvoteSearchEngine.php | 19 ++++++++++++++++++ 11 files changed, 141 insertions(+), 3 deletions(-) diff --git a/src/applications/countdown/application/PhabricatorCountdownApplication.php b/src/applications/countdown/application/PhabricatorCountdownApplication.php index 14ef34d2cb..5daaa5021f 100644 --- a/src/applications/countdown/application/PhabricatorCountdownApplication.php +++ b/src/applications/countdown/application/PhabricatorCountdownApplication.php @@ -48,6 +48,8 @@ final class PhabricatorCountdownApplication extends PhabricatorApplication { => 'PhabricatorCountdownCommentController', 'edit/(?:(?P[1-9]\d*)/)?' => 'PhabricatorCountdownEditController', + 'create/' + => 'PhabricatorCountdownEditController', 'delete/(?P[1-9]\d*)/' => 'PhabricatorCountdownDeleteController', ), diff --git a/src/applications/countdown/controller/PhabricatorCountdownController.php b/src/applications/countdown/controller/PhabricatorCountdownController.php index e22ce95a47..37b0e49a68 100644 --- a/src/applications/countdown/controller/PhabricatorCountdownController.php +++ b/src/applications/countdown/controller/PhabricatorCountdownController.php @@ -13,7 +13,7 @@ abstract class PhabricatorCountdownController extends PhabricatorController { $crumbs->addAction( id(new PHUIListItemView()) ->setName(pht('Create Countdown')) - ->setHref($this->getApplicationURI('edit/')) + ->setHref($this->getApplicationURI('create/')) ->setIcon('fa-plus-square')); return $crumbs; diff --git a/src/applications/countdown/query/PhabricatorCountdownSearchEngine.php b/src/applications/countdown/query/PhabricatorCountdownSearchEngine.php index b9f438ece8..ae90e5f3e7 100644 --- a/src/applications/countdown/query/PhabricatorCountdownSearchEngine.php +++ b/src/applications/countdown/query/PhabricatorCountdownSearchEngine.php @@ -145,4 +145,24 @@ final class PhabricatorCountdownSearchEngine return $result; } + protected function getNewUserBody() { + $create_button = id(new PHUIButtonView()) + ->setTag('a') + ->setText(pht('Create a Countdown')) + ->setHref('/countdown/create/') + ->setColor(PHUIButtonView::GREEN); + + $icon = $this->getApplication()->getFontIcon(); + $app_name = $this->getApplication()->getName(); + $view = id(new PHUIBigInfoView()) + ->setIcon($icon) + ->setTitle(pht('Welcome to %s', $app_name)) + ->setDescription( + pht('Keep track of upcoming launch dates with '. + 'embeddable counters.')) + ->addAction($create_button); + + return $view; + } + } diff --git a/src/applications/macro/query/PhabricatorMacroSearchEngine.php b/src/applications/macro/query/PhabricatorMacroSearchEngine.php index 039f396d5f..1619f8185a 100644 --- a/src/applications/macro/query/PhabricatorMacroSearchEngine.php +++ b/src/applications/macro/query/PhabricatorMacroSearchEngine.php @@ -189,4 +189,23 @@ final class PhabricatorMacroSearchEngine return $result; } + protected function getNewUserBody() { + $create_button = id(new PHUIButtonView()) + ->setTag('a') + ->setText(pht('Create a Macro')) + ->setHref('/macro/create/') + ->setColor(PHUIButtonView::GREEN); + + $icon = $this->getApplication()->getFontIcon(); + $app_name = $this->getApplication()->getName(); + $view = id(new PHUIBigInfoView()) + ->setIcon($icon) + ->setTitle(pht('Welcome to %s', $app_name)) + ->setDescription( + pht('Create easy to remember shortcuts to images and memes.')) + ->addAction($create_button); + + return $view; + } + } diff --git a/src/applications/paste/query/PhabricatorPasteSearchEngine.php b/src/applications/paste/query/PhabricatorPasteSearchEngine.php index 38aaface64..fdf7824f07 100644 --- a/src/applications/paste/query/PhabricatorPasteSearchEngine.php +++ b/src/applications/paste/query/PhabricatorPasteSearchEngine.php @@ -202,4 +202,23 @@ final class PhabricatorPasteSearchEngine return $result; } + + protected function getNewUserBody() { + $create_button = id(new PHUIButtonView()) + ->setTag('a') + ->setText(pht('Create a Paste')) + ->setHref('/paste/create/') + ->setColor(PHUIButtonView::GREEN); + + $icon = $this->getApplication()->getFontIcon(); + $app_name = $this->getApplication()->getName(); + $view = id(new PHUIBigInfoView()) + ->setIcon($icon) + ->setTitle(pht('Welcome to %s', $app_name)) + ->setDescription( + pht('Store, share, and embed snippets of code.')) + ->addAction($create_button); + + return $view; + } } diff --git a/src/applications/pholio/application/PhabricatorPholioApplication.php b/src/applications/pholio/application/PhabricatorPholioApplication.php index 2ed1dff750..16b868b9a1 100644 --- a/src/applications/pholio/application/PhabricatorPholioApplication.php +++ b/src/applications/pholio/application/PhabricatorPholioApplication.php @@ -44,6 +44,7 @@ final class PhabricatorPholioApplication extends PhabricatorApplication { '/pholio/' => array( '(?:query/(?P[^/]+)/)?' => 'PholioMockListController', 'new/' => 'PholioMockEditController', + 'create/' => 'PholioMockEditController', 'edit/(?P\d+)/' => 'PholioMockEditController', 'archive/(?P\d+)/' => 'PholioMockArchiveController', 'comment/(?P\d+)/' => 'PholioMockCommentController', @@ -64,7 +65,7 @@ final class PhabricatorPholioApplication extends PhabricatorApplication { $item = id(new PHUIListItemView()) ->setName(pht('Pholio Mock')) ->setIcon('fa-picture-o') - ->setHref($this->getBaseURI().'new/'); + ->setHref($this->getBaseURI().'create/'); $items[] = $item; return $items; diff --git a/src/applications/pholio/controller/PholioController.php b/src/applications/pholio/controller/PholioController.php index 533945c7c3..99a73e8933 100644 --- a/src/applications/pholio/controller/PholioController.php +++ b/src/applications/pholio/controller/PholioController.php @@ -13,7 +13,7 @@ abstract class PholioController extends PhabricatorController { $crumbs->addAction( id(new PHUIListItemView()) ->setName(pht('Create Mock')) - ->setHref($this->getApplicationURI('new/')) + ->setHref($this->getApplicationURI('create/')) ->setIcon('fa-plus-square')); return $crumbs; diff --git a/src/applications/pholio/query/PholioMockSearchEngine.php b/src/applications/pholio/query/PholioMockSearchEngine.php index 05f0d08923..3c9d0b0d6b 100644 --- a/src/applications/pholio/query/PholioMockSearchEngine.php +++ b/src/applications/pholio/query/PholioMockSearchEngine.php @@ -130,4 +130,24 @@ final class PholioMockSearchEngine extends PhabricatorApplicationSearchEngine { return $result; } + protected function getNewUserBody() { + $create_button = id(new PHUIButtonView()) + ->setTag('a') + ->setText(pht('Create a Mock')) + ->setHref('/pholio/create/') + ->setColor(PHUIButtonView::GREEN); + + $icon = $this->getApplication()->getFontIcon(); + $app_name = $this->getApplication()->getName(); + $view = id(new PHUIBigInfoView()) + ->setIcon($icon) + ->setTitle(pht('Welcome to %s', $app_name)) + ->setDescription( + pht('Upload sets of images for review with revision history and '. + 'inline comments.')) + ->addAction($create_button); + + return $view; + } + } diff --git a/src/applications/phurl/query/PhabricatorPhurlURLSearchEngine.php b/src/applications/phurl/query/PhabricatorPhurlURLSearchEngine.php index 545643b6ae..ed8a336c3a 100644 --- a/src/applications/phurl/query/PhabricatorPhurlURLSearchEngine.php +++ b/src/applications/phurl/query/PhabricatorPhurlURLSearchEngine.php @@ -91,4 +91,23 @@ final class PhabricatorPhurlURLSearchEngine return $result; } + + protected function getNewUserBody() { + $create_button = id(new PHUIButtonView()) + ->setTag('a') + ->setText(pht('Shorten a URL')) + ->setHref('/phurl/url/create/') + ->setColor(PHUIButtonView::GREEN); + + $icon = $this->getApplication()->getFontIcon(); + $app_name = $this->getApplication()->getName(); + $view = id(new PHUIBigInfoView()) + ->setIcon($icon) + ->setTitle(pht('Welcome to %s', $app_name)) + ->setDescription( + pht('Create reusable, memorable, shorter URLs for easy accessibility.')) + ->addAction($create_button); + + return $view; + } } diff --git a/src/applications/ponder/query/PonderQuestionSearchEngine.php b/src/applications/ponder/query/PonderQuestionSearchEngine.php index c16c5442db..7e08a3fdf4 100644 --- a/src/applications/ponder/query/PonderQuestionSearchEngine.php +++ b/src/applications/ponder/query/PonderQuestionSearchEngine.php @@ -180,4 +180,23 @@ final class PonderQuestionSearchEngine return $result; } + protected function getNewUserBody() { + $create_button = id(new PHUIButtonView()) + ->setTag('a') + ->setText(pht('Ask a Question')) + ->setHref('/ponder/question/create/') + ->setColor(PHUIButtonView::GREEN); + + $icon = $this->getApplication()->getFontIcon(); + $app_name = $this->getApplication()->getName(); + $view = id(new PHUIBigInfoView()) + ->setIcon($icon) + ->setTitle(pht('Welcome to %s', $app_name)) + ->setDescription( + pht('A simple questions and answers application for your teams.')) + ->addAction($create_button); + + return $view; + } + } diff --git a/src/applications/slowvote/query/PhabricatorSlowvoteSearchEngine.php b/src/applications/slowvote/query/PhabricatorSlowvoteSearchEngine.php index 6605bc9ecc..d38683ee06 100644 --- a/src/applications/slowvote/query/PhabricatorSlowvoteSearchEngine.php +++ b/src/applications/slowvote/query/PhabricatorSlowvoteSearchEngine.php @@ -163,4 +163,23 @@ final class PhabricatorSlowvoteSearchEngine return $result; } + protected function getNewUserBody() { + $create_button = id(new PHUIButtonView()) + ->setTag('a') + ->setText(pht('Create a Poll')) + ->setHref('/vote/create/') + ->setColor(PHUIButtonView::GREEN); + + $icon = $this->getApplication()->getFontIcon(); + $app_name = $this->getApplication()->getName(); + $view = id(new PHUIBigInfoView()) + ->setIcon($icon) + ->setTitle(pht('Welcome to %s', $app_name)) + ->setDescription( + pht('Poll other users to help facilitate decision making.')) + ->addAction($create_button); + + return $view; + } + }