public function renderView()
 {
     $data = $this->getStoryData();
     $view = new PhabricatorFeedStoryView();
     $line = $this->getLineForData($data);
     $view->setTitle($line);
     $view->setEpoch($data->getEpoch());
     $action = $data->getValue('action');
     switch ($action) {
         case DifferentialAction::ACTION_CREATE:
         case DifferentialAction::ACTION_CLOSE:
             $full_size = true;
             break;
         default:
             $full_size = false;
             break;
     }
     if ($full_size) {
         $view->setImage($this->getHandle($data->getAuthorPHID())->getImageURI());
         $content = $this->renderSummary($data->getValue('feedback_content'));
         $view->appendChild($content);
     } else {
         $view->setOneLineStory(true);
     }
     return $view;
 }
 public function renderView()
 {
     $data = $this->getStoryData();
     $author_phid = $data->getAuthorPHID();
     $document_phid = $data->getValue('phid');
     $view = new PhabricatorFeedStoryView();
     $action = $data->getValue('action');
     $verb = PhrictionActionConstants::getActionPastTenseVerb($action);
     $view->setTitle($this->linkTo($author_phid) . " {$verb} the document " . $this->linkTo($document_phid) . '.');
     $view->setEpoch($data->getEpoch());
     $action = $data->getValue('action');
     switch ($action) {
         case PhrictionActionConstants::ACTION_CREATE:
             $full_size = true;
             break;
         default:
             $full_size = false;
             break;
     }
     if ($full_size) {
         $view->setImage($this->getHandle($author_phid)->getImageURI());
         $content = $this->renderSummary($data->getValue('content'));
         $view->appendChild($content);
     } else {
         $view->setOneLineStory(true);
     }
     return $view;
 }
 public function renderView()
 {
     $data = $this->getStoryData();
     $author_phid = $data->getAuthorPHID();
     $view = new PhabricatorFeedStoryView();
     $revision_phid = $data->getValue('revision_phid');
     $action = $data->getValue('action');
     $verb = DifferentialAction::getActionPastTenseVerb($action);
     $view->setTitle($this->linkTo($author_phid) . " {$verb} revision " . $this->linkTo($revision_phid) . '.');
     $view->setEpoch($data->getEpoch());
     $action = $data->getValue('action');
     switch ($action) {
         case DifferentialAction::ACTION_CREATE:
         case DifferentialAction::ACTION_COMMIT:
             $full_size = true;
             break;
         default:
             $full_size = false;
             break;
     }
     if ($full_size) {
         $view->setImage($this->getHandle($author_phid)->getImageURI());
         $content = $this->renderSummary($data->getValue('feedback_content'));
         $view->appendChild($content);
     } else {
         $view->setOneLineStory(true);
     }
     return $view;
 }
 public function renderView()
 {
     $data = $this->getStoryData();
     $author_phid = $data->getAuthorPHID();
     $commit_phid = $data->getValue('commitPHID');
     $view = new PhabricatorFeedStoryView();
     $action = $data->getValue('action');
     $verb = PhabricatorAuditActionConstants::getActionPastTenseVerb($action);
     $view->setTitle($this->linkTo($author_phid) . " {$verb} commit " . $this->linkTo($commit_phid) . ".");
     $view->setEpoch($data->getEpoch());
     $comments = $data->getValue('content');
     if ($comments) {
         $full_size = true;
     } else {
         $full_size = false;
     }
     if ($full_size) {
         $view->setImage($this->getHandle($author_phid)->getImageURI());
         $content = $this->renderSummary($data->getValue('content'));
         $view->appendChild($content);
     } else {
         $view->setOneLineStory(true);
     }
     return $view;
 }
 public function renderView()
 {
     $data = $this->getStoryData();
     $handles = $this->getHandles();
     $author_phid = $data->getAuthorPHID();
     $document_phid = $data->getValue('phid');
     $objects = $this->getObjects();
     $view = new PhabricatorFeedStoryView();
     $action = $data->getValue('action');
     $verb = PhrictionActionConstants::getActionPastTenseVerb($action);
     $view->setTitle('<strong>' . $handles[$author_phid]->renderLink() . '</strong>' . ' ' . $verb . ' the document ' . '<strong>' . $handles[$document_phid]->renderLink() . '</strong>.');
     $view->setEpoch($data->getEpoch());
     $action = $data->getValue('action');
     switch ($action) {
         case PhrictionActionConstants::ACTION_CREATE:
             $full_size = true;
             break;
         default:
             $full_size = false;
             break;
     }
     if ($full_size) {
         if (!empty($objects[$author_phid])) {
             $image_phid = $objects[$author_phid]->getProfileImagePHID();
             $image_uri = PhabricatorFileURI::getViewURIForPHID($image_phid);
             $view->setImage($image_uri);
         }
         $content = phutil_escape_html($data->getValue('content'));
         $content = str_replace("\n", '<br />', $content);
         $view->appendChild($content);
     } else {
         $view->setOneLineStory(true);
     }
     return $view;
 }
 public function renderView()
 {
     $data = $this->getStoryData();
     $view = new PhabricatorFeedStoryView();
     $view->setTitle('Unknown Story');
     $view->setEpoch($data->getEpoch());
     $view->appendChild('This is an unrenderable feed story of type ' . '"' . phutil_escape_html($data->getStoryType()) . '".');
     return $view;
 }
 public function renderView()
 {
     $data = $this->getStoryData();
     $author_phid = $data->getAuthorPHID();
     $view = new PhabricatorFeedStoryView();
     $view->setTitle($this->linkTo($author_phid));
     $view->setEpoch($data->getEpoch());
     $view->setImage($this->getHandle($author_phid)->getImageURI());
     $content = $this->renderSummary($data->getValue('content'), $len = null);
     $view->appendChild($content);
     return $view;
 }
 public function renderView()
 {
     $data = $this->getStoryData();
     $author_phid = $data->getAuthorPHID();
     $owner_phid = $data->getValue('ownerPHID');
     $task_phid = $data->getValue('taskPHID');
     $objects = $this->getObjects();
     $action = $data->getValue('action');
     $view = new PhabricatorFeedStoryView();
     $verb = ManiphestAction::getActionPastTenseVerb($action);
     $extra = null;
     switch ($action) {
         case ManiphestAction::ACTION_ASSIGN:
             if ($owner_phid) {
                 $extra = ' to ' . '<strong>' . $this->getHandle($owner_phid)->renderLink() . '</strong>';
             } else {
                 $verb = 'placed';
                 $extra = ' up for grabs';
             }
             break;
     }
     $title = '<strong>' . $this->getHandle($author_phid)->renderLink() . '</strong>' . " {$verb} task " . '<strong>' . $this->getHandle($task_phid)->renderLink() . '</strong>';
     $title .= $extra;
     $title .= '.';
     $view->setTitle($title);
     switch ($action) {
         case ManiphestAction::ACTION_CREATE:
             $full_size = true;
             break;
         default:
             $full_size = false;
             break;
     }
     $view->setEpoch($data->getEpoch());
     if ($full_size) {
         if (!empty($objects[$author_phid])) {
             $image_phid = $objects[$author_phid]->getProfileImagePHID();
             $image_uri = PhabricatorFileURI::getViewURIForPHID($image_phid);
             $view->setImage($image_uri);
         }
         $content = phutil_escape_html(phutil_utf8_shorten($data->getValue('description'), 128));
         $content = str_replace("\n", '<br />', $content);
         $view->appendChild($content);
     } else {
         $view->setOneLineStory(true);
     }
     return $view;
 }
 public function renderView()
 {
     $data = $this->getStoryData();
     $handles = $this->getHandles();
     $author_phid = $data->getAuthorPHID();
     $objects = $this->getObjects();
     $view = new PhabricatorFeedStoryView();
     $view->setTitle('<strong>' . $handles[$author_phid]->renderLink() . '</strong>');
     $view->setEpoch($data->getEpoch());
     if (!empty($objects[$author_phid])) {
         $image_phid = $objects[$author_phid]->getProfileImagePHID();
         $image_uri = PhabricatorFileURI::getViewURIForPHID($image_phid);
         $view->setImage($image_uri);
     }
     $content = phutil_escape_html($data->getValue('content'));
     $content = str_replace("\n", '<br />', $content);
     $view->appendChild($content);
     return $view;
 }
 public function renderView()
 {
     $data = $this->getStoryData();
     $author_phid = $data->getAuthorPHID();
     $owner_phid = $data->getValue('ownerPHID');
     $task_phid = $data->getValue('taskPHID');
     $action = $data->getValue('action');
     $view = new PhabricatorFeedStoryView();
     $verb = ManiphestAction::getActionPastTenseVerb($action);
     $extra = null;
     switch ($action) {
         case ManiphestAction::ACTION_ASSIGN:
             if ($owner_phid) {
                 $extra = ' to ' . $this->linkTo($owner_phid);
             } else {
                 $verb = 'placed';
                 $extra = ' up for grabs';
             }
             break;
     }
     $title = $this->linkTo($author_phid) . " {$verb} task " . $this->linkTo($task_phid);
     $title .= $extra;
     $title .= '.';
     $view->setTitle($title);
     switch ($action) {
         case ManiphestAction::ACTION_CREATE:
             $full_size = true;
             break;
         default:
             $full_size = false;
             break;
     }
     $view->setEpoch($data->getEpoch());
     if ($full_size) {
         $view->setImage($this->getHandle($author_phid)->getImageURI());
         $content = $this->renderSummary($data->getValue('description'));
         $view->appendChild($content);
     } else {
         $view->setOneLineStory(true);
     }
     return $view;
 }
 public function renderView()
 {
     $data = $this->getStoryData();
     $author = null;
     if ($data->getValue('authorPHID')) {
         $author = $this->linkTo($data->getValue('authorPHID'));
     } else {
         $author = phutil_escape_html($data->getValue('authorName'));
     }
     $committer = null;
     if ($data->getValue('committerPHID')) {
         $committer = $this->linkTo($data->getValue('committerPHID'));
     } else {
         if ($data->getValue('committerName')) {
             $committer = phutil_escape_html($data->getValue('committerName'));
         }
     }
     $commit = $this->linkTo($data->getValue('commitPHID'));
     if (!$committer) {
         $committer = $author;
         $author = null;
     }
     if ($author) {
         $title = "{$committer} committed {$commit} (authored by {$author})";
     } else {
         $title = "{$committer} committed {$commit}";
     }
     $view = new PhabricatorFeedStoryView();
     $view->setTitle($title);
     $view->setEpoch($data->getEpoch());
     if ($data->getValue('authorPHID')) {
         $view->setImage($this->getHandle($data->getAuthorPHID())->getImageURI());
     }
     $content = $this->renderSummary($data->getValue('summary'));
     $view->appendChild($content);
     return $view;
 }