Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/view/PhabricatorUserCardView.php
| Show First 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | protected function getTagContent() { | ||||
| $body = array(); | $body = array(); | ||||
| /* TODO: Replace with Conpherence Availability if we ship it */ | /* TODO: Replace with Conpherence Availability if we ship it */ | ||||
| $body[] = $this->addItem( | $body[] = $this->addItem( | ||||
| 'fa-user-plus', | 'fa-user-plus', | ||||
| phabricator_date($user->getDateCreated(), $viewer)); | phabricator_date($user->getDateCreated(), $viewer)); | ||||
| if (PhabricatorApplication::isClassInstalledForViewer( | $has_calendar = PhabricatorApplication::isClassInstalledForViewer( | ||||
| 'PhabricatorCalendarApplication', | 'PhabricatorCalendarApplication', | ||||
| $viewer)) { | $viewer); | ||||
| if ($has_calendar) { | |||||
| if (!$user->getIsDisabled()) { | |||||
| $body[] = $this->addItem( | $body[] = $this->addItem( | ||||
| 'fa-calendar-o', | 'fa-calendar-o', | ||||
| id(new PHUIUserAvailabilityView()) | id(new PHUIUserAvailabilityView()) | ||||
| ->setViewer($viewer) | ->setViewer($viewer) | ||||
| ->setAvailableUser($user)); | ->setAvailableUser($user)); | ||||
| } | } | ||||
| } | |||||
| $classes[] = 'project-card-image'; | $classes[] = 'project-card-image'; | ||||
| $image = phutil_tag( | $image = phutil_tag( | ||||
| 'img', | 'img', | ||||
| array( | array( | ||||
| 'src' => $picture, | 'src' => $picture, | ||||
| 'class' => implode(' ', $classes), | 'class' => implode(' ', $classes), | ||||
| )); | )); | ||||
| Show All 30 Lines | $header = phutil_tag( | ||||
| )); | )); | ||||
| $card = phutil_tag( | $card = phutil_tag( | ||||
| 'div', | 'div', | ||||
| array( | array( | ||||
| 'class' => 'project-card-inner', | 'class' => 'project-card-inner', | ||||
| ), | ), | ||||
| array( | array( | ||||
| $image, | |||||
| $header, | $header, | ||||
| $image, | |||||
| )); | )); | ||||
| return $card; | return $card; | ||||
| } | } | ||||
| private function addItem($icon, $value) { | private function addItem($icon, $value) { | ||||
| $icon = id(new PHUIIconView()) | $icon = id(new PHUIIconView()) | ||||
| ->addClass('project-card-item-icon') | ->addClass('project-card-item-icon') | ||||
| Show All 11 Lines | |||||