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

Convert Project Pages to new UI

Summary: Updating the subproject and member pages in Projects to new UI

Test Plan: Visit a subproject parent page, visit members pages

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

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

authored by

Chad Little and committed by
chad
7b16f5d8 eae82c51

+58 -37
+32 -21
src/applications/project/controller/PhabricatorProjectMembersViewController.php
··· 22 22 $title = pht('Members and Watchers'); 23 23 24 24 $properties = $this->buildProperties($project); 25 - $actions = $this->buildActions($project); 26 - $properties->setActionList($actions); 25 + $curtain = $this->buildCurtainView($project); 27 26 28 27 $object_box = id(new PHUIObjectBoxView()) 29 - ->setHeaderText($title) 28 + ->setHeaderText(pht('Details')) 29 + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 30 30 ->addPropertyList($properties); 31 31 32 32 $member_list = id(new PhabricatorProjectMemberListView()) 33 33 ->setUser($viewer) 34 34 ->setProject($project) 35 + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 35 36 ->setUserPHIDs($project->getMemberPHIDs()); 36 37 37 38 $watcher_list = id(new PhabricatorProjectWatcherListView()) 38 39 ->setUser($viewer) 39 40 ->setProject($project) 41 + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 40 42 ->setUserPHIDs($project->getWatcherPHIDs()); 41 43 42 44 $nav = $this->getProfileMenu(); ··· 44 46 45 47 $crumbs = $this->buildApplicationCrumbs(); 46 48 $crumbs->addTextCrumb(pht('Members')); 49 + $crumbs->setBorder(true); 50 + 51 + $header = id(new PHUIHeaderView()) 52 + ->setHeader($title) 53 + ->setHeaderIcon('fa-group'); 54 + 55 + $view = id(new PHUITwoColumnView()) 56 + ->setHeader($header) 57 + ->setCurtain($curtain) 58 + ->setMainColumn(array( 59 + $object_box, 60 + $member_list, 61 + $watcher_list, 62 + )); 63 + 47 64 48 65 return $this->newPage() 49 66 ->setNavigation($nav) 50 67 ->setCrumbs($crumbs) 51 - ->setTitle(array($project->getDisplayName(), $title)) 52 - ->appendChild( 53 - array( 54 - $object_box, 55 - $member_list, 56 - $watcher_list, 57 - )); 68 + ->setTitle(array($project->getName(), $title)) 69 + ->appendChild($view); 58 70 } 59 71 60 72 private function buildProperties(PhabricatorProject $project) { ··· 156 168 return $view; 157 169 } 158 170 159 - private function buildActions(PhabricatorProject $project) { 171 + private function buildCurtainView(PhabricatorProject $project) { 160 172 $viewer = $this->getViewer(); 161 173 $id = $project->getID(); 162 174 163 - $view = id(new PhabricatorActionListView()) 164 - ->setUser($viewer); 175 + $curtain = $this->newCurtainView($project); 165 176 166 177 $is_locked = $project->getIsMembershipLocked(); 167 178 ··· 182 193 $viewer_phid = $viewer->getPHID(); 183 194 184 195 if (!$project->isUserMember($viewer_phid)) { 185 - $view->addAction( 196 + $curtain->addAction( 186 197 id(new PhabricatorActionView()) 187 198 ->setHref('/project/update/'.$project->getID().'/join/') 188 199 ->setIcon('fa-plus') ··· 190 201 ->setWorkflow(true) 191 202 ->setName(pht('Join Project'))); 192 203 } else { 193 - $view->addAction( 204 + $curtain->addAction( 194 205 id(new PhabricatorActionView()) 195 206 ->setHref('/project/update/'.$project->getID().'/leave/') 196 207 ->setIcon('fa-times') ··· 200 211 } 201 212 202 213 if (!$project->isUserWatcher($viewer->getPHID())) { 203 - $view->addAction( 214 + $curtain->addAction( 204 215 id(new PhabricatorActionView()) 205 216 ->setWorkflow(true) 206 217 ->setHref('/project/watch/'.$project->getID().'/') 207 218 ->setIcon('fa-eye') 208 219 ->setName(pht('Watch Project'))); 209 220 } else { 210 - $view->addAction( 221 + $curtain->addAction( 211 222 id(new PhabricatorActionView()) 212 223 ->setWorkflow(true) 213 224 ->setHref('/project/unwatch/'.$project->getID().'/') ··· 224 235 $silence_text = pht('Disable Mail'); 225 236 } 226 237 227 - $view->addAction( 238 + $curtain->addAction( 228 239 id(new PhabricatorActionView()) 229 240 ->setName($silence_text) 230 241 ->setIcon('fa-envelope-o') ··· 234 245 235 246 $can_add = $can_edit && $supports_edit; 236 247 237 - $view->addAction( 248 + $curtain->addAction( 238 249 id(new PhabricatorActionView()) 239 250 ->setName(pht('Add Members')) 240 251 ->setIcon('fa-user-plus') ··· 253 264 $lock_icon = 'fa-lock'; 254 265 } 255 266 256 - $view->addAction( 267 + $curtain->addAction( 257 268 id(new PhabricatorActionView()) 258 269 ->setName($lock_name) 259 270 ->setIcon($lock_icon) ··· 261 272 ->setDisabled(!$can_lock) 262 273 ->setWorkflow(true)); 263 274 264 - return $view; 275 + return $curtain; 265 276 } 266 277 267 278 private function isProjectSilenced(PhabricatorProject $project) {
+26 -16
src/applications/project/controller/PhabricatorProjectSubprojectsController.php
··· 52 52 if ($milestones) { 53 53 $milestone_list = id(new PHUIObjectBoxView()) 54 54 ->setHeaderText(pht('Milestones')) 55 + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 55 56 ->setObjectList( 56 57 id(new PhabricatorProjectListView()) 57 58 ->setUser($viewer) ··· 64 65 if ($subprojects) { 65 66 $subproject_list = id(new PHUIObjectBoxView()) 66 67 ->setHeaderText(pht('Subprojects')) 68 + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 67 69 ->setObjectList( 68 70 id(new PhabricatorProjectListView()) 69 71 ->setUser($viewer) ··· 78 80 $milestones, 79 81 $subprojects); 80 82 81 - $action_list = $this->buildActionList( 83 + $curtain = $this->buildCurtainView( 82 84 $project, 83 85 $milestones, 84 86 $subprojects); 85 87 86 - $property_list->setActionList($action_list); 87 88 88 - $header_box = id(new PHUIObjectBoxView()) 89 - ->setHeaderText(pht('Subprojects and Milestones')) 89 + $details = id(new PHUIObjectBoxView()) 90 + ->setHeaderText(pht('Details')) 91 + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 90 92 ->addPropertyList($property_list); 91 93 92 94 $nav = $this->getProfileMenu(); ··· 94 96 95 97 $crumbs = $this->buildApplicationCrumbs(); 96 98 $crumbs->addTextCrumb(pht('Subprojects')); 99 + $crumbs->setBorder(true); 100 + 101 + $header = id(new PHUIHeaderView()) 102 + ->setHeader(pht('Subprojects and Milestones')) 103 + ->setHeaderIcon('fa-sitemap'); 104 + 105 + $view = id(new PHUITwoColumnView()) 106 + ->setHeader($header) 107 + ->setCurtain($curtain) 108 + ->setMainColumn(array( 109 + $details, 110 + $milestone_list, 111 + $subproject_list, 112 + )); 97 113 98 114 return $this->newPage() 99 115 ->setNavigation($nav) 100 116 ->setCrumbs($crumbs) 101 117 ->setTitle(array($project->getName(), pht('Subprojects'))) 102 - ->appendChild( 103 - array( 104 - $header_box, 105 - $milestone_list, 106 - $subproject_list, 107 - )); 118 + ->appendChild($view); 108 119 } 109 120 110 121 private function buildPropertyList( ··· 174 185 return $view; 175 186 } 176 187 177 - private function buildActionList( 188 + private function buildCurtainView( 178 189 PhabricatorProject $project, 179 190 array $milestones, 180 191 array $subprojects) { ··· 192 203 $allows_milestones = $project->supportsMilestones(); 193 204 $allows_subprojects = $project->supportsSubprojects(); 194 205 195 - $view = id(new PhabricatorActionListView()) 196 - ->setUser($viewer); 206 + $curtain = $this->newCurtainView($project); 197 207 198 208 if ($allows_milestones && $milestones) { 199 209 $milestone_text = pht('Create Next Milestone'); ··· 204 214 $can_milestone = ($can_create && $can_edit && $allows_milestones); 205 215 $milestone_href = "/project/edit/?milestone={$id}"; 206 216 207 - $view->addAction( 217 + $curtain->addAction( 208 218 id(new PhabricatorActionView()) 209 219 ->setName($milestone_text) 210 220 ->setIcon('fa-plus') ··· 226 236 $subproject_workflow = !$can_subproject; 227 237 } 228 238 229 - $view->addAction( 239 + $curtain->addAction( 230 240 id(new PhabricatorActionView()) 231 241 ->setName(pht('Create Subproject')) 232 242 ->setIcon('fa-plus') ··· 234 244 ->setDisabled($subproject_disabled) 235 245 ->setWorkflow($subproject_workflow)); 236 246 237 - return $view; 247 + return $curtain; 238 248 } 239 249 240 250 private function renderStatus($icon, $target, $note) {