Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phame/controller/post/PhamePostViewController.php
Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | public function handleRequest(AphrontRequest $request) { | ||||
} | } | ||||
if ($post->isDraft()) { | if ($post->isDraft()) { | ||||
$document->appendChild( | $document->appendChild( | ||||
id(new PHUIInfoView()) | id(new PHUIInfoView()) | ||||
->setSeverity(PHUIInfoView::SEVERITY_NOTICE) | ->setSeverity(PHUIInfoView::SEVERITY_NOTICE) | ||||
->setTitle(pht('Draft Post')) | ->setTitle(pht('Draft Post')) | ||||
->appendChild( | ->appendChild( | ||||
pht( | pht('Only you can see this draft until you publish it. '. | ||||
'Only you can see this draft until you publish it. '. | 'Use "Preview" or "Publish" to publish this post.'))); | ||||
'Use "Preview or Publish" to publish this post.'))); | |||||
} | } | ||||
if (!$post->getBlog()) { | if (!$post->getBlog()) { | ||||
$document->appendChild( | $document->appendChild( | ||||
id(new PHUIInfoView()) | id(new PHUIInfoView()) | ||||
->setSeverity(PHUIInfoView::SEVERITY_WARNING) | ->setSeverity(PHUIInfoView::SEVERITY_WARNING) | ||||
->setTitle(pht('Not On A Blog')) | ->setTitle(pht('Not On A Blog')) | ||||
->appendChild( | ->appendChild( | ||||
pht( | pht('This post is not associated with a blog (the blog may have '. | ||||
'This post is not associated with a blog (the blog may have '. | |||||
'been deleted). Use "Move Post" to move it to a new blog.'))); | 'been deleted). Use "Move Post" to move it to a new blog.'))); | ||||
} | } | ||||
$engine = id(new PhabricatorMarkupEngine()) | $engine = id(new PhabricatorMarkupEngine()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->addObject($post, PhamePost::MARKUP_FIELD_BODY) | ->addObject($post, PhamePost::MARKUP_FIELD_BODY) | ||||
->process(); | ->process(); | ||||
$document->appendChild( | $document->appendChild( | ||||
▲ Show 20 Lines • Show All 102 Lines • ▼ Show 20 Lines | if ($post->isDraft()) { | ||||
id(new PhabricatorActionView()) | id(new PhabricatorActionView()) | ||||
->setIcon('fa-eye') | ->setIcon('fa-eye') | ||||
->setHref($this->getApplicationURI('post/publish/'.$id.'/')) | ->setHref($this->getApplicationURI('post/publish/'.$id.'/')) | ||||
->setDisabled(!$can_edit) | ->setDisabled(!$can_edit) | ||||
->setName(pht('Publish')) | ->setName(pht('Publish')) | ||||
->setWorkflow(true)); | ->setWorkflow(true)); | ||||
$actions->addAction( | $actions->addAction( | ||||
id(new PhabricatorActionView()) | id(new PhabricatorActionView()) | ||||
->setIcon('fa-eye') | ->setIcon('fa-desktop') | ||||
->setHref($this->getApplicationURI('post/preview/'.$id.'/')) | ->setHref($this->getApplicationURI('post/preview/'.$id.'/')) | ||||
->setDisabled(!$can_edit) | ->setDisabled(!$can_edit) | ||||
->setName(pht('Preview in Skin'))); | ->setName(pht('Preview in Skin'))); | ||||
} else { | } else { | ||||
$actions->addAction( | $actions->addAction( | ||||
id(new PhabricatorActionView()) | id(new PhabricatorActionView()) | ||||
->setIcon('fa-eye-slash') | ->setIcon('fa-eye-slash') | ||||
->setHref($this->getApplicationURI('post/unpublish/'.$id.'/')) | ->setHref($this->getApplicationURI('post/unpublish/'.$id.'/')) | ||||
▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines |