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

Migrated People's listing to PhabricatorObjectListView

Summary:
Depends on D5359

Exactly what it says on a tin

made icons white; replaced panel with header

Made People app God-Mode only; did @epriestley's comments

reverted god-mode changes

Test Plan:
{F36157}

tell my if you like

Reviewers: epriestley, chad, btrahan

Reviewed By: epriestley

CC: aran, Korvin

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

authored by

Anh Nhan Nguyen and committed by
epriestley
d2188053 3b5d9ff7

+33 -82
+33 -82
src/applications/people/controller/PhabricatorPeopleListController.php
··· 25 25 ->needPrimaryEmail(true) 26 26 ->executeWithOffsetPager($pager); 27 27 28 - $rows = array(); 28 + $list = new PhabricatorObjectItemListView(); 29 + 29 30 foreach ($users as $user) { 30 31 $primary_email = $user->loadPrimaryEmail(); 31 32 if ($primary_email && $primary_email->getIsVerified()) { ··· 34 35 $email = pht('Unverified'); 35 36 } 36 37 37 - $status = array(); 38 - if ($user->getIsDisabled()) { 39 - $status[] = pht('Disabled'); 40 - } 41 - if ($user->getIsAdmin()) { 42 - $status[] = pht('Admin'); 43 - } 44 - if ($user->getIsSystemAgent()) { 45 - $status[] = pht('System Agent'); 46 - } 47 - $status = implode(', ', $status); 38 + $user_handle = new PhabricatorObjectHandle(); 39 + $user_handle->setImageURI($user->loadProfileImageURI()); 48 40 49 - $rows[] = array( 50 - phabricator_date($user->getDateCreated(), $viewer), 51 - phabricator_time($user->getDateCreated(), $viewer), 52 - phutil_tag( 53 - 'a', 54 - array( 55 - 'href' => '/p/'.$user->getUsername().'/', 56 - ), 57 - $user->getUserName()), 58 - $user->getRealName(), 59 - $status, 60 - $email, 61 - phutil_tag( 62 - 'a', 63 - array( 64 - 'class' => 'button grey small', 65 - 'href' => '/people/edit/'.$user->getID().'/', 66 - ), 67 - pht('Administrate User')), 68 - ); 69 - } 41 + $item = new PhabricatorObjectItemView(); 42 + $item->setHeader($user->getFullName()) 43 + ->setHref('/people/edit/'.$user->getID().'/') 44 + ->addAttribute(hsprintf('%s %s', 45 + phabricator_date($user->getDateCreated(), $viewer), 46 + phabricator_time($user->getDateCreated(), $viewer))) 47 + ->addAttribute($email); 70 48 71 - $table = new AphrontTableView($rows); 72 - $table->setHeaders( 73 - array( 74 - pht('Join Date'), 75 - pht('Time'), 76 - pht('Username'), 77 - pht('Real Name'), 78 - pht('Roles'), 79 - pht('Email'), 80 - '', 81 - )); 82 - $table->setColumnClasses( 83 - array( 84 - null, 85 - 'right', 86 - 'pri', 87 - 'wide', 88 - null, 89 - null, 90 - 'action', 91 - )); 92 - $table->setColumnVisibility( 93 - array( 94 - true, 95 - true, 96 - true, 97 - true, 98 - $is_admin, 99 - $is_admin, 100 - $is_admin, 101 - )); 49 + if ($is_admin) { 50 + if ($user->getIsDisabled()) { 51 + $item->addIcon('disable', pht('Disabled')); 52 + } 102 53 103 - $panel = new AphrontPanelView(); 104 - $panel->setHeader(pht('People (%d)', number_format($count))); 105 - $panel->setNoBackground(); 106 - $panel->appendChild($table); 107 - $panel->appendChild($pager); 54 + if ($user->getIsAdmin()) { 55 + $item->addIcon('highlight', pht('Admin')); 56 + } 108 57 109 - if ($is_admin) { 110 - if (PhabricatorEnv::getEnvConfig('ldap.auth-enabled')) { 111 - $panel->addButton( 112 - phutil_tag( 113 - 'a', 114 - array( 115 - 'href' => '/people/ldap/', 116 - 'class' => 'button green' 117 - ), 118 - pht('Import from LDAP'))); 58 + if ($user->getIsSystemAgent()) { 59 + $item->addIcon('computer', pht('System Agent')); 60 + } 119 61 } 62 + 63 + $list->addItem($item); 120 64 } 121 - $crumbs = $this->buildApplicationCrumbs($this->buildSideNavView()); 65 + 66 + $header = new PhabricatorHeaderView(); 67 + $header->setHeader(pht('People (%d)', number_format($count))); 68 + 69 + $crumbs = $this->buildApplicationCrumbs(); 122 70 $crumbs->addCrumb( 123 71 id(new PhabricatorCrumbView()) 124 72 ->setName(pht('User Directory')) ··· 126 74 127 75 $nav = $this->buildSideNavView(); 128 76 $nav->selectFilter('people'); 129 - $nav->appendChild($panel); 77 + $nav->appendChild($header); 78 + $nav->appendChild($list); 79 + $nav->appendChild($pager); 130 80 $nav->setCrumbs($crumbs); 131 81 132 82 return $this->buildApplicationPage( 133 83 $nav, 134 84 array( 135 - 'title' => pht('People'), 85 + 'title' => pht('People'), 136 86 'device' => true, 87 + 'dust' => true, 137 88 )); 138 89 } 139 90 }