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

Add subtitle to PhamePost

Summary: No view engine yet (adding header image next), but adds subtitle to display like PhameBlog

Test Plan: Add a subtitle, remove a subtitle.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

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

+40
+2
resources/sql/autopatches/20161115.phamepost.01.subtitle.sql
··· 1 + ALTER TABLE {$NAMESPACE}_phame.phame_post 2 + ADD subtitle VARCHAR(64) NOT NULL COLLATE {$COLLATE_TEXT};
+8
src/applications/phame/editor/PhamePostEditEngine.php
··· 99 99 ->setConduitTypeDescription(pht('New post title.')) 100 100 ->setTransactionType(PhamePostTransaction::TYPE_TITLE) 101 101 ->setValue($object->getTitle()), 102 + id(new PhabricatorTextEditField()) 103 + ->setKey('subtitle') 104 + ->setLabel(pht('Subtitle')) 105 + ->setDescription(pht('Post subtitle.')) 106 + ->setConduitDescription(pht('Change the post subtitle.')) 107 + ->setConduitTypeDescription(pht('New post subtitle.')) 108 + ->setTransactionType(PhamePostTransaction::TYPE_SUBTITLE) 109 + ->setValue($object->getSubtitle()), 102 110 id(new PhabricatorSelectEditField()) 103 111 ->setKey('visibility') 104 112 ->setLabel(pht('Visibility'))
+7
src/applications/phame/editor/PhamePostEditor.php
··· 16 16 17 17 $types[] = PhamePostTransaction::TYPE_BLOG; 18 18 $types[] = PhamePostTransaction::TYPE_TITLE; 19 + $types[] = PhamePostTransaction::TYPE_SUBTITLE; 19 20 $types[] = PhamePostTransaction::TYPE_BODY; 20 21 $types[] = PhamePostTransaction::TYPE_VISIBILITY; 21 22 $types[] = PhabricatorTransactions::TYPE_COMMENT; ··· 32 33 return $object->getBlogPHID(); 33 34 case PhamePostTransaction::TYPE_TITLE: 34 35 return $object->getTitle(); 36 + case PhamePostTransaction::TYPE_SUBTITLE: 37 + return $object->getSubtitle(); 35 38 case PhamePostTransaction::TYPE_BODY: 36 39 return $object->getBody(); 37 40 case PhamePostTransaction::TYPE_VISIBILITY: ··· 45 48 46 49 switch ($xaction->getTransactionType()) { 47 50 case PhamePostTransaction::TYPE_TITLE: 51 + case PhamePostTransaction::TYPE_SUBTITLE: 48 52 case PhamePostTransaction::TYPE_BODY: 49 53 case PhamePostTransaction::TYPE_VISIBILITY: 50 54 case PhamePostTransaction::TYPE_BLOG: ··· 59 63 switch ($xaction->getTransactionType()) { 60 64 case PhamePostTransaction::TYPE_TITLE: 61 65 return $object->setTitle($xaction->getNewValue()); 66 + case PhamePostTransaction::TYPE_SUBTITLE: 67 + return $object->setSubtitle($xaction->getNewValue()); 62 68 case PhamePostTransaction::TYPE_BODY: 63 69 return $object->setBody($xaction->getNewValue()); 64 70 case PhamePostTransaction::TYPE_BLOG: ··· 84 90 85 91 switch ($xaction->getTransactionType()) { 86 92 case PhamePostTransaction::TYPE_TITLE: 93 + case PhamePostTransaction::TYPE_SUBTITLE: 87 94 case PhamePostTransaction::TYPE_BODY: 88 95 case PhamePostTransaction::TYPE_VISIBILITY: 89 96 case PhamePostTransaction::TYPE_BLOG:
+2
src/applications/phame/storage/PhamePost.php
··· 18 18 19 19 protected $bloggerPHID; 20 20 protected $title; 21 + protected $subtitle; 21 22 protected $phameTitle; 22 23 protected $body; 23 24 protected $visibility; ··· 122 123 ), 123 124 self::CONFIG_COLUMN_SCHEMA => array( 124 125 'title' => 'text255', 126 + 'subtitle' => 'text64', 125 127 'phameTitle' => 'sort64?', 126 128 'visibility' => 'uint32', 127 129 'mailKey' => 'bytes20',
+21
src/applications/phame/storage/PhamePostTransaction.php
··· 4 4 extends PhabricatorApplicationTransaction { 5 5 6 6 const TYPE_TITLE = 'phame.post.title'; 7 + const TYPE_SUBTITLE = 'phame.post.subtitle'; 7 8 const TYPE_BODY = 'phame.post.body'; 8 9 const TYPE_VISIBILITY = 'phame.post.visibility'; 9 10 const TYPE_BLOG = 'phame.post.blog'; ··· 94 95 $tags[] = self::MAILTAG_SUBSCRIBERS; 95 96 break; 96 97 case self::TYPE_TITLE: 98 + case self::TYPE_SUBTITLE: 97 99 case self::TYPE_BODY: 98 100 $tags[] = self::MAILTAG_CONTENT; 99 101 break; ··· 136 138 $new); 137 139 } 138 140 break; 141 + case self::TYPE_SUBTITLE: 142 + if ($old === null) { 143 + return pht( 144 + '%s set the post\'s subtitle to "%s".', 145 + $this->renderHandleLink($author_phid), 146 + $new); 147 + } else { 148 + return pht( 149 + '%s updated the post\'s subtitle to "%s".', 150 + $this->renderHandleLink($author_phid), 151 + $new); 152 + } 153 + break; 139 154 case self::TYPE_BODY: 140 155 return pht( 141 156 '%s updated the blog post.', ··· 194 209 $this->renderHandleLink($author_phid), 195 210 $this->renderHandleLink($object_phid)); 196 211 } 212 + break; 213 + case self::TYPE_SUBTITLE: 214 + return pht( 215 + '%s updated the subtitle for %s.', 216 + $this->renderHandleLink($author_phid), 217 + $this->renderHandleLink($object_phid)); 197 218 break; 198 219 case self::TYPE_BODY: 199 220 return pht(