mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Revamp Profile with new IconNav
Summary: Revamps Profile to be like Projects, a mini portal and side nav with icons. Test Plan: Viewed my own profile, as well as others. Test seeing my commits, tasks, diffs, and upcoming events. Checked mobile navigation. Reviewers: btrahan, epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Differential Revision: https://secure.phabricator.com/D11547
This commit is contained in:
parent
7982b23eb4
commit
8f1e0c0262
17 changed files with 179 additions and 344 deletions
|
@ -94,7 +94,7 @@ return array(
|
||||||
'rsrc/css/application/ponder/feed.css' => 'e62615b6',
|
'rsrc/css/application/ponder/feed.css' => 'e62615b6',
|
||||||
'rsrc/css/application/ponder/post.css' => 'ebab8a70',
|
'rsrc/css/application/ponder/post.css' => 'ebab8a70',
|
||||||
'rsrc/css/application/ponder/vote.css' => '8ed6ed8b',
|
'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/projects/project-icon.css' => 'c2ecb7f1',
|
||||||
'rsrc/css/application/releeph/releeph-core.css' => '9b3c5733',
|
'rsrc/css/application/releeph/releeph-core.css' => '9b3c5733',
|
||||||
'rsrc/css/application/releeph/releeph-preview-branch.css' => 'b7a6f4a5',
|
'rsrc/css/application/releeph/releeph-preview-branch.css' => 'b7a6f4a5',
|
||||||
|
@ -731,7 +731,7 @@ return array(
|
||||||
'phabricator-object-selector-css' => '029a133d',
|
'phabricator-object-selector-css' => '029a133d',
|
||||||
'phabricator-phtize' => 'd254d646',
|
'phabricator-phtize' => 'd254d646',
|
||||||
'phabricator-prefab' => '72da38cc',
|
'phabricator-prefab' => '72da38cc',
|
||||||
'phabricator-profile-css' => 'fddedfa1',
|
'phabricator-profile-css' => 'b4896815',
|
||||||
'phabricator-remarkup-css' => '0ee3d256',
|
'phabricator-remarkup-css' => '0ee3d256',
|
||||||
'phabricator-search-results-css' => 'f240504c',
|
'phabricator-search-results-css' => 'f240504c',
|
||||||
'phabricator-shaped-request' => '7cbe244b',
|
'phabricator-shaped-request' => '7cbe244b',
|
||||||
|
|
|
@ -177,7 +177,6 @@ phutil_register_library_map(array(
|
||||||
'AphrontWebpageResponse' => 'aphront/response/AphrontWebpageResponse.php',
|
'AphrontWebpageResponse' => 'aphront/response/AphrontWebpageResponse.php',
|
||||||
'ArcanistConduitAPIMethod' => 'applications/arcanist/conduit/ArcanistConduitAPIMethod.php',
|
'ArcanistConduitAPIMethod' => 'applications/arcanist/conduit/ArcanistConduitAPIMethod.php',
|
||||||
'ArcanistProjectInfoConduitAPIMethod' => 'applications/arcanist/conduit/ArcanistProjectInfoConduitAPIMethod.php',
|
'ArcanistProjectInfoConduitAPIMethod' => 'applications/arcanist/conduit/ArcanistProjectInfoConduitAPIMethod.php',
|
||||||
'AuditActionMenuEventListener' => 'applications/audit/events/AuditActionMenuEventListener.php',
|
|
||||||
'AuditConduitAPIMethod' => 'applications/audit/conduit/AuditConduitAPIMethod.php',
|
'AuditConduitAPIMethod' => 'applications/audit/conduit/AuditConduitAPIMethod.php',
|
||||||
'AuditQueryConduitAPIMethod' => 'applications/audit/conduit/AuditQueryConduitAPIMethod.php',
|
'AuditQueryConduitAPIMethod' => 'applications/audit/conduit/AuditQueryConduitAPIMethod.php',
|
||||||
'AuthManageProvidersCapability' => 'applications/auth/capability/AuthManageProvidersCapability.php',
|
'AuthManageProvidersCapability' => 'applications/auth/capability/AuthManageProvidersCapability.php',
|
||||||
|
@ -222,7 +221,6 @@ phutil_register_library_map(array(
|
||||||
'ConduitQueryConduitAPIMethod' => 'applications/conduit/method/ConduitQueryConduitAPIMethod.php',
|
'ConduitQueryConduitAPIMethod' => 'applications/conduit/method/ConduitQueryConduitAPIMethod.php',
|
||||||
'ConduitSSHWorkflow' => 'applications/conduit/ssh/ConduitSSHWorkflow.php',
|
'ConduitSSHWorkflow' => 'applications/conduit/ssh/ConduitSSHWorkflow.php',
|
||||||
'ConduitTokenGarbageCollector' => 'applications/conduit/garbagecollector/ConduitTokenGarbageCollector.php',
|
'ConduitTokenGarbageCollector' => 'applications/conduit/garbagecollector/ConduitTokenGarbageCollector.php',
|
||||||
'ConpherenceActionMenuEventListener' => 'applications/conpherence/events/ConpherenceActionMenuEventListener.php',
|
|
||||||
'ConpherenceConduitAPIMethod' => 'applications/conpherence/conduit/ConpherenceConduitAPIMethod.php',
|
'ConpherenceConduitAPIMethod' => 'applications/conpherence/conduit/ConpherenceConduitAPIMethod.php',
|
||||||
'ConpherenceConfigOptions' => 'applications/conpherence/config/ConpherenceConfigOptions.php',
|
'ConpherenceConfigOptions' => 'applications/conpherence/config/ConpherenceConfigOptions.php',
|
||||||
'ConpherenceConstants' => 'applications/conpherence/constants/ConpherenceConstants.php',
|
'ConpherenceConstants' => 'applications/conpherence/constants/ConpherenceConstants.php',
|
||||||
|
@ -990,7 +988,6 @@ phutil_register_library_map(array(
|
||||||
'MacroConduitAPIMethod' => 'applications/macro/conduit/MacroConduitAPIMethod.php',
|
'MacroConduitAPIMethod' => 'applications/macro/conduit/MacroConduitAPIMethod.php',
|
||||||
'MacroCreateMemeConduitAPIMethod' => 'applications/macro/conduit/MacroCreateMemeConduitAPIMethod.php',
|
'MacroCreateMemeConduitAPIMethod' => 'applications/macro/conduit/MacroCreateMemeConduitAPIMethod.php',
|
||||||
'MacroQueryConduitAPIMethod' => 'applications/macro/conduit/MacroQueryConduitAPIMethod.php',
|
'MacroQueryConduitAPIMethod' => 'applications/macro/conduit/MacroQueryConduitAPIMethod.php',
|
||||||
'ManiphestActionMenuEventListener' => 'applications/maniphest/event/ManiphestActionMenuEventListener.php',
|
|
||||||
'ManiphestBatchEditController' => 'applications/maniphest/controller/ManiphestBatchEditController.php',
|
'ManiphestBatchEditController' => 'applications/maniphest/controller/ManiphestBatchEditController.php',
|
||||||
'ManiphestBulkEditCapability' => 'applications/maniphest/capability/ManiphestBulkEditCapability.php',
|
'ManiphestBulkEditCapability' => 'applications/maniphest/capability/ManiphestBulkEditCapability.php',
|
||||||
'ManiphestConduitAPIMethod' => 'applications/maniphest/conduit/ManiphestConduitAPIMethod.php',
|
'ManiphestConduitAPIMethod' => 'applications/maniphest/conduit/ManiphestConduitAPIMethod.php',
|
||||||
|
@ -2124,6 +2121,7 @@ phutil_register_library_map(array(
|
||||||
'PhabricatorPeopleDisableController' => 'applications/people/controller/PhabricatorPeopleDisableController.php',
|
'PhabricatorPeopleDisableController' => 'applications/people/controller/PhabricatorPeopleDisableController.php',
|
||||||
'PhabricatorPeopleEmpowerController' => 'applications/people/controller/PhabricatorPeopleEmpowerController.php',
|
'PhabricatorPeopleEmpowerController' => 'applications/people/controller/PhabricatorPeopleEmpowerController.php',
|
||||||
'PhabricatorPeopleExternalPHIDType' => 'applications/people/phid/PhabricatorPeopleExternalPHIDType.php',
|
'PhabricatorPeopleExternalPHIDType' => 'applications/people/phid/PhabricatorPeopleExternalPHIDType.php',
|
||||||
|
'PhabricatorPeopleFeedController' => 'applications/people/controller/PhabricatorPeopleFeedController.php',
|
||||||
'PhabricatorPeopleHovercardEventListener' => 'applications/people/event/PhabricatorPeopleHovercardEventListener.php',
|
'PhabricatorPeopleHovercardEventListener' => 'applications/people/event/PhabricatorPeopleHovercardEventListener.php',
|
||||||
'PhabricatorPeopleLdapController' => 'applications/people/controller/PhabricatorPeopleLdapController.php',
|
'PhabricatorPeopleLdapController' => 'applications/people/controller/PhabricatorPeopleLdapController.php',
|
||||||
'PhabricatorPeopleListController' => 'applications/people/controller/PhabricatorPeopleListController.php',
|
'PhabricatorPeopleListController' => 'applications/people/controller/PhabricatorPeopleListController.php',
|
||||||
|
@ -3299,7 +3297,6 @@ phutil_register_library_map(array(
|
||||||
'AphrontWebpageResponse' => 'AphrontHTMLResponse',
|
'AphrontWebpageResponse' => 'AphrontHTMLResponse',
|
||||||
'ArcanistConduitAPIMethod' => 'ConduitAPIMethod',
|
'ArcanistConduitAPIMethod' => 'ConduitAPIMethod',
|
||||||
'ArcanistProjectInfoConduitAPIMethod' => 'ArcanistConduitAPIMethod',
|
'ArcanistProjectInfoConduitAPIMethod' => 'ArcanistConduitAPIMethod',
|
||||||
'AuditActionMenuEventListener' => 'PhabricatorEventListener',
|
|
||||||
'AuditConduitAPIMethod' => 'ConduitAPIMethod',
|
'AuditConduitAPIMethod' => 'ConduitAPIMethod',
|
||||||
'AuditQueryConduitAPIMethod' => 'AuditConduitAPIMethod',
|
'AuditQueryConduitAPIMethod' => 'AuditConduitAPIMethod',
|
||||||
'AuthManageProvidersCapability' => 'PhabricatorPolicyCapability',
|
'AuthManageProvidersCapability' => 'PhabricatorPolicyCapability',
|
||||||
|
@ -3335,7 +3332,6 @@ phutil_register_library_map(array(
|
||||||
'ConduitQueryConduitAPIMethod' => 'ConduitAPIMethod',
|
'ConduitQueryConduitAPIMethod' => 'ConduitAPIMethod',
|
||||||
'ConduitSSHWorkflow' => 'PhabricatorSSHWorkflow',
|
'ConduitSSHWorkflow' => 'PhabricatorSSHWorkflow',
|
||||||
'ConduitTokenGarbageCollector' => 'PhabricatorGarbageCollector',
|
'ConduitTokenGarbageCollector' => 'PhabricatorGarbageCollector',
|
||||||
'ConpherenceActionMenuEventListener' => 'PhabricatorEventListener',
|
|
||||||
'ConpherenceConduitAPIMethod' => 'ConduitAPIMethod',
|
'ConpherenceConduitAPIMethod' => 'ConduitAPIMethod',
|
||||||
'ConpherenceConfigOptions' => 'PhabricatorApplicationConfigOptions',
|
'ConpherenceConfigOptions' => 'PhabricatorApplicationConfigOptions',
|
||||||
'ConpherenceController' => 'PhabricatorController',
|
'ConpherenceController' => 'PhabricatorController',
|
||||||
|
@ -4165,7 +4161,6 @@ phutil_register_library_map(array(
|
||||||
'MacroConduitAPIMethod' => 'ConduitAPIMethod',
|
'MacroConduitAPIMethod' => 'ConduitAPIMethod',
|
||||||
'MacroCreateMemeConduitAPIMethod' => 'MacroConduitAPIMethod',
|
'MacroCreateMemeConduitAPIMethod' => 'MacroConduitAPIMethod',
|
||||||
'MacroQueryConduitAPIMethod' => 'MacroConduitAPIMethod',
|
'MacroQueryConduitAPIMethod' => 'MacroConduitAPIMethod',
|
||||||
'ManiphestActionMenuEventListener' => 'PhabricatorEventListener',
|
|
||||||
'ManiphestBatchEditController' => 'ManiphestController',
|
'ManiphestBatchEditController' => 'ManiphestController',
|
||||||
'ManiphestBulkEditCapability' => 'PhabricatorPolicyCapability',
|
'ManiphestBulkEditCapability' => 'PhabricatorPolicyCapability',
|
||||||
'ManiphestConduitAPIMethod' => 'ConduitAPIMethod',
|
'ManiphestConduitAPIMethod' => 'ConduitAPIMethod',
|
||||||
|
@ -4362,7 +4357,7 @@ phutil_register_library_map(array(
|
||||||
'PHUIObjectItemListExample' => 'PhabricatorUIExample',
|
'PHUIObjectItemListExample' => 'PhabricatorUIExample',
|
||||||
'PHUIObjectItemListView' => 'AphrontTagView',
|
'PHUIObjectItemListView' => 'AphrontTagView',
|
||||||
'PHUIObjectItemView' => 'AphrontTagView',
|
'PHUIObjectItemView' => 'AphrontTagView',
|
||||||
'PHUIPagedFormView' => 'AphrontTagView',
|
'PHUIPagedFormView' => 'AphrontView',
|
||||||
'PHUIPinboardItemView' => 'AphrontView',
|
'PHUIPinboardItemView' => 'AphrontView',
|
||||||
'PHUIPinboardView' => 'AphrontView',
|
'PHUIPinboardView' => 'AphrontView',
|
||||||
'PHUIPropertyGroupView' => 'AphrontTagView',
|
'PHUIPropertyGroupView' => 'AphrontTagView',
|
||||||
|
@ -5375,6 +5370,7 @@ phutil_register_library_map(array(
|
||||||
'PhabricatorPeopleDisableController' => 'PhabricatorPeopleController',
|
'PhabricatorPeopleDisableController' => 'PhabricatorPeopleController',
|
||||||
'PhabricatorPeopleEmpowerController' => 'PhabricatorPeopleController',
|
'PhabricatorPeopleEmpowerController' => 'PhabricatorPeopleController',
|
||||||
'PhabricatorPeopleExternalPHIDType' => 'PhabricatorPHIDType',
|
'PhabricatorPeopleExternalPHIDType' => 'PhabricatorPHIDType',
|
||||||
|
'PhabricatorPeopleFeedController' => 'PhabricatorPeopleController',
|
||||||
'PhabricatorPeopleHovercardEventListener' => 'PhabricatorEventListener',
|
'PhabricatorPeopleHovercardEventListener' => 'PhabricatorEventListener',
|
||||||
'PhabricatorPeopleLdapController' => 'PhabricatorPeopleController',
|
'PhabricatorPeopleLdapController' => 'PhabricatorPeopleController',
|
||||||
'PhabricatorPeopleListController' => 'PhabricatorPeopleController',
|
'PhabricatorPeopleListController' => 'PhabricatorPeopleController',
|
||||||
|
|
|
@ -26,12 +26,6 @@ final class PhabricatorAuditApplication extends PhabricatorApplication {
|
||||||
return PhabricatorEnv::getDoclink('Audit User Guide');
|
return PhabricatorEnv::getDoclink('Audit User Guide');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getEventListeners() {
|
|
||||||
return array(
|
|
||||||
new AuditActionMenuEventListener(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getRoutes() {
|
public function getRoutes() {
|
||||||
return array(
|
return array(
|
||||||
'/audit/' => array(
|
'/audit/' => array(
|
||||||
|
|
|
@ -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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -24,7 +24,6 @@ final class PhabricatorConpherenceApplication extends PhabricatorApplication {
|
||||||
|
|
||||||
public function getEventListeners() {
|
public function getEventListeners() {
|
||||||
return array(
|
return array(
|
||||||
new ConpherenceActionMenuEventListener(),
|
|
||||||
new ConpherenceHovercardEventListener(),
|
new ConpherenceHovercardEventListener(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -19,27 +19,11 @@ final class DifferentialActionMenuEventListener
|
||||||
$object = $event->getValue('object');
|
$object = $event->getValue('object');
|
||||||
|
|
||||||
$actions = null;
|
$actions = null;
|
||||||
if ($object instanceof PhabricatorUser) {
|
if ($object instanceof ManiphestTask) {
|
||||||
$actions = $this->renderUserItems($event);
|
|
||||||
} else if ($object instanceof ManiphestTask) {
|
|
||||||
$actions = $this->renderTaskItems($event);
|
$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) {
|
private function renderTaskItems(PhutilEvent $event) {
|
||||||
|
|
|
@ -39,7 +39,6 @@ final class PhabricatorManiphestApplication extends PhabricatorApplication {
|
||||||
public function getEventListeners() {
|
public function getEventListeners() {
|
||||||
return array(
|
return array(
|
||||||
new ManiphestNameIndexEventListener(),
|
new ManiphestNameIndexEventListener(),
|
||||||
new ManiphestActionMenuEventListener(),
|
|
||||||
new ManiphestHovercardEventListener(),
|
new ManiphestHovercardEventListener(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -62,11 +62,13 @@ final class PhabricatorPeopleApplication extends PhabricatorApplication {
|
||||||
'PhabricatorPeopleProfileEditController',
|
'PhabricatorPeopleProfileEditController',
|
||||||
'picture/(?P<id>[1-9]\d*)/' =>
|
'picture/(?P<id>[1-9]\d*)/' =>
|
||||||
'PhabricatorPeopleProfilePictureController',
|
'PhabricatorPeopleProfilePictureController',
|
||||||
),
|
),
|
||||||
'/p/(?P<username>[\w._-]+)/'
|
'/p/(?P<username>[\w._-]+)/'
|
||||||
=> 'PhabricatorPeopleProfileController',
|
=> 'PhabricatorPeopleProfileController',
|
||||||
'/p/(?P<username>[\w._-]+)/calendar/'
|
'/p/(?P<username>[\w._-]+)/calendar/'
|
||||||
=> 'PhabricatorPeopleCalendarController',
|
=> 'PhabricatorPeopleCalendarController',
|
||||||
|
'/p/(?P<username>[\w._-]+)/feed/'
|
||||||
|
=> 'PhabricatorPeopleFeedController',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,17 +73,15 @@ final class PhabricatorPeopleCalendarController
|
||||||
$month_view->addEvent($event);
|
$month_view->addEvent($event);
|
||||||
}
|
}
|
||||||
|
|
||||||
$date = new DateTime("{$year}-{$month}-01");
|
$name = $user->getUsername();
|
||||||
$crumbs = $this->buildApplicationCrumbs();
|
|
||||||
$crumbs->addTextCrumb(
|
$nav = $this->buildIconNavView($user);
|
||||||
$user->getUsername(),
|
$nav->selectFilter("{$name}/calendar/");
|
||||||
'/p/'.$user->getUsername().'/');
|
$nav->appendChild($month_view);
|
||||||
$crumbs->addTextCrumb($date->format('F Y'));
|
|
||||||
|
|
||||||
return $this->buildApplicationPage(
|
return $this->buildApplicationPage(
|
||||||
array(
|
array(
|
||||||
$crumbs,
|
$nav,
|
||||||
$month_view,
|
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'title' => pht('Calendar'),
|
'title' => pht('Calendar'),
|
||||||
|
|
|
@ -6,47 +6,93 @@ abstract class PhabricatorPeopleController extends PhabricatorController {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildSideNavView() {
|
public function buildSideNavView($for_app = false) {
|
||||||
$nav = new AphrontSideNavFilterView();
|
$nav = new AphrontSideNavFilterView();
|
||||||
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
|
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
|
||||||
|
|
||||||
$viewer = $this->getRequest()->getUser();
|
$name = null;
|
||||||
|
if ($for_app) {
|
||||||
id(new PhabricatorPeopleSearchEngine())
|
$name = $this->getRequest()->getURIData('username');
|
||||||
->setViewer($viewer)
|
if ($name) {
|
||||||
->addNavigationItems($nav->getMenu());
|
$nav->setBaseURI(new PhutilURI('/p/'));
|
||||||
|
$nav->addFilter("{$name}/", $name);
|
||||||
if ($viewer->getIsAdmin()) {
|
$nav->addFilter("feed/{$name}/", pht('Feed'));
|
||||||
$nav->addLabel(pht('User Administration'));
|
$nav->addFilter("calendar/{$name}/", pht('Calendar'));
|
||||||
if (PhabricatorLDAPAuthProvider::getLDAPProvider()) {
|
|
||||||
$nav->addFilter('ldap', pht('Import from LDAP'));
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$nav->addFilter('logs', pht('Activity Logs'));
|
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'));
|
||||||
|
}
|
||||||
|
|
||||||
|
$nav->addFilter('logs', pht('Activity Logs'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $nav;
|
return $nav;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildApplicationMenu() {
|
public function buildApplicationMenu() {
|
||||||
return $this->buildSideNavView()->getMenu();
|
return $this->buildSideNavView(true)->getMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function buildApplicationCrumbs() {
|
protected function buildApplicationCrumbs() {
|
||||||
$crumbs = parent::buildApplicationCrumbs();
|
return parent::buildApplicationCrumbs();
|
||||||
|
}
|
||||||
|
|
||||||
$viewer = $this->getRequest()->getUser();
|
public function buildIconNavView(PhabricatorUser $user) {
|
||||||
|
$viewer = $this->getViewer();
|
||||||
|
$picture = $user->getProfileImageURI();
|
||||||
|
$name = $user->getUsername();
|
||||||
|
|
||||||
$can_create = $this->hasApplicationCapability(
|
$nav = new AphrontSideNavFilterView();
|
||||||
PeopleCreateUsersCapability::CAPABILITY);
|
$nav->setIconNav(true);
|
||||||
$crumbs->addAction(
|
$nav->setBaseURI(new PhutilURI('/p/'));
|
||||||
id(new PHUIListItemView())
|
$nav->addIcon("{$name}/", $name, null, $picture);
|
||||||
->setName(pht('Create New User'))
|
$nav->addIcon("{$name}/feed/", pht('Feed'), 'fa-newspaper-o');
|
||||||
->setHref($this->getApplicationURI('create/'))
|
|
||||||
->setDisabled(!$can_create)
|
|
||||||
->setIcon('fa-plus-square'));
|
|
||||||
|
|
||||||
return $crumbs;
|
$class = 'PhabricatorCalendarApplication';
|
||||||
|
if (PhabricatorApplication::isClassInstalledForViewer($class, $viewer)) {
|
||||||
|
$nav->addIcon(
|
||||||
|
"{$name}/calendar/", pht('Calendar'), 'fa-calendar');
|
||||||
|
}
|
||||||
|
|
||||||
|
$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;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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'),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
|
@ -128,40 +128,37 @@ final class PhabricatorPeopleProfileController
|
||||||
}
|
}
|
||||||
|
|
||||||
$properties = $this->buildPropertyView($user, $actions);
|
$properties = $this->buildPropertyView($user, $actions);
|
||||||
|
$name = $user->getUsername();
|
||||||
|
|
||||||
$crumbs = $this->buildApplicationCrumbs();
|
$crumbs = $this->buildApplicationCrumbs();
|
||||||
$crumbs->addTextCrumb($user->getUsername());
|
$crumbs->addTextCrumb($name);
|
||||||
|
|
||||||
$feed = $this->renderUserFeed($user);
|
$class = 'PhabricatorManiphestApplication';
|
||||||
$cal_class = 'PhabricatorCalendarApplication';
|
if (PhabricatorApplication::isClassInstalledForViewer($class, $viewer)) {
|
||||||
$classes = array();
|
$href = '/conpherence/new/?participant='.$user->getPHID();
|
||||||
$classes[] = 'profile-activity-view';
|
$image = id(new PHUIIconView())
|
||||||
if (PhabricatorApplication::isClassInstalledForViewer($cal_class, $user)) {
|
->setIconFont('fa-comments');
|
||||||
$calendar = $this->renderUserCalendar($user);
|
$button = id(new PHUIButtonView())
|
||||||
$classes[] = 'profile-has-calendar';
|
->setTag('a')
|
||||||
$classes[] = 'grouped';
|
->setColor(PHUIButtonView::SIMPLE)
|
||||||
} else {
|
->setIcon($image)
|
||||||
$calendar = null;
|
->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())
|
$object_box = id(new PHUIObjectBoxView())
|
||||||
->setHeader($header)
|
->setHeader($header)
|
||||||
->addPropertyList($properties);
|
->addPropertyList($properties);
|
||||||
|
|
||||||
|
$nav = $this->buildIconNavView($user);
|
||||||
|
$nav->selectFilter("{$name}/");
|
||||||
|
$nav->appendChild($object_box);
|
||||||
|
|
||||||
return $this->buildApplicationPage(
|
return $this->buildApplicationPage(
|
||||||
array(
|
array(
|
||||||
$crumbs,
|
$nav,
|
||||||
$object_box,
|
|
||||||
$activity,
|
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'title' => $user->getUsername(),
|
'title' => $user->getUsername(),
|
||||||
|
@ -186,103 +183,4 @@ final class PhabricatorPeopleProfileController
|
||||||
return $view;
|
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@ final class PhabricatorPeopleProfileEditController
|
||||||
$user = id(new PhabricatorPeopleQuery())
|
$user = id(new PhabricatorPeopleQuery())
|
||||||
->setViewer($viewer)
|
->setViewer($viewer)
|
||||||
->withIDs(array($this->id))
|
->withIDs(array($this->id))
|
||||||
|
->needProfileImage(true)
|
||||||
->requireCapabilities(
|
->requireCapabilities(
|
||||||
array(
|
array(
|
||||||
PhabricatorPolicyCapability::CAN_VIEW,
|
PhabricatorPolicyCapability::CAN_VIEW,
|
||||||
|
@ -60,9 +61,6 @@ final class PhabricatorPeopleProfileEditController
|
||||||
}
|
}
|
||||||
|
|
||||||
$title = pht('Edit Profile');
|
$title = pht('Edit Profile');
|
||||||
$crumbs = $this->buildApplicationCrumbs();
|
|
||||||
$crumbs->addTextCrumb($user->getUsername(), $profile_uri);
|
|
||||||
$crumbs->addTextCrumb($title);
|
|
||||||
|
|
||||||
$form = id(new AphrontFormView())
|
$form = id(new AphrontFormView())
|
||||||
->setUser($viewer);
|
->setUser($viewer);
|
||||||
|
@ -80,10 +78,13 @@ final class PhabricatorPeopleProfileEditController
|
||||||
->setValidationException($validation_exception)
|
->setValidationException($validation_exception)
|
||||||
->setForm($form);
|
->setForm($form);
|
||||||
|
|
||||||
|
$nav = $this->buildIconNavView($user);
|
||||||
|
$nav->selectFilter('/');
|
||||||
|
$nav->appendChild($form_box);
|
||||||
|
|
||||||
return $this->buildApplicationPage(
|
return $this->buildApplicationPage(
|
||||||
array(
|
array(
|
||||||
$crumbs,
|
$nav,
|
||||||
$form_box,
|
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'title' => $title,
|
'title' => $title,
|
||||||
|
|
|
@ -20,6 +20,7 @@ final class PhabricatorPeopleProfilePictureController
|
||||||
$user = id(new PhabricatorPeopleQuery())
|
$user = id(new PhabricatorPeopleQuery())
|
||||||
->setViewer($viewer)
|
->setViewer($viewer)
|
||||||
->withIDs(array($this->id))
|
->withIDs(array($this->id))
|
||||||
|
->needProfileImage(true)
|
||||||
->requireCapabilities(
|
->requireCapabilities(
|
||||||
array(
|
array(
|
||||||
PhabricatorPolicyCapability::CAN_VIEW,
|
PhabricatorPolicyCapability::CAN_VIEW,
|
||||||
|
@ -91,9 +92,6 @@ final class PhabricatorPeopleProfilePictureController
|
||||||
}
|
}
|
||||||
|
|
||||||
$title = pht('Edit Profile Picture');
|
$title = pht('Edit Profile Picture');
|
||||||
$crumbs = $this->buildApplicationCrumbs();
|
|
||||||
$crumbs->addTextCrumb($user->getUsername(), $profile_uri);
|
|
||||||
$crumbs->addTextCrumb($title);
|
|
||||||
|
|
||||||
$form = id(new PHUIFormLayoutView())
|
$form = id(new PHUIFormLayoutView())
|
||||||
->setUser($viewer);
|
->setUser($viewer);
|
||||||
|
@ -242,11 +240,14 @@ final class PhabricatorPeopleProfilePictureController
|
||||||
->setHeaderText(pht('Upload New Picture'))
|
->setHeaderText(pht('Upload New Picture'))
|
||||||
->setForm($upload_form);
|
->setForm($upload_form);
|
||||||
|
|
||||||
|
$nav = $this->buildIconNavView($user);
|
||||||
|
$nav->selectFilter('/');
|
||||||
|
$nav->appendChild($form_box);
|
||||||
|
$nav->appendChild($upload_box);
|
||||||
|
|
||||||
return $this->buildApplicationPage(
|
return $this->buildApplicationPage(
|
||||||
array(
|
array(
|
||||||
$crumbs,
|
$nav,
|
||||||
$form_box,
|
|
||||||
$upload_box,
|
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'title' => $title,
|
'title' => $title,
|
||||||
|
|
|
@ -33,15 +33,6 @@
|
||||||
margin-left: 16px;
|
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 {
|
.device-phone .profile-activity-view .profile-feed {
|
||||||
float: none;
|
float: none;
|
||||||
margin: 0 8px;
|
margin: 0 8px;
|
||||||
|
|
Loading…
Reference in a new issue