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

Tidy up PhameBlogManage

Summary: Remove unneeded actions, fix archive controller, adds some icons. Ref T9897

Test Plan: Archive a blog, unarchive a blog

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9897

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

+26 -33
+1 -1
src/applications/phame/controller/blog/PhameBlogArchiveController.php
··· 20 20 return new Aphront404Response(); 21 21 } 22 22 23 - $view_uri = $this->getApplicationURI('blog/view/'.$blog->getID().'/'); 23 + $view_uri = $this->getApplicationURI('blog/manage/'.$blog->getID().'/'); 24 24 25 25 if ($request->isFormPost()) { 26 26 if ($blog->isArchived()) {
+2 -17
src/applications/phame/controller/blog/PhameBlogManageController.php
··· 82 82 83 83 $skin = $blog->getSkin(); 84 84 if (!$skin) { 85 - $skin = pht('(No external skin)'); 85 + $skin = phutil_tag('em', array(), pht('No external skin')); 86 86 } 87 87 88 88 $domain = $blog->getDomain(); 89 89 if (!$domain) { 90 - $domain = pht('(No external domain)'); 90 + $domain = phutil_tag('em', array(), pht('No external domain')); 91 91 } 92 92 93 93 $properties->addProperty(pht('Skin'), $skin); ··· 147 147 $viewer, 148 148 $blog, 149 149 PhabricatorPolicyCapability::CAN_EDIT); 150 - 151 - $actions->addAction( 152 - id(new PhabricatorActionView()) 153 - ->setIcon('fa-plus') 154 - ->setHref($this->getApplicationURI('post/edit/?blog='.$blog->getID())) 155 - ->setName(pht('Write Post')) 156 - ->setDisabled(!$can_edit) 157 - ->setWorkflow(!$can_edit)); 158 - 159 - $actions->addAction( 160 - id(new PhabricatorActionView()) 161 - ->setUser($viewer) 162 - ->setIcon('fa-globe') 163 - ->setHref($blog->getLiveURI()) 164 - ->setName(pht('View Live'))); 165 150 166 151 $actions->addAction( 167 152 id(new PhabricatorActionView())
+23 -15
src/applications/phame/storage/PhameBlogTransaction.php
··· 32 32 33 33 public function getIcon() { 34 34 $old = $this->getOldValue(); 35 + $new = $this->getNewValue(); 35 36 switch ($this->getTransactionType()) { 36 37 case self::TYPE_NAME: 37 38 if ($old === null) { ··· 44 45 case self::TYPE_DOMAIN: 45 46 case self::TYPE_SKIN: 46 47 return 'fa-pencil'; 48 + case self::TYPE_STATUS: 49 + if ($new == PhameBlog::STATUS_ARCHIVED) { 50 + return 'fa-ban'; 51 + } else { 52 + return 'fa-check'; 53 + } 47 54 break; 48 55 } 49 56 return parent::getIcon(); 57 + } 58 + 59 + public function getColor() { 60 + 61 + $old = $this->getOldValue(); 62 + $new = $this->getNewValue(); 63 + 64 + switch ($this->getTransactionType()) { 65 + case self::TYPE_STATUS: 66 + if ($new == PhameBlog::STATUS_ARCHIVED) { 67 + return 'red'; 68 + } else { 69 + return 'green'; 70 + } 71 + } 72 + return parent::getColor(); 50 73 } 51 74 52 75 public function getMailTags() { ··· 183 206 184 207 return parent::getTitleForFeed(); 185 208 } 186 - 187 - public function getColor() { 188 - $old = $this->getOldValue(); 189 - 190 - switch ($this->getTransactionType()) { 191 - case self::TYPE_NAME: 192 - if ($old === null) { 193 - return PhabricatorTransactions::COLOR_GREEN; 194 - } 195 - break; 196 - } 197 - 198 - return parent::getColor(); 199 - } 200 - 201 209 202 210 public function hasChangeDetails() { 203 211 switch ($this->getTransactionType()) {