diff --git a/src/applications/phame/controller/blog/PhameBlogManageController.php b/src/applications/phame/controller/blog/PhameBlogManageController.php index 4085d3ef6b..2bdcbf7635 100644 --- a/src/applications/phame/controller/blog/PhameBlogManageController.php +++ b/src/applications/phame/controller/blog/PhameBlogManageController.php @@ -36,7 +36,8 @@ final class PhameBlogManageController extends PhameBlogController { ->setTag('a') ->setText(pht('View Live')) ->setIcon('fa-external-link') - ->setHref($blog->getLiveURI()); + ->setHref($blog->getLiveURI()) + ->setDisabled($blog->isArchived()); $header = id(new PHUIHeaderView()) ->setHeader($blog->getName()) @@ -46,6 +47,16 @@ final class PhameBlogManageController extends PhameBlogController { ->setStatus($header_icon, $header_color, $header_name) ->addActionLink($view); + $can_edit = PhabricatorPolicyFilter::hasCapability( + $viewer, + $blog, + PhabricatorPolicyCapability::CAN_EDIT); + + if ($can_edit) { + $header->setImageEditURL( + $this->getApplicationURI('blog/picture/'.$blog->getID().'/')); + } + $curtain = $this->buildCurtain($blog); $properties = $this->buildPropertyView($blog); $file = $this->buildFileView($blog); diff --git a/src/applications/phame/controller/post/PhamePostViewController.php b/src/applications/phame/controller/post/PhamePostViewController.php index d28f1b5150..f7dddebe53 100644 --- a/src/applications/phame/controller/post/PhamePostViewController.php +++ b/src/applications/phame/controller/post/PhamePostViewController.php @@ -118,7 +118,7 @@ final class PhamePostViewController array( $user_icon, ' ', - $blogger_profile->getTitle(), + $blogger_profile->getDisplayTitle(), )) ->setImage($blogger->getProfileImageURI()) ->setImageHref($author_uri); @@ -142,12 +142,16 @@ final class PhamePostViewController ->setUser($viewer) ->setObject($post); + $is_live = $this->getIsLive(); + $is_external = $this->getIsExternal(); $next_view = new PhameNextPostView(); if ($next) { - $next_view->setNext($next->getTitle(), $next->getLiveURI()); + $next_view->setNext($next->getTitle(), + $next->getBestURI($is_live, $is_external)); } if ($prev) { - $next_view->setPrevious($prev->getTitle(), $prev->getLiveURI()); + $next_view->setPrevious($prev->getTitle(), + $prev->getBestURI($is_live, $is_external)); } $document->setFoot($next_view); diff --git a/src/applications/phame/editor/PhameBlogEditEngine.php b/src/applications/phame/editor/PhameBlogEditEngine.php index 5f96309e8b..7d6511d55c 100644 --- a/src/applications/phame/editor/PhameBlogEditEngine.php +++ b/src/applications/phame/editor/PhameBlogEditEngine.php @@ -96,6 +96,10 @@ final class PhameBlogEditEngine id(new PhabricatorTextEditField()) ->setKey('domainFullURI') ->setLabel(pht('Full Domain URI')) + ->setControlInstructions(pht('Set Full Domain URI if you plan to '. + 'serve this blog on another hosted domain. Parent Site Name and '. + 'Parent Site URI are optional but helpful since they provide '. + 'a link from the blog back to your parent site.')) ->setDescription(pht('Blog full domain URI.')) ->setConduitDescription(pht('Change the blog full domain URI.')) ->setConduitTypeDescription(pht('New blog full domain URI.')) @@ -103,7 +107,7 @@ final class PhameBlogEditEngine ->setTransactionType(PhameBlogTransaction::TYPE_FULLDOMAIN), id(new PhabricatorTextEditField()) ->setKey('parentSite') - ->setLabel(pht('Parent Site')) + ->setLabel(pht('Parent Site Name')) ->setDescription(pht('Blog parent site name.')) ->setConduitDescription(pht('Change the blog parent site name.')) ->setConduitTypeDescription(pht('New blog parent site name.')) @@ -111,7 +115,7 @@ final class PhameBlogEditEngine ->setTransactionType(PhameBlogTransaction::TYPE_PARENTSITE), id(new PhabricatorTextEditField()) ->setKey('parentDomain') - ->setLabel(pht('Parent Domain')) + ->setLabel(pht('Parent Site URI')) ->setDescription(pht('Blog parent domain name.')) ->setConduitDescription(pht('Change the blog parent domain.')) ->setConduitTypeDescription(pht('New blog parent domain.')) diff --git a/src/applications/phame/storage/PhamePost.php b/src/applications/phame/storage/PhamePost.php index 8078c5055c..4c4acf4dc1 100644 --- a/src/applications/phame/storage/PhamePost.php +++ b/src/applications/phame/storage/PhamePost.php @@ -86,6 +86,18 @@ final class PhamePost extends PhameDAO return "/phame/post/view/{$id}/{$slug}/"; } + public function getBestURI($is_live, $is_external) { + if ($is_live) { + if ($is_external) { + return $this->getExternalLiveURI(); + } else { + return $this->getInternalLiveURI(); + } + } else { + return $this->getViewURI(); + } + } + public function getEditURI() { return '/phame/post/edit/'.$this->getID().'/'; }