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

Remove ReleephBranchBoxView

Summary: Ref T3092. This was obsoleted recently and has no more call/use sites.

Test Plan: `grep`

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T3092

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

+4 -228
+4 -2
src/__phutil_library_map__.php
··· 1938 1938 'ReleephAuthorFieldSpecification' => 'applications/releeph/field/specification/ReleephAuthorFieldSpecification.php', 1939 1939 'ReleephBranch' => 'applications/releeph/storage/ReleephBranch.php', 1940 1940 'ReleephBranchAccessController' => 'applications/releeph/controller/branch/ReleephBranchAccessController.php', 1941 - 'ReleephBranchBoxView' => 'applications/releeph/view/branch/ReleephBranchBoxView.php', 1942 1941 'ReleephBranchCommitFieldSpecification' => 'applications/releeph/field/specification/ReleephBranchCommitFieldSpecification.php', 1943 1942 'ReleephBranchCreateController' => 'applications/releeph/controller/branch/ReleephBranchCreateController.php', 1944 1943 'ReleephBranchEditController' => 'applications/releeph/controller/branch/ReleephBranchEditController.php', ··· 1948 1947 'ReleephBranchQuery' => 'applications/releeph/query/ReleephBranchQuery.php', 1949 1948 'ReleephBranchSearchEngine' => 'applications/releeph/query/ReleephBranchSearchEngine.php', 1950 1949 'ReleephBranchTemplate' => 'applications/releeph/view/branch/ReleephBranchTemplate.php', 1950 + 'ReleephBranchTransaction' => 'applications/releeph/storage/ReleephBranchTransaction.php', 1951 1951 'ReleephBranchViewController' => 'applications/releeph/controller/branch/ReleephBranchViewController.php', 1952 1952 'ReleephCommitFinder' => 'applications/releeph/commitfinder/ReleephCommitFinder.php', 1953 1953 'ReleephCommitFinderException' => 'applications/releeph/commitfinder/ReleephCommitFinderException.php', ··· 1980 1980 'ReleephProjectListController' => 'applications/releeph/controller/project/ReleephProjectListController.php', 1981 1981 'ReleephProjectQuery' => 'applications/releeph/query/ReleephProjectQuery.php', 1982 1982 'ReleephProjectSearchEngine' => 'applications/releeph/query/ReleephProjectSearchEngine.php', 1983 + 'ReleephProjectTransaction' => 'applications/releeph/storage/ReleephProjectTransaction.php', 1983 1984 'ReleephProjectViewController' => 'applications/releeph/controller/project/ReleephProjectViewController.php', 1984 1985 'ReleephReasonFieldSpecification' => 'applications/releeph/field/specification/ReleephReasonFieldSpecification.php', 1985 1986 'ReleephRequest' => 'applications/releeph/storage/ReleephRequest.php', ··· 4119 4120 1 => 'PhabricatorPolicyInterface', 4120 4121 ), 4121 4122 'ReleephBranchAccessController' => 'ReleephProjectController', 4122 - 'ReleephBranchBoxView' => 'AphrontView', 4123 4123 'ReleephBranchCommitFieldSpecification' => 'ReleephFieldSpecification', 4124 4124 'ReleephBranchCreateController' => 'ReleephProjectController', 4125 4125 'ReleephBranchEditController' => 'ReleephProjectController', ··· 4128 4128 'ReleephBranchPreviewView' => 'AphrontFormControl', 4129 4129 'ReleephBranchQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 4130 4130 'ReleephBranchSearchEngine' => 'PhabricatorApplicationSearchEngine', 4131 + 'ReleephBranchTransaction' => 'PhabricatorApplicationTransaction', 4131 4132 'ReleephBranchViewController' => 4132 4133 array( 4133 4134 0 => 'ReleephProjectController', ··· 4172 4173 ), 4173 4174 'ReleephProjectQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 4174 4175 'ReleephProjectSearchEngine' => 'PhabricatorApplicationSearchEngine', 4176 + 'ReleephProjectTransaction' => 'PhabricatorApplicationTransaction', 4175 4177 'ReleephProjectViewController' => 4176 4178 array( 4177 4179 0 => 'ReleephProjectController',
-226
src/applications/releeph/view/branch/ReleephBranchBoxView.php
··· 1 - <?php 2 - 3 - final class ReleephBranchBoxView extends AphrontView { 4 - 5 - private $releephBranch; 6 - private $isLatest = false; 7 - private $isNamed = false; 8 - private $handles; 9 - 10 - public function setReleephBranch(ReleephBranch $br) { 11 - $this->releephBranch = $br; 12 - return $this; 13 - } 14 - 15 - // Primary highlighted branch 16 - public function setLatest() { 17 - $this->isLatest = true; 18 - return $this; 19 - } 20 - 21 - // Secondary highlighted branch(es) 22 - public function setNamed() { 23 - $this->isNamed = true; 24 - return $this; 25 - } 26 - 27 - public function setHandles($handles) { 28 - $this->handles = $handles; 29 - return $this; 30 - } 31 - 32 - public function render() { 33 - $br = $this->releephBranch; 34 - 35 - require_celerity_resource('releeph-branch'); 36 - return phutil_tag( 37 - 'div', 38 - array( 39 - 'class' => 'releeph-branch-box'. 40 - ($this->isNamed ? ' releeph-branch-box-named' : ''). 41 - ($this->isLatest ? ' releeph-branch-box-latest' : ''), 42 - ), 43 - array( 44 - $this->renderNames(), 45 - $this->renderDatesTable(), 46 - // "float: right" means the ordering here is weird 47 - $this->renderButtons(), 48 - $this->renderStatisticsTable(), 49 - phutil_tag( 50 - 'div', 51 - array( 52 - 'style' => 'clear:both;', 53 - ), 54 - ''))); 55 - } 56 - 57 - private function renderNames() { 58 - $br = $this->releephBranch; 59 - 60 - return phutil_tag( 61 - 'div', 62 - array( 63 - 'class' => 'names', 64 - ), 65 - array( 66 - phutil_tag( 67 - 'h1', 68 - array(), 69 - $br->getDisplayName()), 70 - phutil_tag( 71 - 'h2', 72 - array(), 73 - $br->getName()))); 74 - } 75 - 76 - private function renderDatesTable() { 77 - $br = $this->releephBranch; 78 - $branch_commit_handle = $this->handles[$br->getCutPointCommitPHID()]; 79 - 80 - $properties = array(); 81 - $properties['Created by'] = 82 - 83 - $cut_age = phabricator_format_relative_time( 84 - time() - $branch_commit_handle->getTimestamp()); 85 - 86 - return phutil_tag( 87 - 'div', 88 - array( 89 - 'class' => 'date-info', 90 - ), 91 - array( 92 - $this->handles[$br->getCreatedByUserPHID()]->renderLink(), 93 - phutil_tag('br'), 94 - phutil_tag( 95 - 'a', 96 - array( 97 - 'href' => $branch_commit_handle->getURI(), 98 - ), 99 - $cut_age.' old'))); 100 - } 101 - 102 - private function renderStatisticsTable() { 103 - $statistics = array(); 104 - 105 - $requests = $this->releephBranch->loadReleephRequests($this->getUser()); 106 - foreach ($requests as $request) { 107 - $status = $request->getStatus(); 108 - if (!isset($statistics[$status])) { 109 - $statistics[$status] = 0; 110 - } 111 - $statistics[$status]++; 112 - } 113 - 114 - static $col_groups = 3; 115 - 116 - $cells = array(); 117 - foreach ($statistics as $status => $count) { 118 - $description = ReleephRequestStatus::getStatusDescriptionFor($status); 119 - $cells[] = phutil_tag('th', array(), $count); 120 - $cells[] = phutil_tag('td', array(), $description); 121 - } 122 - 123 - $rows = array(); 124 - while ($cells) { 125 - $row_cells = array(); 126 - for ($ii = 0; $ii < 2 * $col_groups; $ii++) { 127 - $row_cells[] = array_shift($cells); 128 - } 129 - $rows[] = phutil_tag('tr', array(), $row_cells); 130 - } 131 - 132 - if (!$rows) { 133 - $rows = hsprintf('<tr><th></th><td>%s</td></tr>', 'none'); 134 - } 135 - 136 - return phutil_tag( 137 - 'div', 138 - array( 139 - 'class' => 'request-statistics', 140 - ), 141 - phutil_tag( 142 - 'table', 143 - array(), 144 - $rows)); 145 - } 146 - 147 - private function renderButtons() { 148 - $br = $this->releephBranch; 149 - 150 - $buttons = array(); 151 - 152 - $buttons[] = phutil_tag( 153 - 'a', 154 - array( 155 - 'class' => 'small grey button', 156 - 'href' => $br->getURI(), 157 - ), 158 - 'View Requests'); 159 - 160 - $repo = $br->loadReleephProject()->loadPhabricatorRepository(); 161 - if (!$repo) { 162 - $buttons[] = phutil_tag( 163 - 'a', 164 - array( 165 - 'class' => 'small button disabled', 166 - ), 167 - "Diffusion \xE2\x86\x97"); 168 - } else { 169 - $diffusion_request = DiffusionRequest::newFromDictionary(array( 170 - 'user' => $this->getUser(), 171 - 'repository' => $repo, 172 - )); 173 - $diffusion_branch_uri = $diffusion_request->generateURI(array( 174 - 'action' => 'branch', 175 - 'branch' => $br->getName(), 176 - )); 177 - $diffusion_button_class = 'small grey button'; 178 - 179 - $buttons[] = phutil_tag( 180 - 'a', 181 - array( 182 - 'class' => $diffusion_button_class, 183 - 'target' => '_blank', 184 - 'href' => $diffusion_branch_uri, 185 - ), 186 - "Diffusion \xE2\x86\x97"); 187 - } 188 - 189 - $releeph_project = $br->loadReleephProject(); 190 - if (!$releeph_project->getPushers() || 191 - $releeph_project->isAuthoritative($this->user)) { 192 - 193 - $buttons[] = phutil_tag( 194 - 'a', 195 - array( 196 - 'class' => 'small blue button', 197 - 'href' => $br->getURI('edit/'), 198 - ), 199 - 'Edit'); 200 - 201 - if ($br->isActive()) { 202 - $button_text = "Close"; 203 - $href = $br->getURI('close/'); 204 - } else { 205 - $button_text = "Re-open"; 206 - $href = $br->getURI('re-open/'); 207 - } 208 - $buttons[] = javelin_tag( 209 - 'a', 210 - array( 211 - 'class' => 'small blue button', 212 - 'href' => $href, 213 - 'sigil' => 'workflow', 214 - ), 215 - $button_text); 216 - } 217 - 218 - return phutil_tag( 219 - 'div', 220 - array( 221 - 'class' => 'buttons', 222 - ), 223 - $buttons); 224 - } 225 - 226 - }