1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-20 12:30:56 +01:00

Update Calendar Edit for new UI

Summary: Updates Calendar Edit UI with new header layout

Test Plan: New Event, Public, Recurring, Edit Event

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D15567
This commit is contained in:
Chad Little 2016-04-01 13:40:29 -07:00
parent 61301ead90
commit 1f107b8fe0

View file

@ -69,7 +69,8 @@ final class PhabricatorCalendarEventEditController
$recurrence_end_date_value->setOptional(true); $recurrence_end_date_value->setOptional(true);
$submit_label = pht('Create'); $submit_label = pht('Create');
$page_title = pht('Create Event'); $title = pht('Create Event');
$header_icon = 'fa-plus-square';
$redirect = 'created'; $redirect = 'created';
$subscribers = array(); $subscribers = array();
$invitees = array($user_phid); $invitees = array($user_phid);
@ -121,7 +122,8 @@ final class PhabricatorCalendarEventEditController
->setOptional(true); ->setOptional(true);
$submit_label = pht('Update'); $submit_label = pht('Update');
$page_title = pht('Update Event'); $title = pht('Edit Event: %s', $event->getName());
$header_icon = 'fa-pencil';
$subscribers = PhabricatorSubscribersQuery::loadSubscribersForPHID( $subscribers = PhabricatorSubscribersQuery::loadSubscribersForPHID(
$event->getPHID()); $event->getPHID());
@ -540,7 +542,7 @@ final class PhabricatorCalendarEventEditController
if ($request->isAjax()) { if ($request->isAjax()) {
return $this->newDialog() return $this->newDialog()
->setTitle($page_title) ->setTitle($title)
->setWidth(AphrontDialogView::WIDTH_FULL) ->setWidth(AphrontDialogView::WIDTH_FULL)
->appendForm($form) ->appendForm($form)
->addCancelButton($cancel_uri) ->addCancelButton($cancel_uri)
@ -554,30 +556,35 @@ final class PhabricatorCalendarEventEditController
$form->appendChild($submit); $form->appendChild($submit);
$form_box = id(new PHUIObjectBoxView()) $form_box = id(new PHUIObjectBoxView())
->setHeaderText($page_title) ->setHeaderText(pht('Event'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setValidationException($validation_exception)
->setForm($form); ->setForm($form);
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
if (!$this->isCreate()) { if (!$this->isCreate()) {
$crumbs->addTextCrumb('E'.$event->getId(), '/E'.$event->getId()); $crumbs->addTextCrumb('E'.$event->getId(), '/E'.$event->getId());
$crumb_title = pht('Edit Event');
} else {
$crumb_title = pht('Create Event');
} }
$crumbs->addTextCrumb($page_title); $crumbs->addTextCrumb($crumb_title);
$crumbs->setBorder(true);
$object_box = id(new PHUIObjectBoxView()) $header = id(new PHUIHeaderView())
->setHeaderText($page_title) ->setHeader($title)
->setValidationException($validation_exception) ->setHeaderIcon($header_icon);
->appendChild($form);
return $this->buildApplicationPage( $view = id(new PHUITwoColumnView())
array( ->setHeader($header)
$crumbs, ->setFooter($form_box);
$object_box,
), return $this->newPage()
array( ->setTitle($title)
'title' => $page_title, ->setCrumbs($crumbs)
)); ->appendChild($view);
} }