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:
parent
e537c76106
commit
2eeef339bf
6 changed files with 34 additions and 18 deletions
|
@ -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,
|
||||
));
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
));
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorCalendarEventViewController
|
||||
extends PhabricatorDashboardController {
|
||||
extends PhabricatorCalendarController {
|
||||
|
||||
private $id;
|
||||
|
||||
|
|
|
@ -48,9 +48,9 @@ final class PhabricatorCalendarEvent
|
|||
public function getTerseSummary(PhabricatorUser $viewer) {
|
||||
$until = phabricator_date($this->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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue