Skip to content

Commit 3fd2c0f

Browse files
committedAug 5, 2013
Re-implement one line stories.
Summary: This puts back the 'one line' story we previously had with the updated design. Test Plan: Review my feed. Reviewers: epriestley, btrahan Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D6666
1 parent 44a883f commit 3fd2c0f

10 files changed

+37
-26
lines changed
 

‎src/__celerity_resource_map__.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3830,7 +3830,7 @@
38303830
),
38313831
'phui-feed-story-css' =>
38323832
array(
3833-
'uri' => '/res/e5d6825b/rsrc/css/phui/phui-feed-story.css',
3833+
'uri' => '/res/5d7ab26c/rsrc/css/phui/phui-feed-story.css',
38343834
'type' => 'css',
38353835
'requires' =>
38363836
array(

‎src/applications/feed/story/PhabricatorFeedStory.php

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ abstract class PhabricatorFeedStory implements PhabricatorPolicyInterface {
1717
private $handles = array();
1818
private $objects = array();
1919

20-
2120
/* -( Loading Stories )---------------------------------------------------- */
2221

2322

‎src/applications/feed/story/PhabricatorFeedStoryAudit.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ public function renderView() {
2323
$this->linkTo($commit_phid)));
2424

2525
$comments = $this->getValue('content');
26-
2726
$view->setImage($this->getHandle($author_phid)->getImageURI());
28-
$content = $this->renderSummary($this->getValue('content'));
29-
$view->appendChild($content);
27+
28+
if ($comments) {
29+
$content = $this->renderSummary($this->getValue('content'));
30+
$view->appendChild($content);
31+
}
3032

3133
return $view;
3234
}

‎src/applications/feed/story/PhabricatorFeedStoryDifferential.php

+14-2
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,21 @@ public function renderView() {
2020

2121
$action = $data->getValue('action');
2222

23+
switch ($action) {
24+
case DifferentialAction::ACTION_CREATE:
25+
case DifferentialAction::ACTION_CLOSE:
26+
$full_size = true;
27+
break;
28+
default:
29+
$full_size = false;
30+
break;
31+
}
32+
2333
$view->setImage($this->getHandle($data->getAuthorPHID())->getImageURI());
24-
$content = $this->renderSummary($data->getValue('feedback_content'));
25-
$view->appendChild($content);
34+
if ($full_size) {
35+
$content = $this->renderSummary($data->getValue('feedback_content'));
36+
$view->appendChild($content);
37+
}
2638

2739
return $view;
2840
}

‎src/applications/feed/story/PhabricatorFeedStoryManiphest.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,14 @@ public function renderView() {
3232
// Don't repeat this at home!
3333
$comments = $data->getValue('comments');
3434
$content = $this->renderSummary($comments);
35+
$view->appendChild($content);
3536
break;
36-
default:
37-
// I think this is just for create
37+
case ManiphestAction::ACTION_CREATE:
3838
$content = $this->renderSummary($data->getValue('description'));
39+
$view->appendChild($content);
3940
break;
4041
}
4142

42-
$view->appendChild($content);
43-
4443
$href = $this->getHandle($data->getValue('taskPHID'))->getURI();
4544
$view->setHref($href);
4645

‎src/applications/feed/story/PhabricatorFeedStoryPhriction.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,12 @@ public function renderView() {
6565
}
6666

6767
$view->setImage($this->getHandle($author_phid)->getImageURI());
68-
$content = $this->renderSummary($data->getValue('content'));
69-
$view->appendChild($content);
68+
switch ($action) {
69+
case PhrictionActionConstants::ACTION_CREATE:
70+
$content = $this->renderSummary($data->getValue('content'));
71+
$view->appendChild($content);
72+
break;
73+
}
7074

7175
return $view;
7276
}

‎src/applications/transactions/feed/PhabricatorApplicationTransactionFeedStory.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ public function renderView() {
4444

4545
$xaction->setHandles($this->getHandles());
4646
$view->setTitle($xaction->getTitleForFeed());
47-
$view->appendChild($xaction->getBodyForFeed());
47+
if (nonempty($xaction->getBodyForFeed())) {
48+
$view->appendChild($xaction->getBodyForFeed());
49+
}
4850

4951
$view->setImage(
5052
$this->getHandle(

‎src/applications/uiexample/examples/PHUIFeedStoryExample.php

-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ public function renderExample() {
128128
->setImage(celerity_get_resource_uri('/rsrc/image/people/harding.png'))
129129
->setImageHref('http://en.wikipedia.org/wiki/Warren_G._Harding')
130130
->setEpoch(1)
131-
->setOneLine(true)
132131
->setAppIcon('differential-dark')
133132
->setUser($user);
134133

‎src/view/phui/PHUIFeedStoryView.php

+4-10
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ final class PHUIFeedStoryView extends AphrontView {
1010
private $epoch;
1111
private $viewed;
1212
private $href;
13-
private $oneline = false;
1413
private $pontification = null;
1514
private $tokenBar = array();
1615
private $projects = array();
@@ -36,11 +35,6 @@ public function setEpoch($epoch) {
3635
return $this;
3736
}
3837

39-
public function setOneLine($oneline) {
40-
$this->oneline = $oneline;
41-
return $this;
42-
}
43-
4438
public function setImage($image) {
4539
$this->image = $image;
4640
return $this;
@@ -86,7 +80,6 @@ public function addAction(PHUIIconView $action) {
8680
}
8781

8882
public function setPontification($text, $title = null) {
89-
$this->setOneLine(false);
9083
if ($title) {
9184
$title = phutil_tag('h3', array(), $title);
9285
}
@@ -130,6 +123,7 @@ public function renderNotification() {
130123
public function render() {
131124

132125
require_celerity_resource('phui-feed-story-css');
126+
$oneline = $this->isEmptyContent($this->renderChildren());
133127

134128
$body = null;
135129
$foot = null;
@@ -174,7 +168,7 @@ public function render() {
174168
}
175169

176170
$ol_foot = null;
177-
if ($this->oneline) {
171+
if ($oneline) {
178172
$ol_foot = phutil_tag(
179173
'div',
180174
array(
@@ -236,7 +230,7 @@ public function render() {
236230
$body_content);
237231
}
238232

239-
if ($this->oneline) {
233+
if ($oneline) {
240234
$foot = null;
241235
} else {
242236
$foot = phutil_tag(
@@ -250,7 +244,7 @@ public function render() {
250244
}
251245

252246
$classes = array('phui-feed-story');
253-
if ($this->oneline) {
247+
if ($oneline) {
254248
$classes[] = 'phui-feed-story-oneline';
255249
}
256250

‎webroot/rsrc/css/phui/phui-feed-story.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
}
8787

8888
.phui-feed-story-oneline .phui-feed-story-head {
89-
padding: 4px;
89+
padding: 8px;
9090
}
9191

9292
.phui-feed-story-oneline .phui-feed-story-body {

0 commit comments

Comments
 (0)
Failed to load comments.