From 6e86a04ab106f4d3c9e32f2b3890a0fa137e43a2 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Mon, 15 Apr 2013 13:07:54 -0700 Subject: [PATCH] Update feed on projects, profile. Summary: Does a few things, standardizes feed a bit more on people, projects. Cleans up Project pages to be more dashboard like. Adds usable mobile support. Remove extenal public feed styles. The Project pages won't win any design awards, but they are much more usable and responsive (mobile). I assume the default view to be workboard still at some point. Test Plan: Test out Profile, Project Profile, Public Feed, normal Feed. Mobile and Chrome. Reviewers: epriestley, btrahan Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D5700 --- src/__celerity_resource_map__.php | 6 +- .../PhabricatorApplicationFeed.php | 2 +- .../feed/builder/PhabricatorFeedBuilder.php | 5 +- .../PhabricatorFeedMainController.php | 4 + .../PhabricatorFeedPublicStreamController.php | 4 +- .../feed/view/PhabricatorFeedView.php | 5 -- .../PhabricatorPeopleProfileController.php | 6 +- .../PhabricatorProjectController.php | 9 +-- .../PhabricatorProjectListController.php | 4 + .../PhabricatorProjectProfileController.php | 78 +++++++++---------- src/view/phui/PHUIFeedStoryView.php | 16 ++-- webroot/rsrc/css/application/feed/feed.css | 21 ++++- .../profile/profile-header-view.css | 1 - .../css/application/profile/profile-view.css | 24 ++++++ 14 files changed, 110 insertions(+), 75 deletions(-) delete mode 100644 src/applications/feed/view/PhabricatorFeedView.php diff --git a/src/__celerity_resource_map__.php b/src/__celerity_resource_map__.php index 6114aea9e0..6b3bb73b14 100644 --- a/src/__celerity_resource_map__.php +++ b/src/__celerity_resource_map__.php @@ -2980,7 +2980,7 @@ celerity_register_resource_map(array( ), 'phabricator-feed-css' => array( - 'uri' => '/res/e337f54b/rsrc/css/application/feed/feed.css', + 'uri' => '/res/6db1087e/rsrc/css/application/feed/feed.css', 'type' => 'css', 'requires' => array( @@ -3212,7 +3212,7 @@ celerity_register_resource_map(array( ), 'phabricator-profile-css' => array( - 'uri' => '/res/a54f47a7/rsrc/css/application/profile/profile-view.css', + 'uri' => '/res/76766eb6/rsrc/css/application/profile/profile-view.css', 'type' => 'css', 'requires' => array( @@ -3221,7 +3221,7 @@ celerity_register_resource_map(array( ), 'phabricator-profile-header-css' => array( - 'uri' => '/res/1ccc6f0b/rsrc/css/application/profile/profile-header-view.css', + 'uri' => '/res/a03c1e20/rsrc/css/application/profile/profile-header-view.css', 'type' => 'css', 'requires' => array( diff --git a/src/applications/feed/application/PhabricatorApplicationFeed.php b/src/applications/feed/application/PhabricatorApplicationFeed.php index d1c0e0cf3e..f83b7e0aed 100644 --- a/src/applications/feed/application/PhabricatorApplicationFeed.php +++ b/src/applications/feed/application/PhabricatorApplicationFeed.php @@ -7,7 +7,7 @@ final class PhabricatorApplicationFeed extends PhabricatorApplication { } public function getShortDescription() { - return 'Review activity.'; + return pht('Review activity.'); } public function getIconName() { diff --git a/src/applications/feed/builder/PhabricatorFeedBuilder.php b/src/applications/feed/builder/PhabricatorFeedBuilder.php index 4d08498509..c982e5d908 100644 --- a/src/applications/feed/builder/PhabricatorFeedBuilder.php +++ b/src/applications/feed/builder/PhabricatorFeedBuilder.php @@ -56,9 +56,8 @@ final class PhabricatorFeedBuilder { $null_view->appendChild($view); } - return id(new AphrontNullView())->appendChild(hsprintf( - '
%s
', - $null_view->render())); + return id(new AphrontNullView()) + ->appendChild($null_view->render()); } } diff --git a/src/applications/feed/controller/PhabricatorFeedMainController.php b/src/applications/feed/controller/PhabricatorFeedMainController.php index 37d7894469..556462ee3d 100644 --- a/src/applications/feed/controller/PhabricatorFeedMainController.php +++ b/src/applications/feed/controller/PhabricatorFeedMainController.php @@ -57,6 +57,10 @@ final class PhabricatorFeedMainController extends PhabricatorFeedController { $feed_view = $builder->buildView(); } + $feed_view = hsprintf( + '
%s
', + $feed_view); + $crumbs = $this ->buildApplicationCrumbs($nav) ->addCrumb( diff --git a/src/applications/feed/controller/PhabricatorFeedPublicStreamController.php b/src/applications/feed/controller/PhabricatorFeedPublicStreamController.php index d3047bc3fe..0bbdd21002 100644 --- a/src/applications/feed/controller/PhabricatorFeedPublicStreamController.php +++ b/src/applications/feed/controller/PhabricatorFeedPublicStreamController.php @@ -25,14 +25,14 @@ final class PhabricatorFeedPublicStreamController ->setFramed(true) ->setUser($viewer); - $view = $builder->buildView(); + $view = hsprintf('
%s
', + $builder->buildView()); return $this->buildStandardPageResponse( $view, array( 'title' => pht('Public Feed'), 'public' => true, - 'dust' => true, )); } } diff --git a/src/applications/feed/view/PhabricatorFeedView.php b/src/applications/feed/view/PhabricatorFeedView.php deleted file mode 100644 index 1a3de291d8..0000000000 --- a/src/applications/feed/view/PhabricatorFeedView.php +++ /dev/null @@ -1,5 +0,0 @@ -markupText($blurb); $content = hsprintf( - '
+ '

