mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-10 14:51:06 +01:00
Add a large profile picture to Projects
Summary: The ports over a similar "profile image" menu item to Projects. It gives us some room to use the project icon in the sidenav along with a larger photo. It also will open up some room in the sub-page headers for us to focus on that page, and not the identity of the project at hand. Expect a few more project related touch up diffs. Test Plan: Review new projects menu on a few projects, update the image, see new image. Great for team photos. {F4951264} Reviewers: epriestley, amckinley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D17869
This commit is contained in:
parent
fcf64953f0
commit
e1a97616cb
7 changed files with 84 additions and 5 deletions
|
@ -3635,6 +3635,7 @@ phutil_register_library_map(array(
|
|||
'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 @@ phutil_register_library_map(array(
|
|||
'PhabricatorProjectOrUserDatasource' => 'PhabricatorTypeaheadCompositeDatasource',
|
||||
'PhabricatorProjectOrUserFunctionDatasource' => 'PhabricatorTypeaheadCompositeDatasource',
|
||||
'PhabricatorProjectPHIDResolver' => 'PhabricatorPHIDResolver',
|
||||
'PhabricatorProjectPictureProfileMenuItem' => 'PhabricatorProfileMenuItem',
|
||||
'PhabricatorProjectPointsProfileMenuItem' => 'PhabricatorProfileMenuItem',
|
||||
'PhabricatorProjectProfileController' => 'PhabricatorProjectController',
|
||||
'PhabricatorProjectProfileMenuEngine' => 'PhabricatorProfileMenuEngine',
|
||||
|
|
|
@ -21,8 +21,7 @@ final class PhabricatorProjectManageController
|
|||
$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 @@ final class PhabricatorProjectManageController
|
|||
$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,
|
||||
|
|
|
@ -29,7 +29,6 @@ final class PhabricatorProjectProfileController
|
|||
->setHeader(array($project->getDisplayName(), $tag))
|
||||
->setUser($viewer)
|
||||
->setPolicyObject($project)
|
||||
->setImage($picture)
|
||||
->setProfileHeader(true);
|
||||
|
||||
if ($project->getStatus() == PhabricatorProjectStatus::STATUS_ACTIVE) {
|
||||
|
@ -92,6 +91,7 @@ final class PhabricatorProjectProfileController
|
|||
$home = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->addClass('project-view-home')
|
||||
->addClass('project-view-people-home')
|
||||
->setMainColumn(
|
||||
array(
|
||||
$properties,
|
||||
|
|
|
@ -20,6 +20,10 @@ final class PhabricatorProjectProfileMenuEngine
|
|||
protected function getBuiltinProfileItems($object) {
|
||||
$items = array();
|
||||
|
||||
$items[] = $this->newItem()
|
||||
->setBuiltinKey(PhabricatorProject::ITEM_PICTURE)
|
||||
->setMenuItemKey(PhabricatorProjectPictureProfileMenuItem::MENUITEMKEY);
|
||||
|
||||
$items[] = $this->newItem()
|
||||
->setBuiltinKey(PhabricatorProject::ITEM_PROFILE)
|
||||
->setMenuItemKey(PhabricatorProjectDetailsProfileMenuItem::MENUITEMKEY);
|
||||
|
|
|
@ -46,15 +46,15 @@ final class PhabricatorProjectDetailsProfileMenuItem
|
|||
$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,
|
||||
|
|
|
@ -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,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
|
@ -49,6 +49,7 @@ final class PhabricatorProject extends PhabricatorProjectDAO
|
|||
|
||||
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';
|
||||
|
|
Loading…
Reference in a new issue