Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phame/controller/post/PhamePostViewController.php
Show First 20 Lines • Show All 117 Lines • ▼ Show 20 Lines | $about = id(new PhameDescriptionView()) | ||||
array( | array( | ||||
$user_icon, | $user_icon, | ||||
' ', | ' ', | ||||
$blogger_profile->getDisplayTitle(), | $blogger_profile->getDisplayTitle(), | ||||
)) | )) | ||||
->setImage($blogger->getProfileImageURI()) | ->setImage($blogger->getProfileImageURI()) | ||||
->setImageHref($author_uri); | ->setImageHref($author_uri); | ||||
$monogram = $post->getMonogram(); | |||||
$timeline = $this->buildTransactionTimeline( | $timeline = $this->buildTransactionTimeline( | ||||
$post, | $post, | ||||
id(new PhamePostTransactionQuery()) | id(new PhamePostTransactionQuery()) | ||||
->withTransactionTypes(array(PhabricatorTransactions::TYPE_COMMENT))); | ->withTransactionTypes(array(PhabricatorTransactions::TYPE_COMMENT))); | ||||
$timeline = phutil_tag_div('phui-document-view-pro-box', $timeline); | $timeline->setQuoteRef($monogram); | ||||
if ($is_external) { | if ($is_external) { | ||||
$add_comment = null; | $add_comment = null; | ||||
} else { | } else { | ||||
$add_comment = $this->buildCommentForm($post); | $add_comment = $this->buildCommentForm($post, $timeline); | ||||
$add_comment = phutil_tag_div('mlb mlt', $add_comment); | $add_comment = phutil_tag_div('mlb mlt phame-comment-view', $add_comment); | ||||
} | } | ||||
$timeline = phutil_tag_div('phui-document-view-pro-box', $timeline); | |||||
list($prev, $next) = $this->loadAdjacentPosts($post); | list($prev, $next) = $this->loadAdjacentPosts($post); | ||||
$properties = id(new PHUIPropertyListView()) | $properties = id(new PHUIPropertyListView()) | ||||
->setUser($viewer) | ->setUser($viewer) | ||||
->setObject($post); | ->setObject($post); | ||||
$is_live = $this->getIsLive(); | $is_live = $this->getIsLive(); | ||||
$is_external = $this->getIsExternal(); | $is_external = $this->getIsExternal(); | ||||
▲ Show 20 Lines • Show All 121 Lines • ▼ Show 20 Lines | if (!$post->isArchived()) { | ||||
->setIcon('fa-globe') | ->setIcon('fa-globe') | ||||
->setHref($post->getLiveURI()) | ->setHref($post->getLiveURI()) | ||||
->setName($live_name)); | ->setName($live_name)); | ||||
} | } | ||||
return $actions; | return $actions; | ||||
} | } | ||||
private function buildCommentForm(PhamePost $post) { | private function buildCommentForm(PhamePost $post, $timeline) { | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
$draft = PhabricatorDraft::newFromUserAndKey( | $box = id(new PhamePostEditEngine()) | ||||
$viewer, $post->getPHID()); | ->setViewer($viewer) | ||||
->buildEditEngineCommentView($post) | |||||
$box = id(new PhabricatorApplicationTransactionCommentView()) | ->setTransactionTimeline($timeline); | ||||
->setUser($viewer) | |||||
->setObjectPHID($post->getPHID()) | |||||
->setDraft($draft) | |||||
->setHeaderText(pht('Add Comment')) | |||||
->setAction($this->getApplicationURI('post/comment/'.$post->getID().'/')) | |||||
->setSubmitButtonName(pht('Add Comment')); | |||||
return phutil_tag_div('phui-document-view-pro-box', $box); | return phutil_tag_div('phui-document-view-pro-box', $box); | ||||
} | } | ||||
private function loadAdjacentPosts(PhamePost $post) { | private function loadAdjacentPosts(PhamePost $post) { | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
$query = id(new PhamePostQuery()) | $query = id(new PhamePostQuery()) | ||||
Show All 17 Lines |