Skip to content

Commit 6e86a04

Browse files
committed
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
1 parent 1412283 commit 6e86a04

14 files changed

+111
-76
lines changed

src/__celerity_resource_map__.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2980,7 +2980,7 @@
29802980
),
29812981
'phabricator-feed-css' =>
29822982
array(
2983-
'uri' => '/res/e337f54b/rsrc/css/application/feed/feed.css',
2983+
'uri' => '/res/6db1087e/rsrc/css/application/feed/feed.css',
29842984
'type' => 'css',
29852985
'requires' =>
29862986
array(
@@ -3212,7 +3212,7 @@
32123212
),
32133213
'phabricator-profile-css' =>
32143214
array(
3215-
'uri' => '/res/a54f47a7/rsrc/css/application/profile/profile-view.css',
3215+
'uri' => '/res/76766eb6/rsrc/css/application/profile/profile-view.css',
32163216
'type' => 'css',
32173217
'requires' =>
32183218
array(
@@ -3221,7 +3221,7 @@
32213221
),
32223222
'phabricator-profile-header-css' =>
32233223
array(
3224-
'uri' => '/res/1ccc6f0b/rsrc/css/application/profile/profile-header-view.css',
3224+
'uri' => '/res/a03c1e20/rsrc/css/application/profile/profile-header-view.css',
32253225
'type' => 'css',
32263226
'requires' =>
32273227
array(

src/applications/feed/application/PhabricatorApplicationFeed.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public function getBaseURI() {
77
}
88

99
public function getShortDescription() {
10-
return 'Review activity.';
10+
return pht('Review activity.');
1111
}
1212

1313
public function getIconName() {

src/applications/feed/builder/PhabricatorFeedBuilder.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,8 @@ public function buildView() {
5656
$null_view->appendChild($view);
5757
}
5858

59-
return id(new AphrontNullView())->appendChild(hsprintf(
60-
'<div class="phabricator-feed-frame">%s</div>',
61-
$null_view->render()));
59+
return id(new AphrontNullView())
60+
->appendChild($null_view->render());
6261
}
6362

6463
}

src/applications/feed/controller/PhabricatorFeedMainController.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ public function processRequest() {
5757
$feed_view = $builder->buildView();
5858
}
5959

60+
$feed_view = hsprintf(
61+
'<div class="phabricator-feed-frame">%s</div>',
62+
$feed_view);
63+
6064
$crumbs = $this
6165
->buildApplicationCrumbs($nav)
6266
->addCrumb(

src/applications/feed/controller/PhabricatorFeedPublicStreamController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ public function processRequest() {
2525
->setFramed(true)
2626
->setUser($viewer);
2727

28-
$view = $builder->buildView();
28+
$view = hsprintf('<div class="phabricator-public-feed-frame">%s</div>',
29+
$builder->buildView());
2930

3031
return $this->buildStandardPageResponse(
3132
$view,
3233
array(
3334
'title' => pht('Public Feed'),
3435
'public' => true,
35-
'dust' => true,
3636
));
3737
}
3838
}

src/applications/feed/view/PhabricatorFeedView.php

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/applications/people/controller/PhabricatorPeopleProfileController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ private function renderBasicInformation($user, $profile) {
179179
$blurb = $engine->markupText($blurb);
180180

181181
$content = hsprintf(
182-
'<div class="phabricator-profile-info-group ml">
182+
'<div class="phabricator-profile-info-group profile-wrap-responsive">
183183
<h1 class="phabricator-profile-info-header">%s</h1>
184184
<div class="phabricator-profile-info-pane">
185185
<table class="phabricator-profile-info-table">
@@ -194,7 +194,7 @@ private function renderBasicInformation($user, $profile) {
194194
</table>
195195
</div>
196196
</div>'.
197-
'<div class="phabricator-profile-info-group ml">
197+
'<div class="phabricator-profile-info-group profile-wrap-responsive">
198198
<h1 class="phabricator-profile-info-header">%s</h1>
199199
<div class="phabricator-profile-info-pane">
200200
<table class="phabricator-profile-info-table">
@@ -234,7 +234,7 @@ private function renderUserFeed(PhabricatorUser $user) {
234234
$view = $builder->buildView();
235235

236236
return hsprintf(
237-
'<div class="phabricator-profile-info-group">
237+
'<div class="profile-feed profile-wrap-responsive">
238238
%s
239239
</div>',
240240
$view->render());

src/applications/project/controller/PhabricatorProjectController.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,15 @@ protected function buildLocalNavigation(PhabricatorProject $project) {
3030
$edit_uri = '/project/edit/'.$id.'/';
3131
$members_uri = '/project/members/'.$id.'/';
3232

33+
$nav_view->addLabel(pht('Project'));
3334
$nav_view->addFilter('dashboard', pht('Dashboard'));
34-
$nav_view->addFilter('feed', pht('Feed'));
3535
$nav_view->addFilter(null, pht('Tasks').' '.$external_arrow, $tasks_uri);
3636
$nav_view->addFilter(null, pht('Wiki').' '.$external_arrow, $phriction_uri);
37-
$nav_view->addFilter('people', pht('People'));
38-
$nav_view->addFilter('about', pht('About'));
3937

4038
$user = $this->getRequest()->getUser();
4139
$can_edit = PhabricatorPolicyCapability::CAN_EDIT;
4240

41+
$nav_view->addLabel(pht('Manage'));
4342
if (PhabricatorPolicyFilter::hasCapability($user, $project, $can_edit)) {
4443
$nav_view->addFilter('edit', pht("Edit Project"), $edit_uri);
4544
$nav_view->addFilter('members', pht("Edit Members"), $members_uri);
@@ -61,10 +60,6 @@ protected function buildLocalNavigation(PhabricatorProject $project) {
6160
return $nav_view;
6261
}
6362

64-
public function buildApplicationMenu() {
65-
return $this->buildSideNavView(null, true)->getMenu();
66-
}
67-
6863
public function buildSideNavView($filter = null, $for_app = false) {
6964
$user = $this->getRequest()->getUser();
7065

src/applications/project/controller/PhabricatorProjectListController.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,8 @@ public function processRequest() {
144144
'dust' => true,
145145
));
146146
}
147+
148+
public function buildApplicationMenu() {
149+
return $this->buildSideNavView(null, true)->getMenu();
150+
}
147151
}

src/applications/project/controller/PhabricatorProjectProfileController.php

Lines changed: 38 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,8 @@ public function processRequest() {
1818

1919
$query = id(new PhabricatorProjectQuery())
2020
->setViewer($user)
21-
->withIDs(array($this->id));
22-
23-
if ($this->page == 'people') {
24-
$query->needMembers(true);
25-
}
21+
->withIDs(array($this->id))
22+
->needMembers(true);
2623

2724
$project = $query->executeOne();
2825
$this->project = $project;
@@ -42,34 +39,31 @@ public function processRequest() {
4239
$this->page = $nav_view->selectFilter($this->page, 'dashboard');
4340

4441
require_celerity_resource('phabricator-profile-css');
45-
switch ($this->page) {
46-
case 'dashboard':
47-
$content = $this->renderTasksPage($project, $profile);
4842

49-
$query = new PhabricatorFeedQuery();
50-
$query->setFilterPHIDs(
51-
array(
52-
$project->getPHID(),
53-
));
54-
$query->setLimit(50);
55-
$query->setViewer($this->getRequest()->getUser());
56-
$stories = $query->execute();
57-
58-
$content = hsprintf('%s%s', $content, $this->renderStories($stories));
59-
break;
60-
case 'about':
61-
$content = $this->renderAboutPage($project, $profile);
62-
break;
63-
case 'people':
64-
$content = $this->renderPeoplePage($project, $profile);
65-
break;
66-
case 'feed':
67-
$content = $this->renderFeedPage($project, $profile);
68-
break;
69-
default:
70-
throw new Exception("Unimplemented filter '{$this->page}'.");
71-
}
43+
$tasks = $this->renderTasksPage($project, $profile);
44+
45+
$query = new PhabricatorFeedQuery();
46+
$query->setFilterPHIDs(
47+
array(
48+
$project->getPHID(),
49+
));
50+
$query->setLimit(50);
51+
$query->setViewer($this->getRequest()->getUser());
52+
$stories = $query->execute();
53+
$feed = $this->renderStories($stories);
54+
$about = $this->renderAboutPage($project, $profile);
55+
$people = $this->renderPeoplePage($project, $profile);
56+
$col1 = hsprintf('%s%s', $about, $people);
57+
58+
$content = id(new AphrontMultiColumnView())
59+
->addColumn($col1)
60+
->addColumn($feed)
61+
->setFluidLayout(true);
7262

63+
$content = hsprintf(
64+
'<div class="phabricator-project-layout">%s%s</div>',
65+
$tasks,
66+
$content);
7367

7468
$header = new PhabricatorProfileHeaderView();
7569
$header->setName($project->getName());
@@ -111,16 +105,15 @@ public function processRequest() {
111105
}
112106

113107
$header->addAction($action);
114-
115108
$nav_view->appendChild($header);
116-
117-
$content = hsprintf('<div style="padding: 1em;">%s</div>', $content);
118109
$header->appendChild($content);
119110

120111
return $this->buildApplicationPage(
121112
$nav_view,
122113
array(
123114
'title' => pht('%s Project', $project->getName()),
115+
'device' => true,
116+
'dust' => true,
124117
));
125118
}
126119

@@ -140,8 +133,8 @@ private function renderAboutPage(
140133
$timestamp = phabricator_datetime($project->getDateCreated(), $viewer);
141134

142135
$about = hsprintf(
143-
'<div class="phabricator-profile-info-group">
144-
<h1 class="phabricator-profile-info-header">About</h1>
136+
'<div class="phabricator-profile-info-group profile-wrap-responsive">
137+
<h1 class="phabricator-profile-info-header">%s</h1>
145138
<div class="phabricator-profile-info-pane">
146139
<table class="phabricator-profile-info-table">
147140
<tr>
@@ -163,6 +156,7 @@ private function renderAboutPage(
163156
</table>
164157
</div>
165158
</div>',
159+
pht('About This Project'),
166160
pht('Creator'),
167161
$handles[$project->getAuthorPHID()]->renderLink(),
168162
pht('Created'),
@@ -194,7 +188,7 @@ private function renderPeoplePage(
194188
}
195189

196190
return hsprintf(
197-
'<div class="phabricator-profile-info-group">'.
191+
'<div class="phabricator-profile-info-group profile-wrap-responsive">'.
198192
'<h1 class="phabricator-profile-info-header">%s</h1>'.
199193
'<div class="phabricator-profile-info-pane">%s</div>'.
200194
'</div>',
@@ -227,11 +221,9 @@ private function renderStories(array $stories) {
227221
$view = $builder->buildView();
228222

229223
return hsprintf(
230-
'<div class="phabricator-profile-info-group">'.
231-
'<h1 class="phabricator-profile-info-header">%s</h1>'.
232-
'<div class="phabricator-profile-info-pane">%s</div>'.
224+
'<div class="profile-feed profile-wrap-responsive">'.
225+
'%s'.
233226
'</div>',
234-
pht('Activity Feed'),
235227
$view->render());
236228
}
237229

@@ -273,7 +265,7 @@ private function renderTasksPage(
273265
pht("View All Open Tasks \xC2\xBB"));
274266

275267
$content = hsprintf(
276-
'<div class="phabricator-profile-info-group">
268+
'<div class="phabricator-profile-info-group profile-wrap-responsive">
277269
<h1 class="phabricator-profile-info-header">%s</h1>'.
278270
'<div class="phabricator-profile-info-pane">'.
279271
'%s'.
@@ -287,4 +279,8 @@ private function renderTasksPage(
287279
return $content;
288280
}
289281

282+
public function buildApplicationMenu() {
283+
return $this->buildLocalNavigation($this->project)->getMenu();
284+
}
285+
290286
}

0 commit comments

Comments
 (0)