Differential D12840 Diff 30898 src/applications/conpherence/controller/ConpherenceWidgetController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conpherence/controller/ConpherenceWidgetController.php
Show First 20 Lines • Show All 212 Lines • ▼ Show 20 Lines | final class ConpherenceWidgetController extends ConpherenceController { | ||||
} | } | ||||
private function renderCalendarWidgetPaneContent() { | private function renderCalendarWidgetPaneContent() { | ||||
$user = $this->getRequest()->getUser(); | $user = $this->getRequest()->getUser(); | ||||
$conpherence = $this->getConpherence(); | $conpherence = $this->getConpherence(); | ||||
$participants = $conpherence->getParticipants(); | $participants = $conpherence->getParticipants(); | ||||
$widget_data = $conpherence->getWidgetData(); | $widget_data = $conpherence->getWidgetData(); | ||||
$statuses = $widget_data['statuses']; | |||||
// TODO: This panel is built around an outdated notion of events and isn't | |||||
// invitee-aware. | |||||
$statuses = $widget_data['events']; | |||||
$handles = $conpherence->getHandles(); | $handles = $conpherence->getHandles(); | ||||
$content = array(); | $content = array(); | ||||
$layout = id(new AphrontMultiColumnView()) | $layout = id(new AphrontMultiColumnView()) | ||||
->setFluidLayout(true); | ->setFluidLayout(true); | ||||
$timestamps = CalendarTimeUtil::getCalendarWidgetTimestamps($user); | $timestamps = CalendarTimeUtil::getCalendarWidgetTimestamps($user); | ||||
$today = $timestamps['today']; | $today = $timestamps['today']; | ||||
$epoch_stamps = $timestamps['epoch_stamps']; | $epoch_stamps = $timestamps['epoch_stamps']; | ||||
$one_day = 24 * 60 * 60; | $one_day = 24 * 60 * 60; | ||||
▲ Show 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | foreach ($epoch_stamps as $day) { | ||||
$time_str); | $time_str); | ||||
$secondary_info = pht('%s, %s', | $secondary_info = pht('%s, %s', | ||||
$handles[$status->getUserPHID()]->getName(), $epoch_range); | $handles[$status->getUserPHID()]->getName(), $epoch_range); | ||||
$content[] = phutil_tag( | $content[] = phutil_tag( | ||||
'div', | 'div', | ||||
array( | array( | ||||
'class' => 'user-status '.$status->getTextStatus().$top_border, | 'class' => 'user-status '.$top_border, | ||||
), | ), | ||||
array( | array( | ||||
phutil_tag( | phutil_tag( | ||||
'div', | 'div', | ||||
array( | array( | ||||
'class' => 'icon', | 'class' => 'icon', | ||||
), | ), | ||||
''), | ''), | ||||
phutil_tag( | phutil_tag( | ||||
'div', | 'div', | ||||
array( | array( | ||||
'class' => 'description', | 'class' => 'description', | ||||
), | ), | ||||
array( | array( | ||||
$status->getTerseSummary($user), | $status->getName(), | ||||
phutil_tag( | phutil_tag( | ||||
'div', | 'div', | ||||
array( | array( | ||||
'class' => 'participant', | 'class' => 'participant', | ||||
), | ), | ||||
$secondary_info), | $secondary_info), | ||||
)), | )), | ||||
)); | )); | ||||
Show All 15 Lines | foreach ($epoch_stamps as $day) { | ||||
$active_class = '-active'; | $active_class = '-active'; | ||||
} | } | ||||
$inner_layout = array(); | $inner_layout = array(); | ||||
foreach ($participants as $phid => $participant) { | foreach ($participants as $phid => $participant) { | ||||
$status = idx($statuses_of_the_day, $phid, false); | $status = idx($statuses_of_the_day, $phid, false); | ||||
if ($status) { | if ($status) { | ||||
$inner_layout[] = phutil_tag( | $inner_layout[] = phutil_tag( | ||||
'div', | 'div', | ||||
array( | array(), | ||||
'class' => $status->getTextStatus(), | |||||
), | |||||
''); | ''); | ||||
} else { | } else { | ||||
$inner_layout[] = phutil_tag( | $inner_layout[] = phutil_tag( | ||||
'div', | 'div', | ||||
array( | array( | ||||
'class' => 'present', | 'class' => 'present', | ||||
), | ), | ||||
''); | ''); | ||||
Show All 39 Lines |