@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 People application

Summary: Move to application navigation, make it possible to get to /logs/ from the navigation.

Test Plan: Hit all interfaces, verified email.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1569, T631

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

+59 -44
-3
src/aphront/configuration/AphrontDefaultApplicationConfiguration.php
··· 305 305 'testpaymentform/' => 'PhortuneStripeTestPaymentFormController', 306 306 ), 307 307 ), 308 - 309 - '/emailverify/(?P<code>[^/]+)/' => 310 - 'PhabricatorEmailVerificationController', 311 308 ); 312 309 } 313 310
+6
src/applications/people/application/PhabricatorApplicationPeople.php
··· 26 26 return '/people/'; 27 27 } 28 28 29 + public function getTitleGlyph() { 30 + return "\xE2\x99\x9F"; 31 + } 32 + 29 33 public function getIconURI() { 30 34 return celerity_get_resource_uri('/rsrc/image/app/app_people.png'); 31 35 } ··· 41 45 ), 42 46 '/p/(?P<username>[\w._-]+)/(?:(?P<page>\w+)/)?' 43 47 => 'PhabricatorPeopleProfileController', 48 + '/emailverify/(?P<code>[^/]+)/' => 49 + 'PhabricatorEmailVerificationController', 44 50 ); 45 51 } 46 52
+1 -1
src/applications/people/controller/PhabricatorEmailVerificationController.php
··· 87 87 $settings_link); 88 88 } 89 89 90 - return $this->buildStandardPageResponse( 90 + return $this->buildApplicationPage( 91 91 $content, 92 92 array( 93 93 'title' => 'Verify Email',
+18 -27
src/applications/people/controller/PhabricatorPeopleController.php
··· 1 1 <?php 2 2 3 3 /* 4 - * Copyright 2011 Facebook, Inc. 4 + * Copyright 2012 Facebook, Inc. 5 5 * 6 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 7 * you may not use this file except in compliance with the License. ··· 18 18 19 19 abstract class PhabricatorPeopleController extends PhabricatorController { 20 20 21 - public function buildStandardPageResponse($view, array $data) { 22 - $page = $this->buildStandardPageView(); 21 + public function buildSideNavView() { 22 + $nav = new AphrontSideNavFilterView(); 23 + $nav->setBaseURI(new PhutilURI($this->getApplicationURI())); 23 24 24 - $page->setApplicationName('People'); 25 - $page->setBaseURI('/people/'); 26 - $page->setTitle(idx($data, 'title')); 25 + $is_admin = $this->getRequest()->getUser()->getIsAdmin(); 27 26 28 - $tabs = array( 29 - 'directory' => array( 30 - 'name' => 'User Directory', 31 - 'href' => '/people/', 32 - ), 33 - ); 34 - 35 - if ($this->getRequest()->getUser()->getIsAdmin()) { 36 - $tabs = array_merge( 37 - $tabs, 38 - array( 39 - 'logs' => array( 40 - 'name' => 'Activity Logs', 41 - 'href' => '/people/logs/', 42 - ), 43 - )); 27 + if ($is_admin) { 28 + $nav->addLabel('Create Users'); 29 + $nav->addFilter('edit', 'Create New User'); 30 + $nav->addFilter('ldap', 'Import from LDAP'); 31 + $nav->addSpacer(); 44 32 } 45 33 46 - $page->setTabs($tabs, idx($data, 'tab')); 34 + $nav->addLabel('Directory'); 35 + $nav->addFilter('people', 'User Directory', $this->getApplicationURI()); 47 36 48 - $page->setGlyph("\xE2\x99\x9F"); 49 - $page->appendChild($view); 37 + if ($is_admin) { 38 + $nav->addSpacer(); 39 + $nav->addLabel('Logs'); 40 + $nav->addFilter('logs', 'Activity Logs'); 41 + } 50 42 51 - $response = new AphrontWebpageResponse(); 52 - return $response->setContent($page->render()); 43 + return $nav; 53 44 } 54 45 55 46 }
+10 -3
src/applications/people/controller/PhabricatorPeopleEditController.php
··· 49 49 50 50 $nav = new AphrontSideNavFilterView(); 51 51 $nav->setBaseURI(new PhutilURI($base_uri)); 52 + $nav->addLabel('User Information'); 52 53 $nav->addFilter('basic', 'Basic Information'); 53 54 $nav->addFilter('role', 'Edit Roles'); 54 55 $nav->addFilter('cert', 'Conduit Certificate'); 56 + $nav->addFilter('profile', 'View Profile', '/p/'.$user->getUsername().'/'); 55 57 $nav->addSpacer(); 58 + $nav->addLabel('Special'); 56 59 $nav->addFilter('rename', 'Change Username'); 57 60 $nav->addFilter('delete', 'Delete User'); 58 61 59 62 if (!$user->getID()) { 60 63 $this->view = 'basic'; 61 64 } 65 + 62 66 $view = $nav->selectFilter($this->view, 'basic'); 63 67 64 68 $content = array(); ··· 99 103 100 104 if ($user->getID()) { 101 105 $nav->appendChild($content); 102 - $content = $nav; 106 + } else { 107 + $nav = $this->buildSideNavView(); 108 + $nav->selectFilter('edit'); 109 + $nav->appendChild($content); 103 110 } 104 111 105 - return $this->buildStandardPageResponse( 106 - $content, 112 + return $this->buildApplicationPage( 113 + $nav, 107 114 array( 108 115 'title' => 'Edit User', 109 116 ));
+6 -2
src/applications/people/controller/PhabricatorPeopleLdapController.php
··· 68 68 $content[] = $this->processSearchRequest($request); 69 69 } 70 70 71 - return $this->buildStandardPageResponse( 72 - $content, 71 + $nav = $this->buildSideNavView(); 72 + $nav->selectFilter('ldap'); 73 + $nav->appendChild($content); 74 + 75 + return $this->buildApplicationPage( 76 + $nav, 73 77 array( 74 78 'title' => 'Import Ldap Users', 75 79 ));
+9 -4
src/applications/people/controller/PhabricatorPeopleListController.php
··· 138 138 'href' => '/people/ldap/', 139 139 'class' => 'button green' 140 140 ), 141 - 'Import from Ldap')); 141 + 'Import from LDAP')); 142 142 } 143 143 } 144 144 145 - return $this->buildStandardPageResponse($panel, array( 146 - 'title' => 'People', 147 - 'tab' => 'directory', 145 + $nav = $this->buildSideNavView(); 146 + $nav->selectFilter('people'); 147 + $nav->appendChild($panel); 148 + 149 + return $this->buildApplicationPage( 150 + $nav, 151 + array( 152 + 'title' => 'People', 148 153 )); 149 154 } 150 155 }
+8 -3
src/applications/people/controller/PhabricatorPeopleLogsController.php
··· 232 232 $filter = new AphrontListFilterView(); 233 233 $filter->appendChild($form); 234 234 235 - return $this->buildStandardPageResponse( 235 + $nav = $this->buildSideNavView(); 236 + $nav->selectFilter('logs'); 237 + $nav->appendChild( 236 238 array( 237 239 $filter, 238 240 $panel, 239 - ), 241 + )); 242 + 243 + 244 + return $this->buildApplicationPage( 245 + $nav, 240 246 array( 241 247 'title' => 'Activity Logs', 242 - 'tab' => 'logs', 243 248 )); 244 249 } 245 250 }
+1 -1
src/applications/people/controller/PhabricatorPeopleProfileController.php
··· 158 158 '/people/edit/'.$user->getID().'/'); 159 159 } 160 160 161 - return $this->buildStandardPageResponse( 161 + return $this->buildApplicationPage( 162 162 $header, 163 163 array( 164 164 'title' => $user->getUsername(),