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

Modernize Repositories a bit

Summary: Switch to modern components, crumbs, pht, object boxes.

Test Plan:
Test browsing a list, click edit, click new repository, click delete, verify all work as expected.

{F330864}

Reviewers: btrahan, epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7427

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

+53 -47
+5 -5
src/applications/repository/controller/PhabricatorRepositoryArcanistProjectDeleteController.php
··· 27 27 $dialog = new AphrontDialogView(); 28 28 $dialog 29 29 ->setUser($request->getUser()) 30 - ->setTitle('Really delete this arcanist project?') 31 - ->appendChild(hsprintf( 32 - '<p>Really delete the "%s" arcanist project? '. 33 - 'This operation can not be undone.</p>', 30 + ->setTitle(pht('Really delete this arcanist project?')) 31 + ->appendChild(pht( 32 + 'Really delete the "%s" arcanist project? '. 33 + 'This operation can not be undone.', 34 34 $arc_project->getName())) 35 35 ->setSubmitURI('/repository/project/delete/'.$this->id.'/') 36 - ->addSubmitButton('Delete Arcanist Project') 36 + ->addSubmitButton(pht('Delete Arcanist Project')) 37 37 ->addCancelButton('/repository/'); 38 38 39 39 return id(new AphrontDialogResponse())->setDialog($dialog);
+16 -11
src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php
··· 71 71 ->setUser($user) 72 72 ->appendChild( 73 73 id(new AphrontFormStaticControl()) 74 - ->setLabel('Name') 74 + ->setLabel(pht('Name')) 75 75 ->setValue($project->getName())) 76 76 ->appendChild( 77 77 id(new AphrontFormStaticControl()) ··· 79 79 ->setValue($project->getPHID())) 80 80 ->appendChild( 81 81 id(new AphrontFormSelectControl()) 82 - ->setLabel('Repository') 82 + ->setLabel(pht('Repository')) 83 83 ->setOptions($repos) 84 84 ->setName('repository') 85 85 ->setValue($project->getRepositoryID())) 86 86 ->appendChild( 87 87 id(new AphrontFormTextControl()) 88 - ->setLabel('Indexed Languages') 88 + ->setLabel(pht('Indexed Languages')) 89 89 ->setName('symbolIndexLanguages') 90 90 ->setCaption(pht( 91 91 'Separate with commas, for example: %s', ··· 93 93 ->setValue($langs)) 94 94 ->appendChild( 95 95 id(new AphrontFormTokenizerControl()) 96 - ->setLabel('Uses Symbols From') 96 + ->setLabel(pht('Uses Symbols From')) 97 97 ->setName('symbolIndexProjects') 98 98 ->setDatasource(new DiffusionArcanistProjectDatasource()) 99 99 ->setValue($uses)) ··· 102 102 ->addCancelButton('/repository/') 103 103 ->setValue('Save')); 104 104 105 - $panel = new AphrontPanelView(); 106 - $panel->setWidth(AphrontPanelView::WIDTH_WIDE); 107 - $panel->setHeader('Edit Arcanist Project'); 108 - $panel->appendChild($form); 105 + $panel = new PHUIObjectBoxView(); 106 + $panel->setHeaderText(pht('Edit Arcanist Project')); 107 + $panel->setForm($form); 108 + 109 + $crumbs = $this->buildApplicationCrumbs(); 110 + $crumbs->addTextCrumb(pht('Edit Project')); 109 111 110 - return $this->buildStandardPageResponse( 111 - $panel, 112 + return $this->buildApplicationPage( 113 + array( 114 + $crumbs, 115 + $panel, 116 + ), 112 117 array( 113 - 'title' => 'Edit Project', 118 + 'title' => pht('Edit Project'), 114 119 )); 115 120 } 116 121
+3 -12
src/applications/repository/controller/PhabricatorRepositoryController.php
··· 7 7 return true; 8 8 } 9 9 10 - public function buildStandardPageResponse($view, array $data) { 11 - $page = $this->buildStandardPageView(); 12 - 13 - $page->setApplicationName('Repositories'); 14 - $page->setBaseURI('/repository/'); 15 - $page->setTitle(idx($data, 'title')); 16 - $page->setGlyph('rX'); 17 - $page->appendChild($view); 18 - 19 - 20 - $response = new AphrontWebpageResponse(); 21 - return $response->setContent($page->render()); 10 + protected function buildApplicationCrumbs() { 11 + $crumbs = parent::buildApplicationCrumbs(); 12 + return $crumbs; 22 13 } 23 14 24 15 }
+29 -19
src/applications/repository/controller/PhabricatorRepositoryListController.php
··· 23 23 array( 24 24 'href' => '/diffusion/'.$repo->getCallsign().'/', 25 25 ), 26 - 'View in Diffusion'); 26 + pht('View in Diffusion')); 27 27 } else { 28 28 $diffusion_link = phutil_tag('em', array(), 'Not Tracked'); 29 29 } ··· 40 40 'class' => 'button small grey', 41 41 'href' => '/diffusion/'.$repo->getCallsign().'/edit/', 42 42 ), 43 - 'Edit'), 43 + pht('Edit')), 44 44 ); 45 45 } 46 46 47 47 $table = new AphrontTableView($rows); 48 + $table->setNoDataString(pht('No Repositories')); 48 49 $table->setHeaders( 49 50 array( 50 - 'Callsign', 51 - 'Repository', 52 - 'Type', 53 - 'Diffusion', 51 + pht('Callsign'), 52 + pht('Repository'), 53 + pht('Type'), 54 + pht('Diffusion'), 54 55 '', 55 56 )); 56 57 $table->setColumnClasses( ··· 71 72 $is_admin, 72 73 )); 73 74 74 - $panel = new AphrontPanelView(); 75 - $panel->setHeader('Repositories'); 75 + $panel = new PHUIObjectBoxView(); 76 + $header = new PHUIHeaderView(); 77 + $header->setHeader(pht('Repositories')); 76 78 if ($is_admin) { 77 - $panel->setCreateButton('Create New Repository', '/diffusion/new/'); 79 + $button = id(new PHUIButtonView()) 80 + ->setTag('a') 81 + ->setText(pht('Create New Repository')) 82 + ->setHref('/diffusion/new/'); 83 + $header->addActionLink($button); 78 84 } 85 + $panel->setHeader($header); 79 86 $panel->appendChild($table); 80 - $panel->setNoBackground(); 81 87 82 88 $projects = id(new PhabricatorRepositoryArcanistProject())->loadAll(); 83 89 ··· 99 105 'href' => '/repository/project/edit/'.$project->getID().'/', 100 106 'class' => 'button grey small', 101 107 ), 102 - 'Edit'), 108 + pht('Edit')), 103 109 javelin_tag( 104 110 'a', 105 111 array( ··· 107 113 'class' => 'button grey small', 108 114 'sigil' => 'workflow', 109 115 ), 110 - 'Delete'), 116 + pht('Delete')), 111 117 ); 112 118 113 119 } 114 120 115 121 $project_table = new AphrontTableView($rows); 122 + $project_table->setNoDataString(pht('No Arcanist Projects')); 116 123 $project_table->setHeaders( 117 124 array( 118 - 'Project ID', 119 - 'Repository', 125 + pht('Project ID'), 126 + pht('Repository'), 120 127 '', 121 128 '', 122 129 )); ··· 136 143 $is_admin, 137 144 )); 138 145 139 - $project_panel = new AphrontPanelView(); 140 - $project_panel->setHeader('Arcanist Projects'); 146 + $project_panel = new PHUIObjectBoxView(); 147 + $project_panel->setHeaderText(pht('Arcanist Projects')); 141 148 $project_panel->appendChild($project_table); 142 - $project_panel->setNoBackground(); 143 149 144 - return $this->buildStandardPageResponse( 150 + $crumbs = $this->buildApplicationCrumbs(); 151 + $crumbs->addTextCrumb(pht('Repository List')); 152 + 153 + return $this->buildApplicationPage( 145 154 array( 155 + $crumbs, 146 156 $panel, 147 157 $project_panel, 148 158 ), 149 159 array( 150 - 'title' => 'Repository List', 160 + 'title' => pht('Repository List'), 151 161 )); 152 162 } 153 163