@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 some old page rendering code from Diffusion

Summary: Get rid of remaining callsites for buildStandardPageResponse() and modernize the UIs.

Test Plan: Looked at branches, tags, and commit detail pages.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

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

+45 -39
+12 -6
src/applications/diffusion/controller/DiffusionBranchTableController.php
··· 2 2 3 3 final class DiffusionBranchTableController extends DiffusionController { 4 4 5 + public function shouldAllowPublic() { 6 + return true; 7 + } 8 + 5 9 public function processRequest() { 6 10 $drequest = $this->getDiffusionRequest(); 7 11 $request = $this->getRequest(); ··· 44 48 ->setDiffusionRequest($drequest); 45 49 46 50 $panel = id(new AphrontPanelView()) 47 - ->setHeader(pht('Branches')) 51 + ->setNoBackground(true) 48 52 ->appendChild($view) 49 53 ->appendChild($pager); 50 54 51 55 $content = $panel; 52 56 } 53 57 54 - return $this->buildStandardPageResponse( 58 + $crumbs = $this->buildCrumbs( 55 59 array( 56 - $this->buildCrumbs( 57 - array( 58 - 'branches' => true, 59 - )), 60 + 'branches' => true, 61 + )); 62 + 63 + return $this->buildApplicationPage( 64 + array( 65 + $crumbs, 60 66 $content, 61 67 ), 62 68 array(
+20 -10
src/applications/diffusion/controller/DiffusionCommitController.php
··· 30 30 $repository = $drequest->getRepository(); 31 31 $commit = $drequest->loadCommit(); 32 32 33 + $crumbs = $this->buildCrumbs(array( 34 + 'commit' => true, 35 + )); 36 + 33 37 if (!$commit) { 34 38 $exists = $this->callConduitWithDiffusionRequest( 35 39 'diffusion.existsquery', ··· 37 41 if (!$exists) { 38 42 return new Aphront404Response(); 39 43 } 40 - return $this->buildStandardPageResponse( 41 - id(new AphrontErrorView()) 42 - ->setTitle(pht('Error displaying commit.')) 43 - ->appendChild(pht('Failed to load the commit because the commit has '. 44 - 'not been parsed yet.')), 45 - array('title' => pht('Commit Still Parsing'))); 44 + 45 + $error = id(new AphrontErrorView()) 46 + ->setTitle(pht('Commit Still Parsing')) 47 + ->appendChild( 48 + pht( 49 + 'Failed to load the commit because the commit has not been '. 50 + 'parsed yet.')); 51 + 52 + return $this->buildApplicationPage( 53 + array( 54 + $crumbs, 55 + $error, 56 + ), 57 + array( 58 + 'title' => pht('Commit Still Parsing'), 59 + )); 46 60 } 47 61 48 62 $commit_data = $drequest->loadCommitData(); ··· 345 359 $short_name = DiffusionView::nameCommit( 346 360 $repository, 347 361 $commit->getCommitIdentifier()); 348 - 349 - $crumbs = $this->buildCrumbs(array( 350 - 'commit' => true, 351 - )); 352 362 353 363 $prefs = $user->loadPreferences(); 354 364 $pref_filetree = PhabricatorUserPreferences::PREFERENCE_DIFF_FILETREE;
-16
src/applications/diffusion/controller/DiffusionController.php
··· 25 25 return $this->diffusionRequest; 26 26 } 27 27 28 - public function buildStandardPageResponse($view, array $data) { 29 - 30 - $page = $this->buildStandardPageView(); 31 - 32 - $page->setApplicationName(pht('Diffusion')); 33 - $page->setBaseURI('/diffusion/'); 34 - $page->setTitle(idx($data, 'title')); 35 - $page->setGlyph("\xE2\x89\x88"); 36 - $page->setSearchDefaultScope(PhabricatorSearchScope::SCOPE_COMMITS); 37 - 38 - $page->appendChild($view); 39 - 40 - $response = new AphrontWebpageResponse(); 41 - return $response->setContent($page->render()); 42 - } 43 - 44 28 final protected function buildSideNav($selected, $has_change_view) { 45 29 $nav = new AphrontSideNavFilterView(); 46 30 $nav->setBaseURI(new PhutilURI(''));
+13 -7
src/applications/diffusion/controller/DiffusionTagListController.php
··· 2 2 3 3 final class DiffusionTagListController extends DiffusionController { 4 4 5 + public function shouldAllowPublic() { 6 + return true; 7 + } 8 + 5 9 public function processRequest() { 6 10 $drequest = $this->getDiffusionRequest(); 7 11 $request = $this->getRequest(); ··· 65 69 $view->setHandles($handles); 66 70 67 71 $panel = id(new AphrontPanelView()) 68 - ->setHeader(pht('Tags')) 72 + ->setNoBackground(true) 69 73 ->appendChild($view) 70 74 ->appendChild($pager); 71 75 72 76 $content = $panel; 73 77 } 74 78 75 - return $this->buildStandardPageResponse( 79 + $crumbs = $this->buildCrumbs( 76 80 array( 77 - $this->buildCrumbs( 78 - array( 79 - 'tags' => true, 80 - 'commit' => $drequest->getRawCommit(), 81 - )), 81 + 'tags' => true, 82 + 'commit' => $drequest->getRawCommit(), 83 + )); 84 + 85 + return $this->buildApplicationPage( 86 + array( 87 + $crumbs, 82 88 $content, 83 89 ), 84 90 array(