1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-18 11:30:55 +01:00

Update Profiles to look like Project UI

Summary: Updates People profiles to look more like Project profiles. This removes Conpherence and Flag links. Don't think you like Conpherence links much and for Flags maybe we can put them in the quick create menu?

Test Plan:
View profiles with and without Badges.

{F1069365}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D15111
This commit is contained in:
Chad Little 2016-01-24 17:04:55 -08:00
parent df50a52628
commit a9e2e6c5aa
5 changed files with 76 additions and 47 deletions

View file

@ -7,7 +7,7 @@
*/
return array(
'names' => array(
'core.pkg.css' => '956d6a9f',
'core.pkg.css' => 'ab6cb6b8',
'core.pkg.js' => '573e6664',
'darkconsole.pkg.js' => 'e7393ebb',
'differential.pkg.css' => '2de124c9',
@ -93,7 +93,7 @@ return array(
'rsrc/css/application/policy/policy-transaction-detail.css' => '82100a43',
'rsrc/css/application/policy/policy.css' => '957ea14c',
'rsrc/css/application/ponder/ponder-view.css' => '7b0df4da',
'rsrc/css/application/project/project-view.css' => 'ea27bd1f',
'rsrc/css/application/project/project-view.css' => '5c32ce0a',
'rsrc/css/application/releeph/releeph-core.css' => '9b3c5733',
'rsrc/css/application/releeph/releeph-preview-branch.css' => 'b7a6f4a5',
'rsrc/css/application/releeph/releeph-request-differential-create-dialog.css' => '8d8b92cd',
@ -123,7 +123,7 @@ return array(
'rsrc/css/phui/phui-action-panel.css' => '91c7b835',
'rsrc/css/phui/phui-badge.css' => 'f25c3476',
'rsrc/css/phui/phui-big-info-view.css' => 'bd903741',
'rsrc/css/phui/phui-box.css' => '04e9369f',
'rsrc/css/phui/phui-box.css' => '6240d401',
'rsrc/css/phui/phui-button.css' => 'd6ac72db',
'rsrc/css/phui/phui-crumbs-view.css' => '414406b5',
'rsrc/css/phui/phui-document-pro.css' => '8799acf7',
@ -793,7 +793,7 @@ return array(
'phui-action-panel-css' => '91c7b835',
'phui-badge-view-css' => 'f25c3476',
'phui-big-info-view-css' => 'bd903741',
'phui-box-css' => '04e9369f',
'phui-box-css' => '6240d401',
'phui-button-css' => 'd6ac72db',
'phui-calendar-css' => 'ccabe893',
'phui-calendar-day-css' => 'd1cf6f93',
@ -842,7 +842,7 @@ return array(
'policy-edit-css' => '815c66f7',
'policy-transaction-detail-css' => '82100a43',
'ponder-view-css' => '7b0df4da',
'project-view-css' => 'ea27bd1f',
'project-view-css' => '5c32ce0a',
'raphael-core' => '51ee6b43',
'raphael-g' => '40dde778',
'raphael-g-line' => '40da039e',

View file

@ -28,7 +28,7 @@ final class PhabricatorPeopleProfileManageController
$profile_icon = PhabricatorPeopleIconSet::getIconIcon($profile->getIcon());
$profile_icon = id(new PHUIIconView())
->setIconFont($profile_icon.' grey');
->setIconFont($profile_icon);
$profile_title = $profile->getDisplayTitle();
$header = id(new PHUIHeaderView())

View file

@ -29,52 +29,65 @@ final class PhabricatorPeopleProfileViewController
$profile_icon = PhabricatorPeopleIconSet::getIconIcon($profile->getIcon());
$profile_icon = id(new PHUIIconView())
->setIconFont($profile_icon.' grey');
->setIconFont($profile_icon);
$profile_title = $profile->getDisplayTitle();
$header = id(new PHUIHeaderView())
->setHeader($user->getFullName())
->setSubheader(array($profile_icon, $profile_title))
->setImage($picture);
->setImage($picture)
->setProfileHeader(true);
$actions = id(new PhabricatorActionListView())
->setObject($user)
->setUser($viewer);
$can_edit = PhabricatorPolicyFilter::hasCapability(
$viewer,
$user,
PhabricatorPolicyCapability::CAN_EDIT);
$class = 'PhabricatorConpherenceApplication';
if (PhabricatorApplication::isClassInstalledForViewer($class, $viewer)) {
$href = id(new PhutilURI('/conpherence/new/'))
->setQueryParam('participant', $user->getPHID());
$can_send = $viewer->isLoggedIn();
$actions->addAction(
id(new PhabricatorActionView())
->setIcon('fa-comments')
->setName(pht('Send Message'))
->setWorkflow(true)
->setDisabled(!$can_send)
->setHref($href));
if ($can_edit) {
$id = $user->getID();
$header->setImageEditURL($this->getApplicationURI("picture/{$id}/"));
}
$properties = $this->buildPropertyView($user, $actions);
$properties = $this->buildPropertyView($user);
$name = $user->getUsername();
$object_box = id(new PHUIObjectBoxView())
->setHeader($header)
->addPropertyList($properties);
$feed = id(new PHUIObjectBoxView())
->setHeaderText(pht('Recent Activity'))
->appendChild($this->buildPeopleFeed($user, $viewer));
$feed = $this->buildPeopleFeed($user, $viewer);
$feed = phutil_tag_div('project-view-feed', $feed);
$badges = $this->buildBadgesView($user);
if ($badges) {
$columns = id(new PHUITwoColumnView())
->addClass('project-view-badges')
->setMainColumn(
array(
$properties,
$feed,
))
->setSideColumn(
array(
$badges,
));
} else {
$columns = array($properties, $feed);
}
$nav = $this->getProfileMenu();
$nav->selectFilter(PhabricatorPeopleProfilePanelEngine::PANEL_PROFILE);
$crumbs = $this->buildApplicationCrumbs();
$crumbs->setBorder(true);
require_celerity_resource('project-view-css');
$home = phutil_tag(
'div',
array(
'class' => 'project-view-home',
),
array(
$header,
$columns,
));
return $this->newPage()
->setTitle($user->getUsername())
@ -82,27 +95,32 @@ final class PhabricatorPeopleProfileViewController
->setCrumbs($crumbs)
->appendChild(
array(
$object_box,
$badges,
$feed,
$home,
));
}
private function buildPropertyView(
PhabricatorUser $user,
PhabricatorActionListView $actions) {
PhabricatorUser $user) {
$viewer = $this->getRequest()->getUser();
$view = id(new PHUIPropertyListView())
->setUser($viewer)
->setObject($user)
->setActionList($actions);
->setObject($user);
$field_list = PhabricatorCustomField::getObjectFields(
$user,
PhabricatorCustomField::ROLE_VIEW);
$field_list->appendFieldsToPropertyList($user, $viewer, $view);
if ($view->isEmpty()) {
return null;
}
$view = id(new PHUIBoxView())
->setColor(PHUIBoxView::GREY)
->appendChild($view)
->addClass('project-view-properties');
return $view;
}
@ -132,9 +150,10 @@ final class PhabricatorPeopleProfileViewController
$flex->addItem($item);
}
$box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Badges'))
->appendChild($flex);
$box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Badges'))
->appendChild($flex)
->setBackground(PHUIBoxView::GREY);
}
}
@ -161,7 +180,7 @@ final class PhabricatorPeopleProfileViewController
'requires but just a single step.'));
$view = $builder->buildView();
return phutil_tag_div('phabricator-project-feed', $view->render());
return $view->render();
}

View file

@ -54,3 +54,11 @@
.project-view-home .phui-box-grey .phui-object-item-list-view {
padding: 8px;
}
.device-desktop .phui-two-column-view.project-view-badges .phui-side-column {
width: 364px;
}
.profile-no-badges {
padding: 24px 0;
}

View file

@ -39,9 +39,11 @@
border-bottom: 2px solid #fff;
}
.phui-box-blue .phui-info-severity-nodata,
.phui-box-grey .phui-info-severity-nodata {
.phui-object-box.phui-box-blue div.phui-info-severity-nodata,
.phui-object-box.phui-box-grey div.phui-info-severity-nodata {
background: transparent;
padding: 12px 4px;
text-align: center;
border: none;
color: {$greytext};
}