From 2992b5277a04e219537d5c09c0e010578c306d5f Mon Sep 17 00:00:00 2001 From: Chad Little Date: Sat, 2 Apr 2016 13:33:07 -0700 Subject: [PATCH] Update Diviner to modern UI Summary: Moves to `newPage`, updates UI on edit page. Test Plan: Edit a book, view a book, main, list, search. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D15585 --- .../controller/DivinerAtomController.php | 10 +++---- .../controller/DivinerBookController.php | 10 +++---- .../controller/DivinerBookEditController.php | 29 ++++++++++++------- .../controller/DivinerFindController.php | 9 +++--- .../controller/DivinerMainController.php | 10 +++---- 5 files changed, 36 insertions(+), 32 deletions(-) diff --git a/src/applications/diviner/controller/DivinerAtomController.php b/src/applications/diviner/controller/DivinerAtomController.php index 1785ae6741..bf69497b16 100644 --- a/src/applications/diviner/controller/DivinerAtomController.php +++ b/src/applications/diviner/controller/DivinerAtomController.php @@ -240,14 +240,12 @@ final class DivinerAtomController extends DivinerController { $prop_list = phutil_tag_div('phui-document-view-pro-box', $prop_list); - return $this->buildApplicationPage( - array( - $crumbs, + return $this->newPage() + ->setTitle($symbol->getTitle()) + ->setCrumbs($crumbs) + ->appendChild(array( $document, $prop_list, - ), - array( - 'title' => $symbol->getTitle(), )); } diff --git a/src/applications/diviner/controller/DivinerBookController.php b/src/applications/diviner/controller/DivinerBookController.php index 74b2a8f3d9..1aa8790ffa 100644 --- a/src/applications/diviner/controller/DivinerBookController.php +++ b/src/applications/diviner/controller/DivinerBookController.php @@ -92,13 +92,11 @@ final class DivinerBookController extends DivinerController { $document->appendChild($preface_view); $document->appendChild($out); - return $this->buildApplicationPage( - array( - $crumbs, + return $this->newPage() + ->setTitle($book->getTitle()) + ->setCrumbs($crumbs) + ->appendChild(array( $document, - ), - array( - 'title' => $book->getTitle(), )); } diff --git a/src/applications/diviner/controller/DivinerBookEditController.php b/src/applications/diviner/controller/DivinerBookEditController.php index b5c3e2dea5..2b1f90579b 100644 --- a/src/applications/diviner/controller/DivinerBookEditController.php +++ b/src/applications/diviner/controller/DivinerBookEditController.php @@ -57,8 +57,10 @@ final class DivinerBookEditController extends DivinerController { $crumbs = $this->buildApplicationCrumbs(); $crumbs->addTextCrumb(pht('Edit Basics')); + $crumbs->setBorder(true); - $title = pht('Edit %s', $book->getTitle()); + $title = pht('Edit Book: %s', $book->getTitle()); + $header_icon = 'fa-pencil'; $policies = id(new PhabricatorPolicyQuery()) ->setViewer($viewer) @@ -104,8 +106,9 @@ final class DivinerBookEditController extends DivinerController { ->setValue(pht('Save')) ->addCancelButton($view_uri)); - $object_box = id(new PHUIObjectBoxView()) - ->setHeaderText($title) + $box = id(new PHUIObjectBoxView()) + ->setHeaderText(pht('Book')) + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->setForm($form); $timeline = $this->buildTransactionTimeline( @@ -113,15 +116,21 @@ final class DivinerBookEditController extends DivinerController { new DivinerLiveBookTransactionQuery()); $timeline->setShouldTerminate(true); - return $this->buildApplicationPage( - array( - $crumbs, - $object_box, + $header = id(new PHUIHeaderView()) + ->setHeader($title) + ->setHeaderIcon($header_icon); + + $view = id(new PHUITwoColumnView()) + ->setHeader($header) + ->setFooter(array( + $box, $timeline, - ), - array( - 'title' => $title, )); + + return $this->newPage() + ->setTitle($title) + ->setCrumbs($crumbs) + ->appendChild($view); } } diff --git a/src/applications/diviner/controller/DivinerFindController.php b/src/applications/diviner/controller/DivinerFindController.php index b9e165fc1d..1bedd65b06 100644 --- a/src/applications/diviner/controller/DivinerFindController.php +++ b/src/applications/diviner/controller/DivinerFindController.php @@ -84,11 +84,12 @@ final class DivinerFindController extends DivinerController { $list = $this->renderAtomList($atoms); - return $this->buildApplicationPage( - $list, - array( - 'title' => array(pht('Find'), pht('"%s"', $query_text)), + return $this->newPage() + ->setTitle(array(pht('Find'), pht('"%s"', $query_text))) + ->appendChild(array( + $list, )); + } } diff --git a/src/applications/diviner/controller/DivinerMainController.php b/src/applications/diviner/controller/DivinerMainController.php index e85769060f..e7d179c077 100644 --- a/src/applications/diviner/controller/DivinerMainController.php +++ b/src/applications/diviner/controller/DivinerMainController.php @@ -65,13 +65,11 @@ final class DivinerMainController extends DivinerController { $document->appendChild($text); } - return $this->buildApplicationPage( - array( - $crumbs, + return $this->newPage() + ->setTitle(pht('Documentation Books')) + ->setCrumbs($crumbs) + ->appendChild(array( $document, - ), - array( - 'title' => pht('Documentation Books'), )); } }