From a22d37f44701611480f2c0bc46de6f7efcc6440a Mon Sep 17 00:00:00 2001 From: Chad Little Date: Fri, 1 Apr 2016 14:13:58 +0000 Subject: [PATCH] Update Countdown edit page for new UI Summary: Modernizes Countdown edit page Test Plan: New countdown, edit countdown Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D15558 --- .../PhabricatorCountdownEditController.php | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/applications/countdown/controller/PhabricatorCountdownEditController.php b/src/applications/countdown/controller/PhabricatorCountdownEditController.php index a6cdacc047..ea89c1591b 100644 --- a/src/applications/countdown/controller/PhabricatorCountdownEditController.php +++ b/src/applications/countdown/controller/PhabricatorCountdownEditController.php @@ -8,7 +8,6 @@ final class PhabricatorCountdownEditController $id = $request->getURIData('id'); if ($id) { - $page_title = pht('Edit Countdown'); $countdown = id(new PhabricatorCountdownQuery()) ->setViewer($viewer) ->withIDs(array($id)) @@ -28,8 +27,9 @@ final class PhabricatorCountdownEditController $countdown->getPHID(), PhabricatorProjectObjectHasProjectEdgeType::EDGECONST); $v_projects = array_reverse($v_projects); + $title = pht('Edit Countdown: %s', $countdown->getTitle()); } else { - $page_title = pht('Create Countdown'); + $title = pht('Create Countdown'); $countdown = PhabricatorCountdown::initializeNewCountdown($viewer); $date_value = AphrontFormDateControlValue::newFromEpoch( $viewer, PhabricatorTime::getNow()); @@ -116,6 +116,7 @@ final class PhabricatorCountdownEditController } $crumbs = $this->buildApplicationCrumbs(); + $crumbs->setBorder(true); $cancel_uri = '/countdown/'; if ($countdown->getID()) { @@ -123,9 +124,11 @@ final class PhabricatorCountdownEditController $crumbs->addTextCrumb('C'.$countdown->getID(), $cancel_uri); $crumbs->addTextCrumb(pht('Edit')); $submit_label = pht('Save Changes'); + $header_icon = 'fa-pencil'; } else { $crumbs->addTextCrumb(pht('Create Countdown')); $submit_label = pht('Create Countdown'); + $header_icon = 'fa-plus-square'; } $policies = id(new PhabricatorPolicyQuery()) @@ -180,16 +183,25 @@ final class PhabricatorCountdownEditController ->setValue($submit_label)); $form_box = id(new PHUIObjectBoxView()) - ->setHeaderText($page_title) + ->setHeaderText(pht('Countdown')) ->setFormErrors($errors) + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->setForm($form); + $header = id(new PHUIHeaderView()) + ->setHeader($title) + ->setHeaderIcon($header_icon); + + $view = id(new PHUITwoColumnView()) + ->setHeader($header) + ->setFooter($form_box); + return $this->newPage() - ->setTitle($page_title) + ->setTitle($title) ->setCrumbs($crumbs) ->appendChild( array( - $form_box, + $view, )); }