mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-18 19:40:55 +01:00
[Redesign] People, Profile, Feed UI
Summary: Ref T8099, Mostly a Feed cleanup, removing old CSS, relying on modern display objects, adds back the feed to profile (I miss it, but maybe you don't). Test Plan: Visit Feed on Profiles, Projects, Feed, and Dashboards. Same UI Everywhere. TODO, "Public Feed". Reviewers: btrahan, epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T8099 Differential Revision: https://secure.phabricator.com/D13101
This commit is contained in:
parent
e230e03880
commit
132bff3ea5
9 changed files with 55 additions and 150 deletions
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
return array(
|
||||
'names' => array(
|
||||
'core.pkg.css' => '1b6e6a39',
|
||||
'core.pkg.css' => '63bd9495',
|
||||
'core.pkg.js' => 'fbf1d615',
|
||||
'darkconsole.pkg.js' => 'e7393ebb',
|
||||
'differential.pkg.css' => 'f89b49b6',
|
||||
|
@ -98,7 +98,6 @@ return array(
|
|||
'rsrc/css/application/ponder/feed.css' => 'e62615b6',
|
||||
'rsrc/css/application/ponder/post.css' => '9d415218',
|
||||
'rsrc/css/application/ponder/vote.css' => '8ed6ed8b',
|
||||
'rsrc/css/application/profile/profile-view.css' => 'cb6f56b7',
|
||||
'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',
|
||||
|
@ -130,7 +129,7 @@ return array(
|
|||
'rsrc/css/phui/phui-button.css' => 'b995182d',
|
||||
'rsrc/css/phui/phui-crumbs-view.css' => 'ce840ec2',
|
||||
'rsrc/css/phui/phui-document.css' => '08f33f08',
|
||||
'rsrc/css/phui/phui-feed-story.css' => '06872ae9',
|
||||
'rsrc/css/phui/phui-feed-story.css' => '153a2ebf',
|
||||
'rsrc/css/phui/phui-fontkit.css' => 'b664ac96',
|
||||
'rsrc/css/phui/phui-form-view.css' => 'a0e8f168',
|
||||
'rsrc/css/phui/phui-form.css' => 'f535f938',
|
||||
|
@ -723,7 +722,6 @@ return array(
|
|||
'phabricator-object-selector-css' => '029a133d',
|
||||
'phabricator-phtize' => 'd254d646',
|
||||
'phabricator-prefab' => '6920d200',
|
||||
'phabricator-profile-css' => 'cb6f56b7',
|
||||
'phabricator-remarkup-css' => '67a4ee29',
|
||||
'phabricator-search-results-css' => 'ce897fb9',
|
||||
'phabricator-shaped-request' => '7cbe244b',
|
||||
|
@ -764,7 +762,7 @@ return array(
|
|||
'phui-calendar-month-css' => '476be7e0',
|
||||
'phui-crumbs-view-css' => 'ce840ec2',
|
||||
'phui-document-view-css' => '08f33f08',
|
||||
'phui-feed-story-css' => '06872ae9',
|
||||
'phui-feed-story-css' => '153a2ebf',
|
||||
'phui-font-icon-base-css' => '3dad2ae3',
|
||||
'phui-fontkit-css' => 'b664ac96',
|
||||
'phui-form-css' => 'f535f938',
|
||||
|
|
|
@ -2223,7 +2223,6 @@ phutil_register_library_map(array(
|
|||
'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',
|
||||
'PhabricatorPeopleInviteController' => 'applications/people/controller/PhabricatorPeopleInviteController.php',
|
||||
'PhabricatorPeopleInviteListController' => 'applications/people/controller/PhabricatorPeopleInviteListController.php',
|
||||
|
@ -5633,7 +5632,6 @@ phutil_register_library_map(array(
|
|||
'PhabricatorPeopleDisableController' => 'PhabricatorPeopleController',
|
||||
'PhabricatorPeopleEmpowerController' => 'PhabricatorPeopleController',
|
||||
'PhabricatorPeopleExternalPHIDType' => 'PhabricatorPHIDType',
|
||||
'PhabricatorPeopleFeedController' => 'PhabricatorPeopleController',
|
||||
'PhabricatorPeopleHovercardEventListener' => 'PhabricatorEventListener',
|
||||
'PhabricatorPeopleInviteController' => 'PhabricatorPeopleController',
|
||||
'PhabricatorPeopleInviteListController' => 'PhabricatorPeopleInviteController',
|
||||
|
|
|
@ -83,20 +83,22 @@ final class PhabricatorFeedBuilder {
|
|||
$null_view->appendChild($view);
|
||||
}
|
||||
|
||||
$box = id(new PHUIObjectBoxView())
|
||||
->appendChild($null_view);
|
||||
|
||||
if (empty($stories)) {
|
||||
$nodatastring = pht('No Stories.');
|
||||
if ($this->noDataString) {
|
||||
$nodatastring = $this->noDataString;
|
||||
}
|
||||
|
||||
$view = id(new PHUIInfoView())
|
||||
->setSeverity(PHUIInfoView::SEVERITY_NODATA)
|
||||
$view = id(new PHUIBoxView())
|
||||
->addClass('mlt mlb msr msl')
|
||||
->appendChild($nodatastring);
|
||||
$null_view->appendChild($view);
|
||||
$box->appendChild($view);
|
||||
}
|
||||
|
||||
return id(new PHUIObjectBoxView())
|
||||
->appendChild($null_view);
|
||||
return $box;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@ abstract class PhabricatorPeopleController extends PhabricatorController {
|
|||
if ($name) {
|
||||
$nav->setBaseURI(new PhutilURI('/p/'));
|
||||
$nav->addFilter("{$name}/", $name);
|
||||
$nav->addFilter("{$name}/feed/", pht('Feed'));
|
||||
$nav->addFilter("{$name}/calendar/", pht('Calendar'));
|
||||
}
|
||||
}
|
||||
|
@ -54,7 +53,6 @@ abstract class PhabricatorPeopleController extends PhabricatorController {
|
|||
$nav->setIconNav(true);
|
||||
$nav->setBaseURI(new PhutilURI('/p/'));
|
||||
$nav->addIcon("{$name}/", $name, null, $picture);
|
||||
$nav->addIcon("{$name}/feed/", pht('Feed'), 'fa-newspaper-o');
|
||||
|
||||
$class = 'PhabricatorCalendarApplication';
|
||||
if (PhabricatorApplication::isClassInstalledForViewer($class, $viewer)) {
|
||||
|
|
|
@ -1,61 +0,0 @@
|
|||
<?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);
|
||||
$builder->setNoDataString(
|
||||
pht(
|
||||
'To begin on such a grand journey, requires but just a single step.'));
|
||||
$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(
|
||||
$nav,
|
||||
array(
|
||||
'title' => pht('Feed'),
|
||||
));
|
||||
}
|
||||
}
|
|
@ -26,8 +26,6 @@ final class PhabricatorPeopleProfileController
|
|||
return new Aphront404Response();
|
||||
}
|
||||
|
||||
require_celerity_resource('phabricator-profile-css');
|
||||
|
||||
$profile = $user->loadUserProfile();
|
||||
$username = phutil_escape_uri($user->getUserName());
|
||||
|
||||
|
@ -64,6 +62,17 @@ final class PhabricatorPeopleProfileController
|
|||
->setDisabled(!$can_edit)
|
||||
->setWorkflow(!$can_edit));
|
||||
|
||||
$class = 'PhabricatorConpherenceApplication';
|
||||
if (PhabricatorApplication::isClassInstalledForViewer($class, $viewer)) {
|
||||
$href = '/conpherence/new/?participant='.$user->getPHID();
|
||||
$actions->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setIcon('fa-comments')
|
||||
->setName(pht('Send Message'))
|
||||
->setWorkflow(true)
|
||||
->setHref($href));
|
||||
}
|
||||
|
||||
if ($viewer->getIsAdmin()) {
|
||||
$actions->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
|
@ -134,28 +143,18 @@ final class PhabricatorPeopleProfileController
|
|||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$crumbs->addTextCrumb($name);
|
||||
|
||||
$class = 'PhabricatorConpherenceApplication';
|
||||
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);
|
||||
}
|
||||
|
||||
$object_box = id(new PHUIObjectBoxView())
|
||||
->setHeader($header)
|
||||
->addPropertyList($properties);
|
||||
|
||||
$feed = id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('Recent Activity'))
|
||||
->appendChild($this->buildPeopleFeed($user, $viewer));
|
||||
|
||||
$nav = $this->buildIconNavView($user);
|
||||
$nav->selectFilter("{$name}/");
|
||||
$nav->appendChild($object_box);
|
||||
$nav->appendChild($feed);
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
$nav,
|
||||
|
@ -182,4 +181,28 @@ final class PhabricatorPeopleProfileController
|
|||
return $view;
|
||||
}
|
||||
|
||||
private function buildPeopleFeed(
|
||||
PhabricatorUser $user,
|
||||
$viewer) {
|
||||
|
||||
$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);
|
||||
$builder->setNoDataString(pht('To begin on such a grand journey, '.
|
||||
'requires but just a single step.'));
|
||||
$view = $builder->buildView();
|
||||
|
||||
return phutil_tag_div('phabricator-project-feed', $view->render());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -32,8 +32,6 @@ final class PhabricatorProjectFeedController
|
|||
->setURI('/tag/'.$project->getPrimarySlug().'/');
|
||||
}
|
||||
|
||||
require_celerity_resource('phabricator-profile-css');
|
||||
|
||||
$query = new PhabricatorFeedQuery();
|
||||
$query->setFilterPHIDs(
|
||||
array(
|
||||
|
@ -44,11 +42,13 @@ final class PhabricatorProjectFeedController
|
|||
$stories = $query->execute();
|
||||
$feed = $this->renderStories($stories);
|
||||
|
||||
$content = phutil_tag_div('phabricator-project-feed', $feed);
|
||||
$box = id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('Project Activity'))
|
||||
->appendChild($feed);
|
||||
|
||||
$nav = $this->buildIconNavView($project);
|
||||
$nav->selectFilter("feed/{$id}/");
|
||||
$nav->appendChild($content);
|
||||
$nav->appendChild($box);
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
$nav,
|
||||
|
|
|
@ -1,53 +0,0 @@
|
|||
/**
|
||||
* @provides phabricator-profile-css
|
||||
*/
|
||||
|
||||
.device-desktop .profile-feed,
|
||||
.device-tablet .profile-feed {
|
||||
padding: 0 16px 16px 0;
|
||||
}
|
||||
|
||||
.device-phone .profile-feed {
|
||||
padding: 12px 0;
|
||||
}
|
||||
|
||||
.device-phone .phabricator-project-layout .profile-feed {
|
||||
padding: 12px 8px;
|
||||
}
|
||||
|
||||
.profile-feed .phui-action-header-title {
|
||||
font-size: 16px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.profile-activity-view {
|
||||
padding-top: 16px;
|
||||
}
|
||||
|
||||
.profile-activity-view .profile-calendar {
|
||||
float: left;
|
||||
margin: 0 16px;
|
||||
}
|
||||
|
||||
.profile-activity-view .profile-feed {
|
||||
margin-left: 16px;
|
||||
}
|
||||
|
||||
.device-phone .profile-activity-view .profile-feed {
|
||||
float: none;
|
||||
margin: 0 8px;
|
||||
}
|
||||
|
||||
.device-desktop .phabricator-project-layout .profile-feed,
|
||||
.device-tablet .phabricator-project-layout .profile-feed {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.phabricator-project-feed .phui-info-view {
|
||||
margin: 12px 0;
|
||||
}
|
||||
|
||||
.device-phone .phabricator-project-feed {
|
||||
padding: 0 12px;
|
||||
width: auto;
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
* @provides phui-feed-story-css
|
||||
*/
|
||||
|
||||
.phabricator-feed-frame .phui-box.phui-feed-story {
|
||||
.phui-object-box .phui-box.phui-feed-story {
|
||||
border-bottom: 1px solid {$thinblueborder};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue