Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15461129
D11547.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
29 KB
Referenced Files
None
Subscribers
None
D11547.id.diff
View Options
diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -94,7 +94,7 @@
'rsrc/css/application/ponder/feed.css' => 'e62615b6',
'rsrc/css/application/ponder/post.css' => 'ebab8a70',
'rsrc/css/application/ponder/vote.css' => '8ed6ed8b',
- 'rsrc/css/application/profile/profile-view.css' => 'fddedfa1',
+ 'rsrc/css/application/profile/profile-view.css' => 'b4896815',
'rsrc/css/application/projects/project-icon.css' => 'c2ecb7f1',
'rsrc/css/application/releeph/releeph-core.css' => '9b3c5733',
'rsrc/css/application/releeph/releeph-preview-branch.css' => 'b7a6f4a5',
@@ -731,7 +731,7 @@
'phabricator-object-selector-css' => '029a133d',
'phabricator-phtize' => 'd254d646',
'phabricator-prefab' => '72da38cc',
- 'phabricator-profile-css' => 'fddedfa1',
+ 'phabricator-profile-css' => 'b4896815',
'phabricator-remarkup-css' => '0ee3d256',
'phabricator-search-results-css' => 'f240504c',
'phabricator-shaped-request' => '7cbe244b',
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -177,7 +177,6 @@
'AphrontWebpageResponse' => 'aphront/response/AphrontWebpageResponse.php',
'ArcanistConduitAPIMethod' => 'applications/arcanist/conduit/ArcanistConduitAPIMethod.php',
'ArcanistProjectInfoConduitAPIMethod' => 'applications/arcanist/conduit/ArcanistProjectInfoConduitAPIMethod.php',
- 'AuditActionMenuEventListener' => 'applications/audit/events/AuditActionMenuEventListener.php',
'AuditConduitAPIMethod' => 'applications/audit/conduit/AuditConduitAPIMethod.php',
'AuditQueryConduitAPIMethod' => 'applications/audit/conduit/AuditQueryConduitAPIMethod.php',
'AuthManageProvidersCapability' => 'applications/auth/capability/AuthManageProvidersCapability.php',
@@ -222,7 +221,6 @@
'ConduitQueryConduitAPIMethod' => 'applications/conduit/method/ConduitQueryConduitAPIMethod.php',
'ConduitSSHWorkflow' => 'applications/conduit/ssh/ConduitSSHWorkflow.php',
'ConduitTokenGarbageCollector' => 'applications/conduit/garbagecollector/ConduitTokenGarbageCollector.php',
- 'ConpherenceActionMenuEventListener' => 'applications/conpherence/events/ConpherenceActionMenuEventListener.php',
'ConpherenceConduitAPIMethod' => 'applications/conpherence/conduit/ConpherenceConduitAPIMethod.php',
'ConpherenceConfigOptions' => 'applications/conpherence/config/ConpherenceConfigOptions.php',
'ConpherenceConstants' => 'applications/conpherence/constants/ConpherenceConstants.php',
@@ -990,7 +988,6 @@
'MacroConduitAPIMethod' => 'applications/macro/conduit/MacroConduitAPIMethod.php',
'MacroCreateMemeConduitAPIMethod' => 'applications/macro/conduit/MacroCreateMemeConduitAPIMethod.php',
'MacroQueryConduitAPIMethod' => 'applications/macro/conduit/MacroQueryConduitAPIMethod.php',
- 'ManiphestActionMenuEventListener' => 'applications/maniphest/event/ManiphestActionMenuEventListener.php',
'ManiphestBatchEditController' => 'applications/maniphest/controller/ManiphestBatchEditController.php',
'ManiphestBulkEditCapability' => 'applications/maniphest/capability/ManiphestBulkEditCapability.php',
'ManiphestConduitAPIMethod' => 'applications/maniphest/conduit/ManiphestConduitAPIMethod.php',
@@ -2124,6 +2121,7 @@
'PhabricatorPeopleDisableController' => 'applications/people/controller/PhabricatorPeopleDisableController.php',
'PhabricatorPeopleEmpowerController' => 'applications/people/controller/PhabricatorPeopleEmpowerController.php',
'PhabricatorPeopleExternalPHIDType' => 'applications/people/phid/PhabricatorPeopleExternalPHIDType.php',
+ 'PhabricatorPeopleFeedController' => 'applications/people/controller/PhabricatorPeopleFeedController.php',
'PhabricatorPeopleHovercardEventListener' => 'applications/people/event/PhabricatorPeopleHovercardEventListener.php',
'PhabricatorPeopleLdapController' => 'applications/people/controller/PhabricatorPeopleLdapController.php',
'PhabricatorPeopleListController' => 'applications/people/controller/PhabricatorPeopleListController.php',
@@ -3299,7 +3297,6 @@
'AphrontWebpageResponse' => 'AphrontHTMLResponse',
'ArcanistConduitAPIMethod' => 'ConduitAPIMethod',
'ArcanistProjectInfoConduitAPIMethod' => 'ArcanistConduitAPIMethod',
- 'AuditActionMenuEventListener' => 'PhabricatorEventListener',
'AuditConduitAPIMethod' => 'ConduitAPIMethod',
'AuditQueryConduitAPIMethod' => 'AuditConduitAPIMethod',
'AuthManageProvidersCapability' => 'PhabricatorPolicyCapability',
@@ -3335,7 +3332,6 @@
'ConduitQueryConduitAPIMethod' => 'ConduitAPIMethod',
'ConduitSSHWorkflow' => 'PhabricatorSSHWorkflow',
'ConduitTokenGarbageCollector' => 'PhabricatorGarbageCollector',
- 'ConpherenceActionMenuEventListener' => 'PhabricatorEventListener',
'ConpherenceConduitAPIMethod' => 'ConduitAPIMethod',
'ConpherenceConfigOptions' => 'PhabricatorApplicationConfigOptions',
'ConpherenceController' => 'PhabricatorController',
@@ -4165,7 +4161,6 @@
'MacroConduitAPIMethod' => 'ConduitAPIMethod',
'MacroCreateMemeConduitAPIMethod' => 'MacroConduitAPIMethod',
'MacroQueryConduitAPIMethod' => 'MacroConduitAPIMethod',
- 'ManiphestActionMenuEventListener' => 'PhabricatorEventListener',
'ManiphestBatchEditController' => 'ManiphestController',
'ManiphestBulkEditCapability' => 'PhabricatorPolicyCapability',
'ManiphestConduitAPIMethod' => 'ConduitAPIMethod',
@@ -4362,7 +4357,7 @@
'PHUIObjectItemListExample' => 'PhabricatorUIExample',
'PHUIObjectItemListView' => 'AphrontTagView',
'PHUIObjectItemView' => 'AphrontTagView',
- 'PHUIPagedFormView' => 'AphrontTagView',
+ 'PHUIPagedFormView' => 'AphrontView',
'PHUIPinboardItemView' => 'AphrontView',
'PHUIPinboardView' => 'AphrontView',
'PHUIPropertyGroupView' => 'AphrontTagView',
@@ -5375,6 +5370,7 @@
'PhabricatorPeopleDisableController' => 'PhabricatorPeopleController',
'PhabricatorPeopleEmpowerController' => 'PhabricatorPeopleController',
'PhabricatorPeopleExternalPHIDType' => 'PhabricatorPHIDType',
+ 'PhabricatorPeopleFeedController' => 'PhabricatorPeopleController',
'PhabricatorPeopleHovercardEventListener' => 'PhabricatorEventListener',
'PhabricatorPeopleLdapController' => 'PhabricatorPeopleController',
'PhabricatorPeopleListController' => 'PhabricatorPeopleController',
diff --git a/src/applications/audit/application/PhabricatorAuditApplication.php b/src/applications/audit/application/PhabricatorAuditApplication.php
--- a/src/applications/audit/application/PhabricatorAuditApplication.php
+++ b/src/applications/audit/application/PhabricatorAuditApplication.php
@@ -26,12 +26,6 @@
return PhabricatorEnv::getDoclink('Audit User Guide');
}
- public function getEventListeners() {
- return array(
- new AuditActionMenuEventListener(),
- );
- }
-
public function getRoutes() {
return array(
'/audit/' => array(
diff --git a/src/applications/audit/events/AuditActionMenuEventListener.php b/src/applications/audit/events/AuditActionMenuEventListener.php
deleted file mode 100644
--- a/src/applications/audit/events/AuditActionMenuEventListener.php
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-
-final class AuditActionMenuEventListener extends PhabricatorEventListener {
-
- public function register() {
- $this->listen(PhabricatorEventType::TYPE_UI_DIDRENDERACTIONS);
- }
-
- public function handleEvent(PhutilEvent $event) {
- switch ($event->getType()) {
- case PhabricatorEventType::TYPE_UI_DIDRENDERACTIONS:
- $this->handleActionsEvent($event);
- break;
- }
- }
-
- private function handleActionsEvent(PhutilEvent $event) {
- $object = $event->getValue('object');
-
- $actions = null;
- if ($object instanceof PhabricatorUser) {
- $actions = $this->renderUserItems($event);
- }
-
- $this->addActionMenuItems($event, $actions);
- }
-
- private function renderUserItems(PhutilEvent $event) {
- if (!$this->canUseApplication($event->getUser())) {
- return null;
- }
-
- $user = $event->getValue('object');
-
- $username = phutil_escape_uri($user->getUsername());
- $view_uri = '/audit/?authors='.$username;
-
- return id(new PhabricatorActionView())
- ->setIcon('fa-check-circle-o')
- ->setName(pht('View Commits'))
- ->setHref($view_uri);
- }
-
-}
diff --git a/src/applications/conpherence/application/PhabricatorConpherenceApplication.php b/src/applications/conpherence/application/PhabricatorConpherenceApplication.php
--- a/src/applications/conpherence/application/PhabricatorConpherenceApplication.php
+++ b/src/applications/conpherence/application/PhabricatorConpherenceApplication.php
@@ -24,7 +24,6 @@
public function getEventListeners() {
return array(
- new ConpherenceActionMenuEventListener(),
new ConpherenceHovercardEventListener(),
);
}
diff --git a/src/applications/conpherence/events/ConpherenceActionMenuEventListener.php b/src/applications/conpherence/events/ConpherenceActionMenuEventListener.php
deleted file mode 100644
--- a/src/applications/conpherence/events/ConpherenceActionMenuEventListener.php
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-
-final class ConpherenceActionMenuEventListener
- extends PhabricatorEventListener {
-
- public function register() {
- $this->listen(PhabricatorEventType::TYPE_UI_DIDRENDERACTIONS);
- }
-
- public function handleEvent(PhutilEvent $event) {
- switch ($event->getType()) {
- case PhabricatorEventType::TYPE_UI_DIDRENDERACTIONS:
- $this->handleActionsEvent($event);
- break;
- }
- }
-
- private function handleActionsEvent(PhutilEvent $event) {
- $object = $event->getValue('object');
-
- $actions = null;
- if ($object instanceof PhabricatorUser) {
- $actions = $this->renderUserItems($event);
- }
-
- $this->addActionMenuItems($event, $actions);
- }
-
- private function renderUserItems(PhutilEvent $event) {
- if (!$this->canUseApplication($event->getUser())) {
- return null;
- }
-
- $user = $event->getValue('object');
- $href = '/conpherence/new/?participant='.$user->getPHID();
-
- return id(new PhabricatorActionView())
- ->setIcon('fa-envelope')
- ->setName(pht('Send Message'))
- ->setWorkflow(true)
- ->setHref($href);
- }
-
-}
diff --git a/src/applications/differential/event/DifferentialActionMenuEventListener.php b/src/applications/differential/event/DifferentialActionMenuEventListener.php
--- a/src/applications/differential/event/DifferentialActionMenuEventListener.php
+++ b/src/applications/differential/event/DifferentialActionMenuEventListener.php
@@ -19,27 +19,11 @@
$object = $event->getValue('object');
$actions = null;
- if ($object instanceof PhabricatorUser) {
- $actions = $this->renderUserItems($event);
- } else if ($object instanceof ManiphestTask) {
+ if ($object instanceof ManiphestTask) {
$actions = $this->renderTaskItems($event);
+ $this->addActionMenuItems($event, $actions);
}
- $this->addActionMenuItems($event, $actions);
- }
-
- private function renderUserItems(PhutilEvent $event) {
- if (!$this->canUseApplication($event->getUser())) {
- return null;
- }
-
- $person = $event->getValue('object');
- $href = '/differential/?authors='.$person->getUsername();
-
- return id(new PhabricatorActionView())
- ->setIcon('fa-cog')
- ->setName(pht('View Revisions'))
- ->setHref($href);
}
private function renderTaskItems(PhutilEvent $event) {
diff --git a/src/applications/maniphest/application/PhabricatorManiphestApplication.php b/src/applications/maniphest/application/PhabricatorManiphestApplication.php
--- a/src/applications/maniphest/application/PhabricatorManiphestApplication.php
+++ b/src/applications/maniphest/application/PhabricatorManiphestApplication.php
@@ -39,7 +39,6 @@
public function getEventListeners() {
return array(
new ManiphestNameIndexEventListener(),
- new ManiphestActionMenuEventListener(),
new ManiphestHovercardEventListener(),
);
}
diff --git a/src/applications/maniphest/event/ManiphestActionMenuEventListener.php b/src/applications/maniphest/event/ManiphestActionMenuEventListener.php
deleted file mode 100644
--- a/src/applications/maniphest/event/ManiphestActionMenuEventListener.php
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-
-final class ManiphestActionMenuEventListener extends PhabricatorEventListener {
-
- public function register() {
- $this->listen(PhabricatorEventType::TYPE_UI_DIDRENDERACTIONS);
- }
-
- public function handleEvent(PhutilEvent $event) {
- switch ($event->getType()) {
- case PhabricatorEventType::TYPE_UI_DIDRENDERACTIONS:
- $this->handleActionsEvent($event);
- break;
- }
- }
-
- private function handleActionsEvent(PhutilEvent $event) {
- $object = $event->getValue('object');
-
- $actions = null;
- if ($object instanceof PhabricatorUser) {
- $actions = $this->renderUserItems($event);
- }
-
- $this->addActionMenuItems($event, $actions);
- }
-
- private function renderUserItems(PhutilEvent $event) {
- if (!$this->canUseApplication($event->getUser())) {
- return null;
- }
-
- $user = $event->getValue('object');
- $phid = $user->getPHID();
- $view_uri = sprintf(
- '/maniphest/?statuses=%s&assigned=%s#R',
- implode(',', ManiphestTaskStatus::getOpenStatusConstants()),
- $phid);
-
- return id(new PhabricatorActionView())
- ->setIcon('fa-anchor')
- ->setName(pht('View Tasks'))
- ->setHref($view_uri);
- }
-
-}
diff --git a/src/applications/people/application/PhabricatorPeopleApplication.php b/src/applications/people/application/PhabricatorPeopleApplication.php
--- a/src/applications/people/application/PhabricatorPeopleApplication.php
+++ b/src/applications/people/application/PhabricatorPeopleApplication.php
@@ -62,11 +62,13 @@
'PhabricatorPeopleProfileEditController',
'picture/(?P<id>[1-9]\d*)/' =>
'PhabricatorPeopleProfilePictureController',
- ),
+ ),
'/p/(?P<username>[\w._-]+)/'
=> 'PhabricatorPeopleProfileController',
'/p/(?P<username>[\w._-]+)/calendar/'
=> 'PhabricatorPeopleCalendarController',
+ '/p/(?P<username>[\w._-]+)/feed/'
+ => 'PhabricatorPeopleFeedController',
);
}
diff --git a/src/applications/people/controller/PhabricatorPeopleCalendarController.php b/src/applications/people/controller/PhabricatorPeopleCalendarController.php
--- a/src/applications/people/controller/PhabricatorPeopleCalendarController.php
+++ b/src/applications/people/controller/PhabricatorPeopleCalendarController.php
@@ -73,17 +73,15 @@
$month_view->addEvent($event);
}
- $date = new DateTime("{$year}-{$month}-01");
- $crumbs = $this->buildApplicationCrumbs();
- $crumbs->addTextCrumb(
- $user->getUsername(),
- '/p/'.$user->getUsername().'/');
- $crumbs->addTextCrumb($date->format('F Y'));
+ $name = $user->getUsername();
+
+ $nav = $this->buildIconNavView($user);
+ $nav->selectFilter("{$name}/calendar/");
+ $nav->appendChild($month_view);
return $this->buildApplicationPage(
array(
- $crumbs,
- $month_view,
+ $nav,
),
array(
'title' => pht('Calendar'),
diff --git a/src/applications/people/controller/PhabricatorPeopleController.php b/src/applications/people/controller/PhabricatorPeopleController.php
--- a/src/applications/people/controller/PhabricatorPeopleController.php
+++ b/src/applications/people/controller/PhabricatorPeopleController.php
@@ -6,47 +6,93 @@
return true;
}
- public function buildSideNavView() {
+ public function buildSideNavView($for_app = false) {
$nav = new AphrontSideNavFilterView();
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
- $viewer = $this->getRequest()->getUser();
+ $name = null;
+ if ($for_app) {
+ $name = $this->getRequest()->getURIData('username');
+ if ($name) {
+ $nav->setBaseURI(new PhutilURI('/p/'));
+ $nav->addFilter("{$name}/", $name);
+ $nav->addFilter("feed/{$name}/", pht('Feed'));
+ $nav->addFilter("calendar/{$name}/", pht('Calendar'));
+ }
+ }
- id(new PhabricatorPeopleSearchEngine())
- ->setViewer($viewer)
- ->addNavigationItems($nav->getMenu());
+ if (!$name) {
+ $viewer = $this->getRequest()->getUser();
+ id(new PhabricatorPeopleSearchEngine())
+ ->setViewer($viewer)
+ ->addNavigationItems($nav->getMenu());
- if ($viewer->getIsAdmin()) {
- $nav->addLabel(pht('User Administration'));
- if (PhabricatorLDAPAuthProvider::getLDAPProvider()) {
- $nav->addFilter('ldap', pht('Import from LDAP'));
- }
+ if ($viewer->getIsAdmin()) {
+ $nav->addLabel(pht('User Administration'));
+ if (PhabricatorLDAPAuthProvider::getLDAPProvider()) {
+ $nav->addFilter('ldap', pht('Import from LDAP'));
+ }
- $nav->addFilter('logs', pht('Activity Logs'));
+ $nav->addFilter('logs', pht('Activity Logs'));
+ }
}
return $nav;
}
public function buildApplicationMenu() {
- return $this->buildSideNavView()->getMenu();
+ return $this->buildSideNavView(true)->getMenu();
}
protected function buildApplicationCrumbs() {
- $crumbs = parent::buildApplicationCrumbs();
+ return parent::buildApplicationCrumbs();
+ }
+
+ public function buildIconNavView(PhabricatorUser $user) {
+ $viewer = $this->getViewer();
+ $picture = $user->getProfileImageURI();
+ $name = $user->getUsername();
- $viewer = $this->getRequest()->getUser();
+ $nav = new AphrontSideNavFilterView();
+ $nav->setIconNav(true);
+ $nav->setBaseURI(new PhutilURI('/p/'));
+ $nav->addIcon("{$name}/", $name, null, $picture);
+ $nav->addIcon("{$name}/feed/", pht('Feed'), 'fa-newspaper-o');
- $can_create = $this->hasApplicationCapability(
- PeopleCreateUsersCapability::CAPABILITY);
- $crumbs->addAction(
- id(new PHUIListItemView())
- ->setName(pht('Create New User'))
- ->setHref($this->getApplicationURI('create/'))
- ->setDisabled(!$can_create)
- ->setIcon('fa-plus-square'));
+ $class = 'PhabricatorCalendarApplication';
+ if (PhabricatorApplication::isClassInstalledForViewer($class, $viewer)) {
+ $nav->addIcon(
+ "{$name}/calendar/", pht('Calendar'), 'fa-calendar');
+ }
- return $crumbs;
+ $class = 'PhabricatorManiphestApplication';
+ if (PhabricatorApplication::isClassInstalledForViewer($class, $viewer)) {
+ $phid = $user->getPHID();
+ $view_uri = sprintf(
+ '/maniphest/?statuses=%s&assigned=%s#R',
+ implode(',', ManiphestTaskStatus::getOpenStatusConstants()),
+ $phid);
+ $nav->addIcon(
+ 'maniphest', pht('Open Tasks'), 'fa-anchor', null, $view_uri);
+ }
+
+ $class = 'PhabricatorDifferentialApplication';
+ if (PhabricatorApplication::isClassInstalledForViewer($class, $viewer)) {
+ $username = phutil_escape_uri($name);
+ $view_uri = '/differential/?authors='.$username;
+ $nav->addIcon(
+ 'differential', pht('Revisions'), 'fa-cog', null, $view_uri);
+ }
+
+ $class = 'PhabricatorAuditApplication';
+ if (PhabricatorApplication::isClassInstalledForViewer($class, $viewer)) {
+ $username = phutil_escape_uri($name);
+ $view_uri = '/audit/?authors='.$username;
+ $nav->addIcon(
+ 'audit', pht('Commits'), 'fa-code', null, $view_uri);
+ }
+
+ return $nav;
}
}
diff --git a/src/applications/people/controller/PhabricatorPeopleFeedController.php b/src/applications/people/controller/PhabricatorPeopleFeedController.php
new file mode 100644
--- /dev/null
+++ b/src/applications/people/controller/PhabricatorPeopleFeedController.php
@@ -0,0 +1,60 @@
+<?php
+
+final class PhabricatorPeopleFeedController
+ extends PhabricatorPeopleController {
+
+ private $username;
+
+ public function shouldRequireAdmin() {
+ return false;
+ }
+
+ public function willProcessRequest(array $data) {
+ $this->username = idx($data, 'username');
+ }
+
+ public function processRequest() {
+ require_celerity_resource('phabricator-profile-css');
+ $viewer = $this->getRequest()->getUser();
+ $user = id(new PhabricatorPeopleQuery())
+ ->setViewer($viewer)
+ ->withUsernames(array($this->username))
+ ->needProfileImage(true)
+ ->executeOne();
+
+ if (!$user) {
+ return new Aphront404Response();
+ }
+
+ $query = new PhabricatorFeedQuery();
+ $query->setFilterPHIDs(
+ array(
+ $user->getPHID(),
+ ));
+ $query->setLimit(100);
+ $query->setViewer($viewer);
+ $stories = $query->execute();
+
+ $builder = new PhabricatorFeedBuilder($stories);
+ $builder->setUser($viewer);
+ $builder->setShowHovercards(true);
+ $view = $builder->buildView();
+
+ $feed = phutil_tag_div(
+ 'phabricator-project-feed',
+ $view->render());
+ $name = $user->getUsername();
+
+ $nav = $this->buildIconNavView($user);
+ $nav->selectFilter("{$name}/feed/");
+ $nav->appendChild($feed);
+
+ return $this->buildApplicationPage(
+ array(
+ $nav,
+ ),
+ array(
+ 'title' => pht('Feed'),
+ ));
+ }
+}
diff --git a/src/applications/people/controller/PhabricatorPeopleProfileController.php b/src/applications/people/controller/PhabricatorPeopleProfileController.php
--- a/src/applications/people/controller/PhabricatorPeopleProfileController.php
+++ b/src/applications/people/controller/PhabricatorPeopleProfileController.php
@@ -128,40 +128,37 @@
}
$properties = $this->buildPropertyView($user, $actions);
+ $name = $user->getUsername();
$crumbs = $this->buildApplicationCrumbs();
- $crumbs->addTextCrumb($user->getUsername());
-
- $feed = $this->renderUserFeed($user);
- $cal_class = 'PhabricatorCalendarApplication';
- $classes = array();
- $classes[] = 'profile-activity-view';
- if (PhabricatorApplication::isClassInstalledForViewer($cal_class, $user)) {
- $calendar = $this->renderUserCalendar($user);
- $classes[] = 'profile-has-calendar';
- $classes[] = 'grouped';
- } else {
- $calendar = null;
+ $crumbs->addTextCrumb($name);
+
+ $class = 'PhabricatorManiphestApplication';
+ if (PhabricatorApplication::isClassInstalledForViewer($class, $viewer)) {
+ $href = '/conpherence/new/?participant='.$user->getPHID();
+ $image = id(new PHUIIconView())
+ ->setIconFont('fa-comments');
+ $button = id(new PHUIButtonView())
+ ->setTag('a')
+ ->setColor(PHUIButtonView::SIMPLE)
+ ->setIcon($image)
+ ->setHref($href)
+ ->setText(pht('Send Message'))
+ ->setWorkflow(true);
+ $header->addActionLink($button);
}
- $activity = phutil_tag(
- 'div',
- array(
- 'class' => implode($classes, ' '),
- ),
- array(
- $calendar,
- $feed,
- ));
$object_box = id(new PHUIObjectBoxView())
->setHeader($header)
->addPropertyList($properties);
+ $nav = $this->buildIconNavView($user);
+ $nav->selectFilter("{$name}/");
+ $nav->appendChild($object_box);
+
return $this->buildApplicationPage(
array(
- $crumbs,
- $object_box,
- $activity,
+ $nav,
),
array(
'title' => $user->getUsername(),
@@ -186,103 +183,4 @@
return $view;
}
- private function renderUserFeed(PhabricatorUser $user) {
- $viewer = $this->getRequest()->getUser();
-
- $query = new PhabricatorFeedQuery();
- $query->setFilterPHIDs(
- array(
- $user->getPHID(),
- ));
- $query->setLimit(100);
- $query->setViewer($viewer);
- $stories = $query->execute();
-
- $builder = new PhabricatorFeedBuilder($stories);
- $builder->setUser($viewer);
- $builder->setShowHovercards(true);
- $view = $builder->buildView();
-
- return phutil_tag_div(
- 'profile-feed',
- $view->render());
- }
-
- private function renderUserCalendar(PhabricatorUser $user) {
- $viewer = $this->getRequest()->getUser();
- $epochs = CalendarTimeUtil::getCalendarEventEpochs(
- $viewer,
- 'today',
- 7);
- $start_epoch = $epochs['start_epoch'];
- $end_epoch = $epochs['end_epoch'];
- $statuses = id(new PhabricatorCalendarEventQuery())
- ->setViewer($viewer)
- ->withInvitedPHIDs(array($user->getPHID()))
- ->withDateRange($start_epoch, $end_epoch)
- ->execute();
-
- $timestamps = CalendarTimeUtil::getCalendarWeekTimestamps(
- $viewer);
- $today = $timestamps['today'];
- $epoch_stamps = $timestamps['epoch_stamps'];
- $events = array();
-
- foreach ($epoch_stamps as $day) {
- $epoch_start = $day->format('U');
- $next_day = clone $day;
- $next_day->modify('+1 day');
- $epoch_end = $next_day->format('U');
-
- foreach ($statuses as $status) {
- if ($status->getDateTo() < $epoch_start) {
- continue;
- }
- if ($status->getDateFrom() >= $epoch_end) {
- continue;
- }
-
- $event = new AphrontCalendarEventView();
- $event->setEpochRange($status->getDateFrom(), $status->getDateTo());
-
- $status_text = $status->getHumanStatus();
- $event->setUserPHID($status->getUserPHID());
- $event->setName($status_text);
- $event->setDescription($status->getDescription());
- $event->setEventID($status->getID());
- $events[$epoch_start][] = $event;
- }
- }
-
- $week = array();
- foreach ($epoch_stamps as $day) {
- $epoch = $day->format('U');
- $headertext = phabricator_format_local_time($epoch, $user, 'l, M d');
-
- $list = new PHUICalendarListView();
- $list->setUser($viewer);
- $list->showBlankState(true);
- if (isset($events[$epoch])) {
- foreach ($events[$epoch] as $event) {
- $list->addEvent($event);
- }
- }
-
- $header = phutil_tag(
- 'a',
- array(
- 'href' => $this->getRequest()->getRequestURI().'calendar/',
- ),
- $headertext);
-
- $calendar = new PHUICalendarWidgetView();
- $calendar->setHeader($header);
- $calendar->setCalendarList($list);
- $week[] = $calendar;
- }
-
- return phutil_tag_div(
- 'profile-calendar',
- $week);
- }
}
diff --git a/src/applications/people/controller/PhabricatorPeopleProfileEditController.php b/src/applications/people/controller/PhabricatorPeopleProfileEditController.php
--- a/src/applications/people/controller/PhabricatorPeopleProfileEditController.php
+++ b/src/applications/people/controller/PhabricatorPeopleProfileEditController.php
@@ -20,6 +20,7 @@
$user = id(new PhabricatorPeopleQuery())
->setViewer($viewer)
->withIDs(array($this->id))
+ ->needProfileImage(true)
->requireCapabilities(
array(
PhabricatorPolicyCapability::CAN_VIEW,
@@ -60,9 +61,6 @@
}
$title = pht('Edit Profile');
- $crumbs = $this->buildApplicationCrumbs();
- $crumbs->addTextCrumb($user->getUsername(), $profile_uri);
- $crumbs->addTextCrumb($title);
$form = id(new AphrontFormView())
->setUser($viewer);
@@ -80,10 +78,13 @@
->setValidationException($validation_exception)
->setForm($form);
+ $nav = $this->buildIconNavView($user);
+ $nav->selectFilter('/');
+ $nav->appendChild($form_box);
+
return $this->buildApplicationPage(
array(
- $crumbs,
- $form_box,
+ $nav,
),
array(
'title' => $title,
diff --git a/src/applications/people/controller/PhabricatorPeopleProfilePictureController.php b/src/applications/people/controller/PhabricatorPeopleProfilePictureController.php
--- a/src/applications/people/controller/PhabricatorPeopleProfilePictureController.php
+++ b/src/applications/people/controller/PhabricatorPeopleProfilePictureController.php
@@ -20,6 +20,7 @@
$user = id(new PhabricatorPeopleQuery())
->setViewer($viewer)
->withIDs(array($this->id))
+ ->needProfileImage(true)
->requireCapabilities(
array(
PhabricatorPolicyCapability::CAN_VIEW,
@@ -91,9 +92,6 @@
}
$title = pht('Edit Profile Picture');
- $crumbs = $this->buildApplicationCrumbs();
- $crumbs->addTextCrumb($user->getUsername(), $profile_uri);
- $crumbs->addTextCrumb($title);
$form = id(new PHUIFormLayoutView())
->setUser($viewer);
@@ -242,11 +240,14 @@
->setHeaderText(pht('Upload New Picture'))
->setForm($upload_form);
+ $nav = $this->buildIconNavView($user);
+ $nav->selectFilter('/');
+ $nav->appendChild($form_box);
+ $nav->appendChild($upload_box);
+
return $this->buildApplicationPage(
array(
- $crumbs,
- $form_box,
- $upload_box,
+ $nav,
),
array(
'title' => $title,
diff --git a/webroot/rsrc/css/application/profile/profile-view.css b/webroot/rsrc/css/application/profile/profile-view.css
--- a/webroot/rsrc/css/application/profile/profile-view.css
+++ b/webroot/rsrc/css/application/profile/profile-view.css
@@ -33,15 +33,6 @@
margin-left: 16px;
}
-.profile-activity-view.profile-has-calendar .profile-feed {
- margin-left: 332px;
-}
-
-.device-phone .profile-activity-view .profile-calendar {
- float: none;
- margin: 0 8px;
-}
-
.device-phone .profile-activity-view .profile-feed {
float: none;
margin: 0 8px;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 2, 5:30 AM (3 d, 20 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7335197
Default Alt Text
D11547.id.diff (29 KB)
Attached To
Mode
D11547: Revamp Profile with new IconNav
Attached
Detach File
Event Timeline
Log In to Comment