From 2eeef339bf01ca0e969dc140e2bf08344e17968a Mon Sep 17 00:00:00 2001 From: Chad Little Date: Mon, 17 Feb 2014 16:08:50 -0800 Subject: [PATCH] Add crumbs to calendar Summary: Crumbs everywhere. Not sure how to better format the date, let me know. Test Plan: Browse everything I can see in Calendar Reviewers: epriestley, btrahan Reviewed By: epriestley CC: Korvin, epriestley, aran Maniphest Tasks: T4440 Differential Revision: https://secure.phabricator.com/D8265 --- .../PhabricatorCalendarBrowseController.php | 5 +++++ .../PhabricatorCalendarController.php | 22 ++++++++++++++++--- ...PhabricatorCalendarEventEditController.php | 7 ++++++ ...PhabricatorCalendarEventListController.php | 12 ---------- ...PhabricatorCalendarEventViewController.php | 2 +- .../storage/PhabricatorCalendarEvent.php | 4 ++-- 6 files changed, 34 insertions(+), 18 deletions(-) diff --git a/src/applications/calendar/controller/PhabricatorCalendarBrowseController.php b/src/applications/calendar/controller/PhabricatorCalendarBrowseController.php index b384aeb58c..f10b0589ac 100644 --- a/src/applications/calendar/controller/PhabricatorCalendarBrowseController.php +++ b/src/applications/calendar/controller/PhabricatorCalendarBrowseController.php @@ -57,10 +57,15 @@ final class PhabricatorCalendarBrowseController $month_view->addEvent($event); } + $date = new DateTime("{$year}-{$month}-01"); + $crumbs = $this->buildApplicationCrumbs(); + $crumbs->addTextCrumb($date->format('F Y')); + $nav = $this->buildSideNavView(); $nav->selectFilter('/'); $nav->appendChild( array( + $crumbs, $this->getNoticeView(), $month_view, )); diff --git a/src/applications/calendar/controller/PhabricatorCalendarController.php b/src/applications/calendar/controller/PhabricatorCalendarController.php index 80d01e4a43..c9328cab2f 100644 --- a/src/applications/calendar/controller/PhabricatorCalendarController.php +++ b/src/applications/calendar/controller/PhabricatorCalendarController.php @@ -9,14 +9,30 @@ abstract class PhabricatorCalendarController extends PhabricatorController { $nav->addLabel(pht('Calendar')); $nav->addFilter('/', pht('View All')); - $nav->addFilter('event/create/', pht('New Status')); + $nav->addFilter('event/create/', pht('Create Event')); if ($status && $status->getID()) { - $nav->addFilter('event/edit/'.$status->getID().'/', pht('Edit Status')); + $nav->addFilter('event/edit/'.$status->getID().'/', pht('Edit Event')); } - $nav->addFilter('event/', pht('Upcoming Statuses')); + $nav->addFilter('event/', pht('Upcoming Events')); return $nav; } + public function buildApplicationMenu() { + return $this->buildSideNavView()->getMenu(); + } + + public function buildApplicationCrumbs() { + $crumbs = parent::buildApplicationCrumbs(); + + $crumbs->addAction( + id(new PHUIListItemView()) + ->setName(pht('Create Event')) + ->setHref($this->getApplicationURI().'event/create') + ->setIcon('create')); + + return $crumbs; + } + } diff --git a/src/applications/calendar/controller/PhabricatorCalendarEventEditController.php b/src/applications/calendar/controller/PhabricatorCalendarEventEditController.php index 4aa00de082..53ef1fc567 100644 --- a/src/applications/calendar/controller/PhabricatorCalendarEventEditController.php +++ b/src/applications/calendar/controller/PhabricatorCalendarEventEditController.php @@ -166,6 +166,8 @@ final class PhabricatorCalendarEventEditController } $form->appendChild($submit); + + $form_box = id(new PHUIObjectBoxView()) ->setHeaderText($page_title) ->setFormErrors($errors) @@ -174,8 +176,13 @@ final class PhabricatorCalendarEventEditController $nav = $this->buildSideNavView($status); $nav->selectFilter($filter); + $crumbs = $this + ->buildApplicationCrumbs() + ->addTextCrumb($page_title); + $nav->appendChild( array( + $crumbs, $form_box, )); diff --git a/src/applications/calendar/controller/PhabricatorCalendarEventListController.php b/src/applications/calendar/controller/PhabricatorCalendarEventListController.php index 0727aec39c..c33d0bcdb9 100644 --- a/src/applications/calendar/controller/PhabricatorCalendarEventListController.php +++ b/src/applications/calendar/controller/PhabricatorCalendarEventListController.php @@ -34,18 +34,6 @@ final class PhabricatorCalendarEventListController return $nav; } - public function buildApplicationCrumbs() { - $crumbs = parent::buildApplicationCrumbs(); - - $crumbs->addAction( - id(new PHUIListItemView()) - ->setIcon('create') - ->setName(pht('Create Event')) - ->setHref($this->getApplicationURI().'create/')); - - return $crumbs; - } - public function renderResultsList( array $events, PhabricatorSavedQuery $query) { diff --git a/src/applications/calendar/controller/PhabricatorCalendarEventViewController.php b/src/applications/calendar/controller/PhabricatorCalendarEventViewController.php index 1684f3cb4d..a03995f2de 100644 --- a/src/applications/calendar/controller/PhabricatorCalendarEventViewController.php +++ b/src/applications/calendar/controller/PhabricatorCalendarEventViewController.php @@ -1,7 +1,7 @@ dateTo, $viewer); if ($this->status == PhabricatorCalendarEvent::STATUS_SPORADIC) { - return 'Sporadic until '.$until; + return pht('Sporadic until %s', $until); } else { - return 'Away until '.$until; + return pht('Away until %s', $until); } }