@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.

Spiffy up PhamePostView

Summary: Cleaner Author information, less "Properties", Build a History Page. Ref T9897

Test Plan:
Review New Posts, Draft Posts, View History

{F1012934}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9897

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

+107 -32
+2 -2
resources/celerity/map.php
··· 82 82 'rsrc/css/application/owners/owners-path-editor.css' => '2f00933b', 83 83 'rsrc/css/application/paste/paste.css' => 'b2f5a543', 84 84 'rsrc/css/application/people/people-profile.css' => '25970776', 85 - 'rsrc/css/application/phame/phame.css' => '46166309', 85 + 'rsrc/css/application/phame/phame.css' => 'cea3c9e1', 86 86 'rsrc/css/application/pholio/pholio-edit.css' => '3ad9d1ee', 87 87 'rsrc/css/application/pholio/pholio-inline-comments.css' => '8e545e49', 88 88 'rsrc/css/application/pholio/pholio.css' => '95174bdd', ··· 776 776 'phabricator-uiexample-reactor-sendclass' => '1def2711', 777 777 'phabricator-uiexample-reactor-sendproperties' => 'b1f0ccee', 778 778 'phabricator-zindex-css' => '57ddcaa2', 779 - 'phame-css' => '46166309', 779 + 'phame-css' => 'cea3c9e1', 780 780 'pholio-css' => '95174bdd', 781 781 'pholio-edit-css' => '3ad9d1ee', 782 782 'pholio-inline-comments-css' => '8e545e49',
+2
src/__phutil_library_map__.php
··· 3327 3327 'PhamePostEditController' => 'applications/phame/controller/post/PhamePostEditController.php', 3328 3328 'PhamePostEditor' => 'applications/phame/editor/PhamePostEditor.php', 3329 3329 'PhamePostFramedController' => 'applications/phame/controller/post/PhamePostFramedController.php', 3330 + 'PhamePostHistoryController' => 'applications/phame/controller/post/PhamePostHistoryController.php', 3330 3331 'PhamePostListController' => 'applications/phame/controller/post/PhamePostListController.php', 3331 3332 'PhamePostListView' => 'applications/phame/view/PhamePostListView.php', 3332 3333 'PhamePostMailReceiver' => 'applications/phame/mail/PhamePostMailReceiver.php', ··· 7668 7669 'PhamePostEditController' => 'PhamePostController', 7669 7670 'PhamePostEditor' => 'PhabricatorApplicationTransactionEditor', 7670 7671 'PhamePostFramedController' => 'PhamePostController', 7672 + 'PhamePostHistoryController' => 'PhamePostController', 7671 7673 'PhamePostListController' => 'PhamePostController', 7672 7674 'PhamePostListView' => 'AphrontTagView', 7673 7675 'PhamePostMailReceiver' => 'PhabricatorObjectMailReceiver',
+1
src/applications/phame/application/PhabricatorPhameApplication.php
··· 45 45 '(?:query/(?P<queryKey>[^/]+)/)?' => 'PhamePostListController', 46 46 'blogger/(?P<bloggername>[\w\.-_]+)/' => 'PhamePostListController', 47 47 'edit/(?:(?P<id>[^/]+)/)?' => 'PhamePostEditController', 48 + 'history/(?P<id>\d+)/' => 'PhamePostHistoryController', 48 49 'view/(?P<id>\d+)/' => 'PhamePostViewController', 49 50 'publish/(?P<id>\d+)/' => 'PhamePostPublishController', 50 51 'preview/(?P<id>\d+)/' => 'PhamePostPreviewController',
+1 -1
src/applications/phame/controller/blog/PhameBlogViewController.php
··· 84 84 } 85 85 86 86 $about = id(new PhameDescriptionView()) 87 - ->setTitle($blog->getName()) 87 + ->setTitle(pht('About %s', $blog->getName())) 88 88 ->setDescription($description) 89 89 ->setImage($blog->getProfileImageURI()); 90 90
+55
src/applications/phame/controller/post/PhamePostHistoryController.php
··· 1 + <?php 2 + 3 + final class PhamePostHistoryController extends PhamePostController { 4 + 5 + public function shouldAllowPublic() { 6 + return true; 7 + } 8 + 9 + public function handleRequest(AphrontRequest $request) { 10 + $viewer = $request->getViewer(); 11 + 12 + $post = id(new PhamePostQuery()) 13 + ->setViewer($viewer) 14 + ->withIDs(array($request->getURIData('id'))) 15 + ->executeOne(); 16 + 17 + if (!$post) { 18 + return new Aphront404Response(); 19 + } 20 + 21 + $blog = $post->getBlog(); 22 + 23 + $crumbs = $this->buildApplicationCrumbs(); 24 + if ($blog) { 25 + $crumbs->addTextCrumb( 26 + $blog->getName(), 27 + $this->getApplicationURI('blog/view/'.$blog->getID().'/')); 28 + } else { 29 + $crumbs->addTextCrumb( 30 + pht('[No Blog]'), 31 + null); 32 + } 33 + $crumbs->addTextCrumb( 34 + $post->getTitle(), 35 + $this->getApplicationURI('post/view/'.$post->getID().'/')); 36 + $crumbs->addTextCrumb(pht('Post History')); 37 + $crumbs->setBorder(true); 38 + 39 + $timeline = $this->buildTransactionTimeline( 40 + $post, 41 + new PhamePostTransactionQuery()); 42 + $timeline->setShouldTerminate(true); 43 + 44 + return $this->newPage() 45 + ->setTitle($post->getTitle()) 46 + ->setPageObjectPHIDs(array($post->getPHID())) 47 + ->setCrumbs($crumbs) 48 + ->appendChild( 49 + array( 50 + $timeline, 51 + )); 52 + } 53 + 54 + 55 + }
+40 -28
src/applications/phame/controller/post/PhamePostViewController.php
··· 36 36 $crumbs->setBorder(true); 37 37 38 38 $actions = $this->renderActions($post, $viewer); 39 - $properties = $this->renderProperties($post, $viewer); 40 39 41 40 $action_button = id(new PHUIButtonView()) 42 41 ->setTag('a') ··· 90 89 ), 91 90 $engine->getOutput($post, PhamePost::MARKUP_FIELD_BODY))); 92 91 92 + $blogger = id(new PhabricatorPeopleQuery()) 93 + ->setViewer($viewer) 94 + ->withPHIDs(array($post->getBloggerPHID())) 95 + ->needProfileImage(true) 96 + ->executeOne(); 97 + $blogger_profile = $blogger->loadUserProfile(); 98 + 99 + $author = phutil_tag( 100 + 'a', 101 + array( 102 + 'href' => '/p/'.$blogger->getUsername().'/', 103 + ), 104 + $blogger->getUsername()); 105 + 106 + $date = phabricator_datetime($post->getDatePublished(), $viewer); 107 + if ($post->isDraft()) { 108 + $subtitle = pht('Unpublished draft by %s.', $author); 109 + } else { 110 + $subtitle = pht('Written by %s on %s.', $author, $date); 111 + } 112 + 113 + $about = id(new PhameDescriptionView()) 114 + ->setTitle($subtitle) 115 + ->setDescription($blogger_profile->getTitle()) 116 + ->setImage($blogger->getProfileImageURI()) 117 + ->setImageHref('/p/'.$blogger->getUsername()); 118 + 93 119 $timeline = $this->buildTransactionTimeline( 94 120 $post, 95 121 id(new PhamePostTransactionQuery()) ··· 98 124 99 125 $add_comment = $this->buildCommentForm($post); 100 126 $add_comment = phutil_tag_div('mlb mlt', $add_comment); 127 + 128 + $properties = id(new PHUIPropertyListView()) 129 + ->setUser($viewer) 130 + ->setObject($post); 131 + 132 + $properties->invokeWillRenderEvent(); 101 133 102 134 return $this->newPage() 103 135 ->setTitle($post->getTitle()) ··· 106 138 ->appendChild( 107 139 array( 108 140 $document, 141 + $about, 109 142 $properties, 110 143 $timeline, 111 144 $add_comment, ··· 143 176 ->setName(pht('Move Post')) 144 177 ->setDisabled(!$can_edit) 145 178 ->setWorkflow(!$can_edit)); 179 + 180 + $actions->addAction( 181 + id(new PhabricatorActionView()) 182 + ->setIcon('fa-history') 183 + ->setHref($this->getApplicationURI('post/history/'.$id.'/')) 184 + ->setName(pht('View History'))); 146 185 147 186 if ($post->isDraft()) { 148 187 $actions->addAction( ··· 188 227 ->setWorkflow(!$can_view_live)); 189 228 190 229 return $actions; 191 - } 192 - 193 - private function renderProperties( 194 - PhamePost $post, 195 - PhabricatorUser $viewer) { 196 - 197 - $properties = id(new PHUIPropertyListView()) 198 - ->setUser($viewer) 199 - ->setObject($post); 200 - 201 - $properties->addProperty( 202 - pht('Blog'), 203 - $viewer->renderHandle($post->getBlogPHID())); 204 - 205 - $properties->addProperty( 206 - pht('Blogger'), 207 - $viewer->renderHandle($post->getBloggerPHID())); 208 - 209 - $properties->addProperty( 210 - pht('Published'), 211 - $post->isDraft() 212 - ? pht('Draft') 213 - : phabricator_datetime($post->getDatePublished(), $viewer)); 214 - 215 - $properties->invokeWillRenderEvent(); 216 - 217 - return $properties; 218 230 } 219 231 220 232 private function buildCommentForm(PhamePost $post) {
+1 -1
src/applications/phame/view/PhameDescriptionView.php
··· 52 52 array( 53 53 'class' => 'phame-blog-description-name', 54 54 ), 55 - pht('About %s', $this->title)); 55 + $this->title); 56 56 57 57 return array($image, $header, $description); 58 58 }
+5
webroot/rsrc/css/application/phame/phame.css
··· 29 29 border-radius: 3px; 30 30 position: absolute; 31 31 } 32 + 33 + .phame-blog-description + .phui-property-list-section { 34 + border-top: 1px solid rgba(71, 87, 120, 0.20); 35 + padding-top: 16px; 36 + }