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

Merge branch 'master' of github.com:facebook/phabricator

+154 -120
+4 -2
src/applications/diffusion/controller/DiffusionCommitController.php
··· 86 86 $commit_data, 87 87 $parent_query->loadParents()); 88 88 $property_list = id(new PhabricatorPropertyListView()) 89 - ->setHasKeyboardShortcuts(true); 89 + ->setHasKeyboardShortcuts(true) 90 + ->setUser($user) 91 + ->setObject($commit); 90 92 foreach ($commit_properties as $key => $value) { 91 93 $property_list->addProperty($key, $value); 92 94 } ··· 98 100 99 101 $message = $engine->markupText($message); 100 102 103 + $property_list->invokeWillRenderEvent(); 101 104 $property_list->addTextContent( 102 105 phutil_tag( 103 106 'div', ··· 105 108 'class' => 'diffusion-commit-message phabricator-remarkup', 106 109 ), 107 110 $message)); 108 - 109 111 $content[] = $top_anchor; 110 112 $content[] = $headsup_view; 111 113 $content[] = $headsup_actions;
+3 -1
src/applications/paste/controller/PhabricatorPasteViewController.php
··· 120 120 array $child_phids) { 121 121 122 122 $user = $this->getRequest()->getUser(); 123 - $properties = new PhabricatorPropertyListView(); 123 + $properties = id(new PhabricatorPropertyListView()) 124 + ->setUser($user) 125 + ->setObject($paste); 124 126 125 127 $properties->addProperty( 126 128 pht('Author'),
+9 -1
src/applications/paste/storage/PhabricatorPaste.php
··· 1 1 <?php 2 2 3 3 final class PhabricatorPaste extends PhabricatorPasteDAO 4 - implements PhabricatorPolicyInterface { 4 + implements PhabricatorTokenReceiverInterface, PhabricatorPolicyInterface { 5 5 6 6 protected $phid; 7 7 protected $title; ··· 77 77 public function attachRawContent($raw_content) { 78 78 $this->rawContent = $raw_content; 79 79 return $this; 80 + } 81 + 82 + /* -( PhabricatorTokenReceiverInterface )---------------------------------- */ 83 + 84 + public function getUsersToNotifyOfTokenGiven() { 85 + return array( 86 + $this->getAuthorPHID(), 87 + ); 80 88 } 81 89 82 90 }
+5 -1
src/applications/phame/controller/post/PhamePostViewController.php
··· 162 162 PhamePost $post, 163 163 PhabricatorUser $user) { 164 164 165 - $properties = new PhabricatorPropertyListView(); 165 + $properties = id(new PhabricatorPropertyListView()) 166 + ->setUser($user) 167 + ->setObject($post); 166 168 167 169 $descriptions = PhabricatorPolicyQuery::renderPolicyDescriptions( 168 170 $user, ··· 192 194 ->setViewer($user) 193 195 ->addObject($post, PhamePost::MARKUP_FIELD_BODY) 194 196 ->process(); 197 + 198 + $properties->invokeWillRenderEvent(); 195 199 196 200 $properties->addTextContent( 197 201 phutil_tag(
+12 -1
src/applications/phame/storage/PhamePost.php
··· 4 4 * @group phame 5 5 */ 6 6 final class PhamePost extends PhameDAO 7 - implements PhabricatorPolicyInterface, PhabricatorMarkupInterface { 7 + implements 8 + PhabricatorPolicyInterface, 9 + PhabricatorMarkupInterface, 10 + PhabricatorTokenReceiverInterface { 8 11 9 12 const MARKUP_FIELD_BODY = 'markup:body'; 10 13 const MARKUP_FIELD_SUMMARY = 'markup:summary'; ··· 180 183 181 184 public function shouldUseMarkupCache($field) { 182 185 return (bool)$this->getPHID(); 186 + } 187 + 188 + /* -( PhabricatorTokenReceiverInterface )---------------------------------- */ 189 + 190 + public function getUsersToNotifyOfTokenGiven() { 191 + return array( 192 + $this->getBloggerPHID(), 193 + ); 183 194 } 184 195 185 196 }
+88 -96
src/applications/phriction/controller/PhrictionDocumentController.php
··· 31 31 32 32 $version_note = null; 33 33 $core_content = ''; 34 - $byline = ''; 35 34 $move_notice = ''; 35 + $properties = null; 36 36 37 37 if (!$document) { 38 38 ··· 48 48 } 49 49 $create_uri = '/phriction/edit/?slug='.$slug; 50 50 51 - $no_content_head = pht('No content here!'); 52 - $no_content_body = pht( 53 - 'No document found at %s. You can <strong>'. 54 - '<a href="%s">create a new document here</a></strong>.', 55 - phutil_tag('tt', array(), $slug), 56 - $create_uri); 57 - 58 - $no_content_text = hsprintf( 59 - '<em>%s</em><br />%s', 60 - $no_content_head, 61 - $no_content_body); 51 + $notice = new AphrontErrorView(); 52 + $notice->setSeverity(AphrontErrorView::SEVERITY_NODATA); 53 + $notice->setTitle(pht('No content here!')); 54 + $notice->appendChild( 55 + pht( 56 + 'No document found at %s. You can <strong>'. 57 + '<a href="%s">create a new document here</a></strong>.', 58 + phutil_tag('tt', array(), $slug), 59 + $create_uri)); 60 + $core_content = $notice; 62 61 63 - $page_content = phutil_tag( 64 - 'div', 65 - array('class' => 'phriction-content'), 66 - $no_content_text); 67 62 $page_title = pht('Page Not Found'); 68 63 } else { 69 64 $version = $request->getInt('v'); ··· 90 85 } 91 86 $page_title = $content->getTitle(); 92 87 93 - $project_phid = null; 94 - if (PhrictionDocument::isProjectSlug($slug)) { 95 - $project = id(new PhabricatorProject())->loadOneWhere( 96 - 'phrictionSlug = %s', 97 - PhrictionDocument::getProjectSlugIdentifier($slug)); 98 - if ($project) { 99 - $project_phid = $project->getPHID(); 100 - } 101 - } 102 - 103 88 $subscribers = PhabricatorSubscribersQuery::loadSubscribersForPHID( 104 89 $document->getPHID()); 105 - 106 - $phids = array_filter( 107 - array( 108 - $content->getAuthorPHID(), 109 - $project_phid, 110 - )); 111 - 112 - if ($subscribers) { 113 - $phids = array_merge($phids, $subscribers); 114 - } 115 - 116 - $handles = $this->loadViewerHandles($phids); 117 - 118 - $age = time() - $content->getDateCreated(); 119 - $age = floor($age / (60 * 60 * 24)); 120 - 121 - if ($age < 1) { 122 - $when = pht('today'); 123 - } else if ($age == 1) { 124 - $when = pht('yesterday'); 125 - } else { 126 - $when = pht("%d days ago", $age); 127 - } 128 - 129 - 130 - $project_info = null; 131 - if ($project_phid) { 132 - $project_info = hsprintf( 133 - '<br />%s', 134 - pht('This document is about the project %s.', 135 - $handles[$project_phid]->renderLink())); 136 - } 137 - 138 - $subscriber_view = null; 139 - if ($subscribers) { 140 - $subcriber_list = array(); 141 - foreach ($subscribers as $subscriber) { 142 - $subcriber_list[] = $handles[$subscriber]; 143 - } 144 - 145 - $subcriber_list = phutil_implode_html(', ', 146 - mpull($subcriber_list, 'renderLink')); 147 - 148 - $subscriber_view = array( 149 - hsprintf('<br />Subscribers: '), 150 - $subcriber_list, 151 - ); 152 - } 153 - 154 - $byline = hsprintf( 155 - '<div class="phriction-byline">%s%s%s</div>', 156 - pht('Last updated %s by %s.', 157 - $when, 158 - $handles[$content->getAuthorPHID()]->renderLink()), 159 - $project_info, 160 - $subscriber_view); 161 - 90 + $properties = $this 91 + ->buildPropertyListView($document, $content, $slug, $subscribers); 162 92 163 93 $doc_status = $document->getStatus(); 164 94 $current_status = $content->getChangeType(); ··· 213 143 phutil_tag('a', array('href' => $slug_uri), $slug_uri))) 214 144 ->render(); 215 145 } 216 - 217 146 } 218 147 219 148 if ($version_note) { ··· 234 163 $header = id(new PhabricatorHeaderView()) 235 164 ->setHeader($page_title); 236 165 237 - $page_content = hsprintf( 238 - '<div class="phriction-wrap"> 239 - <div class="phriction-content"> 240 - %s%s%s%s%s 241 - </div> 242 - <div class="phriction-fake-space"></div> 243 - </div>', 244 - $header, 245 - $actions, 246 - $byline, 247 - $move_notice, 248 - $core_content); 166 + $page_content = hsprintf( 167 + '<div class="phriction-wrap"> 168 + <div class="phriction-content"> 169 + %s%s%s%s%s 170 + </div> 171 + <div class="phriction-fake-space"></div> 172 + </div>', 173 + $header, 174 + $actions, 175 + $properties, 176 + $move_notice, 177 + $core_content); 249 178 250 179 $core_page = phutil_tag( 251 180 'div', ··· 268 197 'dust' => true, 269 198 )); 270 199 200 + } 201 + 202 + private function buildPropertyListView( 203 + PhrictionDocument $document, 204 + PhrictionContent $content, 205 + $slug, 206 + array $subscribers) { 207 + 208 + $viewer = $this->getRequest()->getUser(); 209 + $view = id(new PhabricatorPropertyListView()) 210 + ->setUser($viewer) 211 + ->setObject($document); 212 + 213 + $project_phid = null; 214 + if (PhrictionDocument::isProjectSlug($slug)) { 215 + $project = id(new PhabricatorProject())->loadOneWhere( 216 + 'phrictionSlug = %s', 217 + PhrictionDocument::getProjectSlugIdentifier($slug)); 218 + if ($project) { 219 + $project_phid = $project->getPHID(); 220 + } 221 + } 222 + 223 + $phids = array_filter( 224 + array( 225 + $content->getAuthorPHID(), 226 + $project_phid, 227 + )); 228 + 229 + if ($subscribers) { 230 + $phids = array_merge($phids, $subscribers); 231 + } 232 + 233 + $this->loadHandles($phids); 234 + 235 + $project_info = null; 236 + if ($project_phid) { 237 + $view->addProperty( 238 + pht('Project Info'), 239 + $this->getHandle($project_phid)->renderLink()); 240 + } 241 + 242 + $view->addProperty( 243 + pht('Last Author'), 244 + $this->getHandle($content->getAuthorPHID())->renderLink()); 245 + 246 + $age = time() - $content->getDateCreated(); 247 + $age = floor($age / (60 * 60 * 24)); 248 + if ($age < 1) { 249 + $when = pht('Today'); 250 + } else if ($age == 1) { 251 + $when = pht('Yesterday'); 252 + } else { 253 + $when = pht("%d Days Ago", $age); 254 + } 255 + $view->addProperty(pht('Last Updated'), $when); 256 + 257 + if ($subscribers) { 258 + $subscribers = $this->renderHandlesForPHIDs($subscribers); 259 + $view->addProperty(pht('Subscribers'), $subscribers); 260 + } 261 + 262 + return $view; 271 263 } 272 264 273 265 private function buildActionView(
+10 -1
src/applications/phriction/storage/PhrictionDocument.php
··· 4 4 * @group phriction 5 5 */ 6 6 final class PhrictionDocument extends PhrictionDAO 7 - implements PhabricatorPolicyInterface, PhabricatorSubscribableInterface { 7 + implements 8 + PhabricatorPolicyInterface, 9 + PhabricatorSubscribableInterface, 10 + PhabricatorTokenReceiverInterface { 8 11 9 12 protected $id; 10 13 protected $phid; ··· 128 131 129 132 public function isAutomaticallySubscribed($phid) { 130 133 return false; 134 + } 135 + 136 + /* -( PhabricatorTokenReceiverInterface )---------------------------------- */ 137 + 138 + public function getUsersToNotifyOfTokenGiven() { 139 + return PhabricatorSubscribersQuery::loadSubscribersForPHID($this->phid); 131 140 } 132 141 }
+3 -2
src/applications/ponder/controller/PonderQuestionViewController.php
··· 113 113 array $subscribers) { 114 114 115 115 $viewer = $this->getRequest()->getUser(); 116 - $view = new PhabricatorPropertyListView(); 117 - 116 + $view = id(new PhabricatorPropertyListView()) 117 + ->setUser($viewer) 118 + ->setObject($question); 118 119 $view->addProperty( 119 120 pht('Author'), 120 121 $this->getHandle($question->getAuthorPHID())->renderLink());
+10 -1
src/applications/ponder/storage/PonderQuestion.php
··· 5 5 PhabricatorMarkupInterface, 6 6 PonderVotableInterface, 7 7 PhabricatorSubscribableInterface, 8 - PhabricatorPolicyInterface { 8 + PhabricatorPolicyInterface, 9 + PhabricatorTokenReceiverInterface { 9 10 10 11 const MARKUP_FIELD_CONTENT = 'markup:content'; 11 12 ··· 188 189 189 190 public function hasAutomaticCapability($capability, PhabricatorUser $viewer) { 190 191 return false; 192 + } 193 + 194 + /* -( PhabricatorTokenReceiverInterface )---------------------------------- */ 195 + 196 + public function getUsersToNotifyOfTokenGiven() { 197 + return array( 198 + $this->getAuthorPHID(), 199 + ); 191 200 } 192 201 193 202 }
+10 -1
src/applications/repository/storage/PhabricatorRepositoryCommit.php
··· 2 2 3 3 final class PhabricatorRepositoryCommit 4 4 extends PhabricatorRepositoryDAO 5 - implements PhabricatorPolicyInterface { 5 + implements PhabricatorPolicyInterface, 6 + PhabricatorTokenReceiverInterface { 6 7 7 8 protected $repositoryID; 8 9 protected $phid; ··· 169 170 170 171 public function hasAutomaticCapability($capability, PhabricatorUser $viewer) { 171 172 return $this->getRepository()->hasAutomaticCapability($capability, $viewer); 173 + } 174 + 175 + /* -( PhabricatorTokenReceiverInterface )---------------------------------- */ 176 + 177 + public function getUsersToNotifyOfTokenGiven() { 178 + return array( 179 + $this->getAuthorPHID(), 180 + ); 172 181 } 173 182 174 183 }
-2
src/applications/subscriptions/query/PhabricatorSubscribersQuery.php
··· 49 49 50 50 return $results; 51 51 } 52 - 53 - 54 52 }
-11
webroot/rsrc/css/application/phriction/phriction-document-css.css
··· 62 62 padding: 20px; 63 63 } 64 64 65 - .phriction-byline { 66 - padding: 10px 20px; 67 - color: #777; 68 - font-size: 11px; 69 - background: #f7f7f7; 70 - } 71 - 72 - .device-phone .phriction-byline { 73 - padding: 10px; 74 - } 75 - 76 65 .device-phone .phriction-content .phabricator-remarkup { 77 66 padding: 10px; 78 67 }