%s

@@ -194,7 +194,7 @@ final class PhabricatorPeopleProfileController
'. - '
+ '

%s

@@ -234,7 +234,7 @@ final class PhabricatorPeopleProfileController $view = $builder->buildView(); return hsprintf( - '
+ '
%s
', $view->render()); diff --git a/src/applications/project/controller/PhabricatorProjectController.php b/src/applications/project/controller/PhabricatorProjectController.php index c098f4e21b..7df3bc03aa 100644 --- a/src/applications/project/controller/PhabricatorProjectController.php +++ b/src/applications/project/controller/PhabricatorProjectController.php @@ -30,16 +30,15 @@ abstract class PhabricatorProjectController extends PhabricatorController { $edit_uri = '/project/edit/'.$id.'/'; $members_uri = '/project/members/'.$id.'/'; + $nav_view->addLabel(pht('Project')); $nav_view->addFilter('dashboard', pht('Dashboard')); - $nav_view->addFilter('feed', pht('Feed')); $nav_view->addFilter(null, pht('Tasks').' '.$external_arrow, $tasks_uri); $nav_view->addFilter(null, pht('Wiki').' '.$external_arrow, $phriction_uri); - $nav_view->addFilter('people', pht('People')); - $nav_view->addFilter('about', pht('About')); $user = $this->getRequest()->getUser(); $can_edit = PhabricatorPolicyCapability::CAN_EDIT; + $nav_view->addLabel(pht('Manage')); if (PhabricatorPolicyFilter::hasCapability($user, $project, $can_edit)) { $nav_view->addFilter('edit', pht("Edit Project"), $edit_uri); $nav_view->addFilter('members', pht("Edit Members"), $members_uri); @@ -61,10 +60,6 @@ abstract class PhabricatorProjectController extends PhabricatorController { return $nav_view; } - public function buildApplicationMenu() { - return $this->buildSideNavView(null, true)->getMenu(); - } - public function buildSideNavView($filter = null, $for_app = false) { $user = $this->getRequest()->getUser(); diff --git a/src/applications/project/controller/PhabricatorProjectListController.php b/src/applications/project/controller/PhabricatorProjectListController.php index 41ef51ebb8..9b8bf336fa 100644 --- a/src/applications/project/controller/PhabricatorProjectListController.php +++ b/src/applications/project/controller/PhabricatorProjectListController.php @@ -144,4 +144,8 @@ final class PhabricatorProjectListController 'dust' => true, )); } + + public function buildApplicationMenu() { + return $this->buildSideNavView(null, true)->getMenu(); + } } diff --git a/src/applications/project/controller/PhabricatorProjectProfileController.php b/src/applications/project/controller/PhabricatorProjectProfileController.php index 4c85607be2..daf2b48fe1 100644 --- a/src/applications/project/controller/PhabricatorProjectProfileController.php +++ b/src/applications/project/controller/PhabricatorProjectProfileController.php @@ -18,11 +18,8 @@ final class PhabricatorProjectProfileController $query = id(new PhabricatorProjectQuery()) ->setViewer($user) - ->withIDs(array($this->id)); - - if ($this->page == 'people') { - $query->needMembers(true); - } + ->withIDs(array($this->id)) + ->needMembers(true); $project = $query->executeOne(); $this->project = $project; @@ -42,34 +39,31 @@ final class PhabricatorProjectProfileController $this->page = $nav_view->selectFilter($this->page, 'dashboard'); require_celerity_resource('phabricator-profile-css'); - switch ($this->page) { - case 'dashboard': - $content = $this->renderTasksPage($project, $profile); - $query = new PhabricatorFeedQuery(); - $query->setFilterPHIDs( - array( - $project->getPHID(), - )); - $query->setLimit(50); - $query->setViewer($this->getRequest()->getUser()); - $stories = $query->execute(); + $tasks = $this->renderTasksPage($project, $profile); - $content = hsprintf('%s%s', $content, $this->renderStories($stories)); - break; - case 'about': - $content = $this->renderAboutPage($project, $profile); - break; - case 'people': - $content = $this->renderPeoplePage($project, $profile); - break; - case 'feed': - $content = $this->renderFeedPage($project, $profile); - break; - default: - throw new Exception("Unimplemented filter '{$this->page}'."); - } + $query = new PhabricatorFeedQuery(); + $query->setFilterPHIDs( + array( + $project->getPHID(), + )); + $query->setLimit(50); + $query->setViewer($this->getRequest()->getUser()); + $stories = $query->execute(); + $feed = $this->renderStories($stories); + $about = $this->renderAboutPage($project, $profile); + $people = $this->renderPeoplePage($project, $profile); + $col1 = hsprintf('%s%s', $about, $people); + $content = id(new AphrontMultiColumnView()) + ->addColumn($col1) + ->addColumn($feed) + ->setFluidLayout(true); + + $content = hsprintf( + '
%s%s
', + $tasks, + $content); $header = new PhabricatorProfileHeaderView(); $header->setName($project->getName()); @@ -111,16 +105,15 @@ final class PhabricatorProjectProfileController } $header->addAction($action); - $nav_view->appendChild($header); - - $content = hsprintf('
%s
', $content); $header->appendChild($content); return $this->buildApplicationPage( $nav_view, array( 'title' => pht('%s Project', $project->getName()), + 'device' => true, + 'dust' => true, )); } @@ -140,8 +133,8 @@ final class PhabricatorProjectProfileController $timestamp = phabricator_datetime($project->getDateCreated(), $viewer); $about = hsprintf( - '
-

About

+ '
+

%s

@@ -163,6 +156,7 @@ final class PhabricatorProjectProfileController
', + pht('About This Project'), pht('Creator'), $handles[$project->getAuthorPHID()]->renderLink(), pht('Created'), @@ -194,7 +188,7 @@ final class PhabricatorProjectProfileController } return hsprintf( - '
'. + '
'. '

%s

'. '
%s
'. '
', @@ -227,11 +221,9 @@ final class PhabricatorProjectProfileController $view = $builder->buildView(); return hsprintf( - '
'. - '

%s

'. - '
%s
'. + '
'. + '%s'. '
', - pht('Activity Feed'), $view->render()); } @@ -273,7 +265,7 @@ final class PhabricatorProjectProfileController pht("View All Open Tasks \xC2\xBB")); $content = hsprintf( - '
+ '

%s

'. '
'. '%s'. @@ -287,4 +279,8 @@ final class PhabricatorProjectProfileController return $content; } + public function buildApplicationMenu() { + return $this->buildLocalNavigation($this->project)->getMenu(); + } + } diff --git a/src/view/phui/PHUIFeedStoryView.php b/src/view/phui/PHUIFeedStoryView.php index 3d417b5908..a9e861d1a5 100644 --- a/src/view/phui/PHUIFeedStoryView.php +++ b/src/view/phui/PHUIFeedStoryView.php @@ -100,13 +100,15 @@ final class PHUIFeedStoryView extends AphrontView { $body = null; $foot = null; $image_style = null; - - $body = phutil_tag( - 'div', - array( - 'class' => 'phui-feed-story-body', - ), - $this->renderChildren()); + $body_content = $this->renderChildren(); + if ($body_content) { + $body = phutil_tag( + 'div', + array( + 'class' => 'phui-feed-story-body', + ), + $body_content); + } if ($this->epoch) { $foot = phabricator_datetime($this->epoch, $this->user); diff --git a/webroot/rsrc/css/application/feed/feed.css b/webroot/rsrc/css/application/feed/feed.css index cd272dcf86..52de120898 100644 --- a/webroot/rsrc/css/application/feed/feed.css +++ b/webroot/rsrc/css/application/feed/feed.css @@ -3,7 +3,12 @@ */ .phabricator-feed-frame { + margin: 20px 10px; +} + +.phabricator-public-feed-frame { margin: 10px; + max-width: 600px; } .phabricator-feed-frame .phabricator-action-header-title { @@ -12,8 +17,8 @@ } .device-desktop .phabricator-feed-frame { - width: 600px; - margin: 20px auto; + max-width: 600px; + margin: 20px; } .phabricator-feed-story-date-separator { @@ -29,3 +34,15 @@ float: right; font-weight: bold; } + +.phabricator-public-feed-frame .phui-feed-story-foot { + background: none; +} + +.phabricator-public-feed-frame .phui-feed-story { + box-shadow: none; +} + +.phabricator-public-feed-frame .phui-feed-wrap { + border: none; +} diff --git a/webroot/rsrc/css/application/profile/profile-header-view.css b/webroot/rsrc/css/application/profile/profile-header-view.css index 0343a3951c..ea8e2af7e5 100644 --- a/webroot/rsrc/css/application/profile/profile-header-view.css +++ b/webroot/rsrc/css/application/profile/profile-header-view.css @@ -8,7 +8,6 @@ border-style: solid; border-color: #c0c5d1; width: 100%; - box-shadow: 0 1px 3px rgba(0,0,0,0.2); } .phabricator-profile-header .profile-header-name { diff --git a/webroot/rsrc/css/application/profile/profile-view.css b/webroot/rsrc/css/application/profile/profile-view.css index be613a2df3..e42d421c4b 100644 --- a/webroot/rsrc/css/application/profile/profile-view.css +++ b/webroot/rsrc/css/application/profile/profile-view.css @@ -102,3 +102,27 @@ img.phabricator-profile-image { font-weight: bold; margin: .5em 1em 0; } + +.profile-wrap-responsive { + margin: 20px; +} + +.device .profile-wrap-responsive { + margin-left: 10px; + margin-right: 10px; +} + +.device-desktop .profile-feed { + max-width: 640px; +} + +.profile-feed .phabricator-action-header-title { + font-size: 16px; + margin-bottom: 5px; +} + +.device-desktop .phabricator-project-layout + .aphront-multi-column-column-outer:first-child + .phabricator-profile-info-group { + margin-right: 0; +}