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

Render public content as "Public" in headers, not "Public (No Login Required)"

Summary:
Ref T603. Although I think the parenthetical is valuable when //setting// policies to make sure no one accidentally opens content up, it's super annoying in headers.

This makes headers say "Public". Everything else still says "Public (No Login Required)".

Test Plan: {F69469}

Reviewers: chad, btrahan

Reviewed By: chad

CC: aran

Maniphest Tasks: T603

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

+24 -1
+10
src/applications/policy/query/PhabricatorPolicyQuery.php
··· 147 147 ->setType(PhabricatorPolicyType::TYPE_GLOBAL) 148 148 ->setPHID($constant) 149 149 ->setName(self::getGlobalPolicyName($constant)) 150 + ->setShortName(self::getGlobalPolicyShortName($constant)) 150 151 ->makeEphemeral(); 151 152 } 152 153 ··· 165 166 return pht('No One'); 166 167 default: 167 168 return pht('Unknown Policy'); 169 + } 170 + } 171 + 172 + private static function getGlobalPolicyShortName($policy) { 173 + switch ($policy) { 174 + case PhabricatorPolicies::POLICY_PUBLIC: 175 + return pht('Public'); 176 + default: 177 + return null; 168 178 } 169 179 } 170 180
+13
src/applications/policy/storage/PhabricatorPolicy.php
··· 8 8 const ACTION_DENY = 'deny'; 9 9 10 10 private $name; 11 + private $shortName; 11 12 private $type; 12 13 private $href; 13 14 private $icon; ··· 104 105 return pht('Custom Policy'); 105 106 } 106 107 return $this->name; 108 + } 109 + 110 + public function setShortName($short_name) { 111 + $this->shortName = $short_name; 112 + return $this; 113 + } 114 + 115 + public function getShortName() { 116 + if ($this->shortName) { 117 + return $this->shortName; 118 + } 119 + return $this->getName(); 107 120 } 108 121 109 122 public function setHref($href) {
+1 -1
src/view/phui/PHUIHeaderView.php
··· 224 224 'href' => '/policy/explain/'.$phid.'/'.$view_capability.'/', 225 225 'sigil' => 'workflow', 226 226 ), 227 - $policy->getName()); 227 + $policy->getShortName()); 228 228 229 229 return array($icon, $link); 230 230 }