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