@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Misc Phame cleanup

Summary:
Ref T9360.

[x] View Live useless on archived blogs
[x] Edit Blog Image treatment like profiles
[x] Pager next/prev should keep you on whatever view you're on
[x] Unset user titles aren't falling back properly
[x] Add captions to edit fields for better clarification

Test Plan: Archive a blog, Edit a photo, verify pager on live and internal blogs, check empty titles, and view new edit form instructions.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9360

Differential Revision: https://secure.phabricator.com/D16197

+37 -6
+12 -1
src/applications/phame/controller/blog/PhameBlogManageController.php
··· 36 36 ->setTag('a') 37 37 ->setText(pht('View Live')) 38 38 ->setIcon('fa-external-link') 39 - ->setHref($blog->getLiveURI()); 39 + ->setHref($blog->getLiveURI()) 40 + ->setDisabled($blog->isArchived()); 40 41 41 42 $header = id(new PHUIHeaderView()) 42 43 ->setHeader($blog->getName()) ··· 45 46 ->setImage($picture) 46 47 ->setStatus($header_icon, $header_color, $header_name) 47 48 ->addActionLink($view); 49 + 50 + $can_edit = PhabricatorPolicyFilter::hasCapability( 51 + $viewer, 52 + $blog, 53 + PhabricatorPolicyCapability::CAN_EDIT); 54 + 55 + if ($can_edit) { 56 + $header->setImageEditURL( 57 + $this->getApplicationURI('blog/picture/'.$blog->getID().'/')); 58 + } 48 59 49 60 $curtain = $this->buildCurtain($blog); 50 61 $properties = $this->buildPropertyView($blog);
+7 -3
src/applications/phame/controller/post/PhamePostViewController.php
··· 118 118 array( 119 119 $user_icon, 120 120 ' ', 121 - $blogger_profile->getTitle(), 121 + $blogger_profile->getDisplayTitle(), 122 122 )) 123 123 ->setImage($blogger->getProfileImageURI()) 124 124 ->setImageHref($author_uri); ··· 142 142 ->setUser($viewer) 143 143 ->setObject($post); 144 144 145 + $is_live = $this->getIsLive(); 146 + $is_external = $this->getIsExternal(); 145 147 $next_view = new PhameNextPostView(); 146 148 if ($next) { 147 - $next_view->setNext($next->getTitle(), $next->getLiveURI()); 149 + $next_view->setNext($next->getTitle(), 150 + $next->getBestURI($is_live, $is_external)); 148 151 } 149 152 if ($prev) { 150 - $next_view->setPrevious($prev->getTitle(), $prev->getLiveURI()); 153 + $next_view->setPrevious($prev->getTitle(), 154 + $prev->getBestURI($is_live, $is_external)); 151 155 } 152 156 153 157 $document->setFoot($next_view);
+6 -2
src/applications/phame/editor/PhameBlogEditEngine.php
··· 96 96 id(new PhabricatorTextEditField()) 97 97 ->setKey('domainFullURI') 98 98 ->setLabel(pht('Full Domain URI')) 99 + ->setControlInstructions(pht('Set Full Domain URI if you plan to '. 100 + 'serve this blog on another hosted domain. Parent Site Name and '. 101 + 'Parent Site URI are optional but helpful since they provide '. 102 + 'a link from the blog back to your parent site.')) 99 103 ->setDescription(pht('Blog full domain URI.')) 100 104 ->setConduitDescription(pht('Change the blog full domain URI.')) 101 105 ->setConduitTypeDescription(pht('New blog full domain URI.')) ··· 103 107 ->setTransactionType(PhameBlogTransaction::TYPE_FULLDOMAIN), 104 108 id(new PhabricatorTextEditField()) 105 109 ->setKey('parentSite') 106 - ->setLabel(pht('Parent Site')) 110 + ->setLabel(pht('Parent Site Name')) 107 111 ->setDescription(pht('Blog parent site name.')) 108 112 ->setConduitDescription(pht('Change the blog parent site name.')) 109 113 ->setConduitTypeDescription(pht('New blog parent site name.')) ··· 111 115 ->setTransactionType(PhameBlogTransaction::TYPE_PARENTSITE), 112 116 id(new PhabricatorTextEditField()) 113 117 ->setKey('parentDomain') 114 - ->setLabel(pht('Parent Domain')) 118 + ->setLabel(pht('Parent Site URI')) 115 119 ->setDescription(pht('Blog parent domain name.')) 116 120 ->setConduitDescription(pht('Change the blog parent domain.')) 117 121 ->setConduitTypeDescription(pht('New blog parent domain.'))
+12
src/applications/phame/storage/PhamePost.php
··· 86 86 return "/phame/post/view/{$id}/{$slug}/"; 87 87 } 88 88 89 + public function getBestURI($is_live, $is_external) { 90 + if ($is_live) { 91 + if ($is_external) { 92 + return $this->getExternalLiveURI(); 93 + } else { 94 + return $this->getInternalLiveURI(); 95 + } 96 + } else { 97 + return $this->getViewURI(); 98 + } 99 + } 100 + 89 101 public function getEditURI() { 90 102 return '/phame/post/edit/'.$this->getID().'/'; 91 103 }