mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 14:52:41 +01:00
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
This commit is contained in:
parent
44a883f941
commit
3fd2c0ff90
10 changed files with 37 additions and 26 deletions
|
@ -3830,7 +3830,7 @@ celerity_register_resource_map(array(
|
|||
),
|
||||
'phui-feed-story-css' =>
|
||||
array(
|
||||
'uri' => '/res/e5d6825b/rsrc/css/phui/phui-feed-story.css',
|
||||
'uri' => '/res/5d7ab26c/rsrc/css/phui/phui-feed-story.css',
|
||||
'type' => 'css',
|
||||
'requires' =>
|
||||
array(
|
||||
|
|
|
@ -17,7 +17,6 @@ abstract class PhabricatorFeedStory implements PhabricatorPolicyInterface {
|
|||
private $handles = array();
|
||||
private $objects = array();
|
||||
|
||||
|
||||
/* -( Loading Stories )---------------------------------------------------- */
|
||||
|
||||
|
||||
|
|
|
@ -23,10 +23,12 @@ final class PhabricatorFeedStoryAudit extends PhabricatorFeedStory {
|
|||
$this->linkTo($commit_phid)));
|
||||
|
||||
$comments = $this->getValue('content');
|
||||
|
||||
$view->setImage($this->getHandle($author_phid)->getImageURI());
|
||||
|
||||
if ($comments) {
|
||||
$content = $this->renderSummary($this->getValue('content'));
|
||||
$view->appendChild($content);
|
||||
}
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
|
@ -20,9 +20,21 @@ final class PhabricatorFeedStoryDifferential extends PhabricatorFeedStory {
|
|||
|
||||
$action = $data->getValue('action');
|
||||
|
||||
switch ($action) {
|
||||
case DifferentialAction::ACTION_CREATE:
|
||||
case DifferentialAction::ACTION_CLOSE:
|
||||
$full_size = true;
|
||||
break;
|
||||
default:
|
||||
$full_size = false;
|
||||
break;
|
||||
}
|
||||
|
||||
$view->setImage($this->getHandle($data->getAuthorPHID())->getImageURI());
|
||||
if ($full_size) {
|
||||
$content = $this->renderSummary($data->getValue('feedback_content'));
|
||||
$view->appendChild($content);
|
||||
}
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
|
@ -32,15 +32,14 @@ final class PhabricatorFeedStoryManiphest
|
|||
// Don't repeat this at home!
|
||||
$comments = $data->getValue('comments');
|
||||
$content = $this->renderSummary($comments);
|
||||
$view->appendChild($content);
|
||||
break;
|
||||
default:
|
||||
// I think this is just for create
|
||||
case ManiphestAction::ACTION_CREATE:
|
||||
$content = $this->renderSummary($data->getValue('description'));
|
||||
$view->appendChild($content);
|
||||
break;
|
||||
}
|
||||
|
||||
$view->appendChild($content);
|
||||
|
||||
$href = $this->getHandle($data->getValue('taskPHID'))->getURI();
|
||||
$view->setHref($href);
|
||||
|
||||
|
|
|
@ -65,8 +65,12 @@ final class PhabricatorFeedStoryPhriction extends PhabricatorFeedStory {
|
|||
}
|
||||
|
||||
$view->setImage($this->getHandle($author_phid)->getImageURI());
|
||||
switch ($action) {
|
||||
case PhrictionActionConstants::ACTION_CREATE:
|
||||
$content = $this->renderSummary($data->getValue('content'));
|
||||
$view->appendChild($content);
|
||||
break;
|
||||
}
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
|
@ -44,7 +44,9 @@ class PhabricatorApplicationTransactionFeedStory
|
|||
|
||||
$xaction->setHandles($this->getHandles());
|
||||
$view->setTitle($xaction->getTitleForFeed());
|
||||
if (nonempty($xaction->getBodyForFeed())) {
|
||||
$view->appendChild($xaction->getBodyForFeed());
|
||||
}
|
||||
|
||||
$view->setImage(
|
||||
$this->getHandle(
|
||||
|
|
|
@ -128,7 +128,6 @@ final class PHUIFeedStoryExample extends PhabricatorUIExample {
|
|||
->setImage(celerity_get_resource_uri('/rsrc/image/people/harding.png'))
|
||||
->setImageHref('http://en.wikipedia.org/wiki/Warren_G._Harding')
|
||||
->setEpoch(1)
|
||||
->setOneLine(true)
|
||||
->setAppIcon('differential-dark')
|
||||
->setUser($user);
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@ final class PHUIFeedStoryView extends AphrontView {
|
|||
private $epoch;
|
||||
private $viewed;
|
||||
private $href;
|
||||
private $oneline = false;
|
||||
private $pontification = null;
|
||||
private $tokenBar = array();
|
||||
private $projects = array();
|
||||
|
@ -36,11 +35,6 @@ final class PHUIFeedStoryView extends AphrontView {
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function setOneLine($oneline) {
|
||||
$this->oneline = $oneline;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setImage($image) {
|
||||
$this->image = $image;
|
||||
return $this;
|
||||
|
@ -86,7 +80,6 @@ final class PHUIFeedStoryView extends AphrontView {
|
|||
}
|
||||
|
||||
public function setPontification($text, $title = null) {
|
||||
$this->setOneLine(false);
|
||||
if ($title) {
|
||||
$title = phutil_tag('h3', array(), $title);
|
||||
}
|
||||
|
@ -130,6 +123,7 @@ final class PHUIFeedStoryView extends AphrontView {
|
|||
public function render() {
|
||||
|
||||
require_celerity_resource('phui-feed-story-css');
|
||||
$oneline = $this->isEmptyContent($this->renderChildren());
|
||||
|
||||
$body = null;
|
||||
$foot = null;
|
||||
|
@ -174,7 +168,7 @@ final class PHUIFeedStoryView extends AphrontView {
|
|||
}
|
||||
|
||||
$ol_foot = null;
|
||||
if ($this->oneline) {
|
||||
if ($oneline) {
|
||||
$ol_foot = phutil_tag(
|
||||
'div',
|
||||
array(
|
||||
|
@ -236,7 +230,7 @@ final class PHUIFeedStoryView extends AphrontView {
|
|||
$body_content);
|
||||
}
|
||||
|
||||
if ($this->oneline) {
|
||||
if ($oneline) {
|
||||
$foot = null;
|
||||
} else {
|
||||
$foot = phutil_tag(
|
||||
|
@ -250,7 +244,7 @@ final class PHUIFeedStoryView extends AphrontView {
|
|||
}
|
||||
|
||||
$classes = array('phui-feed-story');
|
||||
if ($this->oneline) {
|
||||
if ($oneline) {
|
||||
$classes[] = 'phui-feed-story-oneline';
|
||||
}
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
}
|
||||
|
||||
.phui-feed-story-oneline .phui-feed-story-head {
|
||||
padding: 4px;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.phui-feed-story-oneline .phui-feed-story-body {
|
||||
|
|
Loading…
Reference in a new issue