1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-03 19:31:02 +01:00

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
This commit is contained in:
Chad Little 2014-02-17 16:08:50 -08:00
parent e537c76106
commit 2eeef339bf
6 changed files with 34 additions and 18 deletions

View file

@ -57,10 +57,15 @@ final class PhabricatorCalendarBrowseController
$month_view->addEvent($event); $month_view->addEvent($event);
} }
$date = new DateTime("{$year}-{$month}-01");
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb($date->format('F Y'));
$nav = $this->buildSideNavView(); $nav = $this->buildSideNavView();
$nav->selectFilter('/'); $nav->selectFilter('/');
$nav->appendChild( $nav->appendChild(
array( array(
$crumbs,
$this->getNoticeView(), $this->getNoticeView(),
$month_view, $month_view,
)); ));

View file

@ -9,14 +9,30 @@ abstract class PhabricatorCalendarController extends PhabricatorController {
$nav->addLabel(pht('Calendar')); $nav->addLabel(pht('Calendar'));
$nav->addFilter('/', pht('View All')); $nav->addFilter('/', pht('View All'));
$nav->addFilter('event/create/', pht('New Status')); $nav->addFilter('event/create/', pht('Create Event'));
if ($status && $status->getID()) { 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; 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;
}
} }

View file

@ -166,6 +166,8 @@ final class PhabricatorCalendarEventEditController
} }
$form->appendChild($submit); $form->appendChild($submit);
$form_box = id(new PHUIObjectBoxView()) $form_box = id(new PHUIObjectBoxView())
->setHeaderText($page_title) ->setHeaderText($page_title)
->setFormErrors($errors) ->setFormErrors($errors)
@ -174,8 +176,13 @@ final class PhabricatorCalendarEventEditController
$nav = $this->buildSideNavView($status); $nav = $this->buildSideNavView($status);
$nav->selectFilter($filter); $nav->selectFilter($filter);
$crumbs = $this
->buildApplicationCrumbs()
->addTextCrumb($page_title);
$nav->appendChild( $nav->appendChild(
array( array(
$crumbs,
$form_box, $form_box,
)); ));

View file

@ -34,18 +34,6 @@ final class PhabricatorCalendarEventListController
return $nav; 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( public function renderResultsList(
array $events, array $events,
PhabricatorSavedQuery $query) { PhabricatorSavedQuery $query) {

View file

@ -1,7 +1,7 @@
<?php <?php
final class PhabricatorCalendarEventViewController final class PhabricatorCalendarEventViewController
extends PhabricatorDashboardController { extends PhabricatorCalendarController {
private $id; private $id;

View file

@ -48,9 +48,9 @@ final class PhabricatorCalendarEvent
public function getTerseSummary(PhabricatorUser $viewer) { public function getTerseSummary(PhabricatorUser $viewer) {
$until = phabricator_date($this->dateTo, $viewer); $until = phabricator_date($this->dateTo, $viewer);
if ($this->status == PhabricatorCalendarEvent::STATUS_SPORADIC) { if ($this->status == PhabricatorCalendarEvent::STATUS_SPORADIC) {
return 'Sporadic until '.$until; return pht('Sporadic until %s', $until);
} else { } else {
return 'Away until '.$until; return pht('Away until %s', $until);
} }
} }