Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15467054
D17869.id42978.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
7 KB
Referenced Files
None
Subscribers
None
D17869.id42978.diff
View Options
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
@@ -3635,6 +3635,7 @@
'PhabricatorProjectOrUserDatasource' => 'applications/project/typeahead/PhabricatorProjectOrUserDatasource.php',
'PhabricatorProjectOrUserFunctionDatasource' => 'applications/project/typeahead/PhabricatorProjectOrUserFunctionDatasource.php',
'PhabricatorProjectPHIDResolver' => 'applications/phid/resolver/PhabricatorProjectPHIDResolver.php',
+ 'PhabricatorProjectPictureProfileMenuItem' => 'applications/project/menuitem/PhabricatorProjectPictureProfileMenuItem.php',
'PhabricatorProjectPointsProfileMenuItem' => 'applications/project/menuitem/PhabricatorProjectPointsProfileMenuItem.php',
'PhabricatorProjectProfileController' => 'applications/project/controller/PhabricatorProjectProfileController.php',
'PhabricatorProjectProfileMenuEngine' => 'applications/project/engine/PhabricatorProjectProfileMenuEngine.php',
@@ -9020,6 +9021,7 @@
'PhabricatorProjectOrUserDatasource' => 'PhabricatorTypeaheadCompositeDatasource',
'PhabricatorProjectOrUserFunctionDatasource' => 'PhabricatorTypeaheadCompositeDatasource',
'PhabricatorProjectPHIDResolver' => 'PhabricatorPHIDResolver',
+ 'PhabricatorProjectPictureProfileMenuItem' => 'PhabricatorProfileMenuItem',
'PhabricatorProjectPointsProfileMenuItem' => 'PhabricatorProfileMenuItem',
'PhabricatorProjectProfileController' => 'PhabricatorProjectController',
'PhabricatorProjectProfileMenuEngine' => 'PhabricatorProfileMenuEngine',
diff --git a/src/applications/project/controller/PhabricatorProjectManageController.php b/src/applications/project/controller/PhabricatorProjectManageController.php
--- a/src/applications/project/controller/PhabricatorProjectManageController.php
+++ b/src/applications/project/controller/PhabricatorProjectManageController.php
@@ -21,8 +21,7 @@
$header = id(new PHUIHeaderView())
->setHeader(pht('Project History'))
->setUser($viewer)
- ->setPolicyObject($project)
- ->setImage($picture);
+ ->setPolicyObject($project);
if ($project->getStatus() == PhabricatorProjectStatus::STATUS_ACTIVE) {
$header->setStatus('fa-check', 'bluegrey', pht('Active'));
@@ -45,10 +44,14 @@
$crumbs->addTextCrumb(pht('Manage'));
$crumbs->setBorder(true);
+ require_celerity_resource('project-view-css');
+
$manage = id(new PHUITwoColumnView())
->setHeader($header)
->setCurtain($curtain)
->addPropertySection(pht('Details'), $properties)
+ ->addClass('project-view-home')
+ ->addClass('project-view-people-home')
->setMainColumn(
array(
$timeline,
diff --git a/src/applications/project/controller/PhabricatorProjectProfileController.php b/src/applications/project/controller/PhabricatorProjectProfileController.php
--- a/src/applications/project/controller/PhabricatorProjectProfileController.php
+++ b/src/applications/project/controller/PhabricatorProjectProfileController.php
@@ -29,7 +29,6 @@
->setHeader(array($project->getDisplayName(), $tag))
->setUser($viewer)
->setPolicyObject($project)
- ->setImage($picture)
->setProfileHeader(true);
if ($project->getStatus() == PhabricatorProjectStatus::STATUS_ACTIVE) {
@@ -92,6 +91,7 @@
$home = id(new PHUITwoColumnView())
->setHeader($header)
->addClass('project-view-home')
+ ->addClass('project-view-people-home')
->setMainColumn(
array(
$properties,
diff --git a/src/applications/project/engine/PhabricatorProjectProfileMenuEngine.php b/src/applications/project/engine/PhabricatorProjectProfileMenuEngine.php
--- a/src/applications/project/engine/PhabricatorProjectProfileMenuEngine.php
+++ b/src/applications/project/engine/PhabricatorProjectProfileMenuEngine.php
@@ -21,6 +21,10 @@
$items = array();
$items[] = $this->newItem()
+ ->setBuiltinKey(PhabricatorProject::ITEM_PICTURE)
+ ->setMenuItemKey(PhabricatorProjectPictureProfileMenuItem::MENUITEMKEY);
+
+ $items[] = $this->newItem()
->setBuiltinKey(PhabricatorProject::ITEM_PROFILE)
->setMenuItemKey(PhabricatorProjectDetailsProfileMenuItem::MENUITEMKEY);
diff --git a/src/applications/project/menuitem/PhabricatorProjectDetailsProfileMenuItem.php b/src/applications/project/menuitem/PhabricatorProjectDetailsProfileMenuItem.php
--- a/src/applications/project/menuitem/PhabricatorProjectDetailsProfileMenuItem.php
+++ b/src/applications/project/menuitem/PhabricatorProjectDetailsProfileMenuItem.php
@@ -46,15 +46,15 @@
$project = $config->getProfileObject();
$id = $project->getID();
- $picture = $project->getProfileImageURI();
$name = $project->getName();
+ $icon = $project->getDisplayIconIcon();
$href = "/project/profile/{$id}/";
$item = $this->newItem()
->setHref($href)
->setName($name)
- ->setProfileImage($picture);
+ ->setIcon($icon);
return array(
$item,
diff --git a/src/applications/project/menuitem/PhabricatorProjectPictureProfileMenuItem.php b/src/applications/project/menuitem/PhabricatorProjectPictureProfileMenuItem.php
new file mode 100644
--- /dev/null
+++ b/src/applications/project/menuitem/PhabricatorProjectPictureProfileMenuItem.php
@@ -0,0 +1,69 @@
+<?php
+
+final class PhabricatorProjectPictureProfileMenuItem
+ extends PhabricatorProfileMenuItem {
+
+ const MENUITEMKEY = 'project.picture';
+
+ public function getMenuItemTypeName() {
+ return pht('Project Picture');
+ }
+
+ private function getDefaultName() {
+ return pht('Project Picture');
+ }
+
+ public function canHideMenuItem(
+ PhabricatorProfileMenuItemConfiguration $config) {
+ return false;
+ }
+
+ public function getDisplayName(
+ PhabricatorProfileMenuItemConfiguration $config) {
+ return $this->getDefaultName();
+ }
+
+ public function buildEditEngineFields(
+ PhabricatorProfileMenuItemConfiguration $config) {
+ return array();
+ }
+
+ protected function newNavigationMenuItems(
+ PhabricatorProfileMenuItemConfiguration $config) {
+
+ $project = $config->getProfileObject();
+ require_celerity_resource('people-picture-menu-item-css');
+
+ $picture = $project->getProfileImageURI();
+ $href = $project->getProfileURI();
+
+ $classes = array();
+ $classes[] = 'people-menu-image';
+ if ($project->isArchived()) {
+ $classes[] = 'phui-image-disabled';
+ }
+
+ $photo = phutil_tag(
+ 'img',
+ array(
+ 'src' => $picture,
+ 'class' => implode(' ', $classes),
+ ));
+
+ $view = phutil_tag_div('people-menu-image-container', $photo);
+ $view = phutil_tag(
+ 'a',
+ array(
+ 'href' => $href,
+ ),
+ $view);
+
+ $item = $this->newItem()
+ ->appendChild($view);
+
+ return array(
+ $item,
+ );
+ }
+
+}
diff --git a/src/applications/project/storage/PhabricatorProject.php b/src/applications/project/storage/PhabricatorProject.php
--- a/src/applications/project/storage/PhabricatorProject.php
+++ b/src/applications/project/storage/PhabricatorProject.php
@@ -49,6 +49,7 @@
const TABLE_DATASOURCE_TOKEN = 'project_datasourcetoken';
+ const ITEM_PICTURE = 'project.picture';
const ITEM_PROFILE = 'project.profile';
const ITEM_POINTS = 'project.points';
const ITEM_WORKBOARD = 'project.workboard';
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 4, 12:18 PM (5 d, 3 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7662981
Default Alt Text
D17869.id42978.diff (7 KB)
Attached To
Mode
D17869: Add a large profile picture to Projects
Attached
Detach File
Event Timeline
Log In to Comment