1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00

Modernize People UI

Summary: Updates various /people/ pages for new UI and newPage

Test Plan: Review creating people, new people, sending invites, editing a profile, setting a new picture, something with LDAP

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D15604
This commit is contained in:
Chad Little 2016-04-03 21:01:48 -07:00
parent 5452f215ee
commit f90cd8a1ed
7 changed files with 90 additions and 52 deletions

View file

@ -53,8 +53,7 @@ final class PhabricatorPeopleApproveController
return id(new AphrontRedirectResponse())->setURI($done_uri); return id(new AphrontRedirectResponse())->setURI($done_uri);
} }
$dialog = id(new AphrontDialogView()) return $this->newDialog()
->setUser($admin)
->setTitle(pht('Confirm Approval')) ->setTitle(pht('Confirm Approval'))
->appendChild( ->appendChild(
pht( pht(
@ -62,7 +61,5 @@ final class PhabricatorPeopleApproveController
phutil_tag('strong', array(), $user->getUsername()))) phutil_tag('strong', array(), $user->getUsername())))
->addCancelButton($done_uri) ->addCancelButton($done_uri)
->addSubmitButton(pht('Approve Account')); ->addSubmitButton(pht('Approve Account'));
return id(new AphrontDialogResponse())->setDialog($dialog);
} }
} }

View file

@ -90,19 +90,25 @@ final class PhabricatorPeopleCreateController
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb($title); $crumbs->addTextCrumb($title);
$crumbs->setBorder(true);
$header = id(new PHUIHeaderView())
->setHeader($title)
->setHeaderIcon('fa-user');
$box = id(new PHUIObjectBoxView()) $box = id(new PHUIObjectBoxView())
->setHeaderText($title) ->setHeaderText(pht('User'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setForm($form); ->setForm($form);
return $this->buildApplicationPage( $view = id(new PHUITwoColumnView())
array( ->setHeader($header)
$crumbs, ->setFooter($box);
$box,
), return $this->newPage()
array( ->setTitle($title)
'title' => $title, ->setCrumbs($crumbs)
)); ->appendChild($view);
} }
} }

View file

@ -125,8 +125,10 @@ final class PhabricatorPeopleInviteSendController
} else { } else {
$crumbs->addTextCrumb(pht('Invite Users')); $crumbs->addTextCrumb(pht('Invite Users'));
} }
$crumbs->setBorder(true);
$confirm_box = null; $confirm_box = null;
$info_view = null;
if ($is_confirm) { if ($is_confirm) {
$handles = array(); $handles = array();
@ -157,14 +159,15 @@ final class PhabricatorPeopleInviteSendController
->setValue(pht('Send Invitations'))); ->setValue(pht('Send Invitations')));
} }
$confirm_box = id(new PHUIObjectBoxView()) $info_view = id(new PHUIInfoView())
->setInfoView(
id(new PHUIInfoView())
->setErrors($confirm_errors) ->setErrors($confirm_errors)
->setSeverity($severity)) ->setSeverity($severity);
$confirm_box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Confirm Invites')) ->setHeaderText(pht('Confirm Invites'))
->setTable($invite_table) ->setTable($invite_table)
->appendChild($confirm_form); ->appendChild($confirm_form)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY);
} }
$form = id(new AphrontFormView()) $form = id(new AphrontFormView())
@ -197,23 +200,32 @@ final class PhabricatorPeopleInviteSendController
: pht('Continue')) : pht('Continue'))
->addCancelButton($this->getApplicationURI('invite/'))); ->addCancelButton($this->getApplicationURI('invite/')));
$header = id(new PHUIHeaderView())
->setHeader($title)
->setHeaderIcon('fa-group');
$box = id(new PHUIObjectBoxView()) $box = id(new PHUIObjectBoxView())
->setHeaderText( ->setHeaderText(
$is_confirm $is_confirm
? pht('Revise Invites') ? pht('Revise Invites')
: pht('Invite Users')) : pht('Invite Users'))
->setFormErrors($errors) ->setFormErrors($errors)
->setForm($form); ->setForm($form)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY);
return $this->buildApplicationPage( $view = id(new PHUITwoColumnView())
array( ->setHeader($header)
$crumbs, ->setFooter(array(
$info_view,
$confirm_box, $confirm_box,
$box, $box,
),
array(
'title' => $title,
)); ));
return $this->newPage()
->setTitle($title)
->setCrumbs($crumbs)
->appendChild($view);
} }
} }

View file

@ -42,7 +42,6 @@ final class PhabricatorPeopleLdapController
$this->getApplicationURI('/ldap/')); $this->getApplicationURI('/ldap/'));
$nav = $this->buildSideNavView(); $nav = $this->buildSideNavView();
$nav->setCrumbs($crumbs);
$nav->selectFilter('ldap'); $nav->selectFilter('ldap');
$nav->appendChild($content); $nav->appendChild($content);
@ -56,11 +55,10 @@ final class PhabricatorPeopleLdapController
$nav->appendChild($this->processSearchRequest($request)); $nav->appendChild($this->processSearchRequest($request));
} }
return $this->buildApplicationPage( return $this->newPage()
$nav, ->setTitle(pht('Import Ldap Users'))
array( ->setCrumbs($crumbs)
'title' => pht('Import Ldap Users'), ->setNavigation($nav);
));
} }
private function processImportRequest($request) { private function processImportRequest($request) {

View file

@ -208,22 +208,28 @@ final class PhabricatorPeopleNewController
$title = pht('Create New User'); $title = pht('Create New User');
$form_box = id(new PHUIObjectBoxView()) $box = id(new PHUIObjectBoxView())
->setHeaderText($title) ->setHeaderText(pht('User'))
->setFormErrors($errors) ->setFormErrors($errors)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setForm($form); ->setForm($form);
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb($title); $crumbs->addTextCrumb($title);
$crumbs->setBorder(true);
return $this->buildApplicationPage( $header = id(new PHUIHeaderView())
array( ->setHeader($title)
$crumbs, ->setHeaderIcon('fa-user');
$form_box,
), $view = id(new PHUITwoColumnView())
array( ->setHeader($header)
'title' => $title, ->setFooter($box);
));
return $this->newPage()
->setTitle($title)
->setCrumbs($crumbs)
->appendChild($view);
} }
} }

View file

@ -75,24 +75,33 @@ final class PhabricatorPeopleProfileEditController
} }
$form_box = id(new PHUIObjectBoxView()) $form_box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Edit Profile')) ->setHeaderText(pht('Profile'))
->setValidationException($validation_exception) ->setValidationException($validation_exception)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setForm($form); ->setForm($form);
if ($note) {
$form_box->setInfoView($note);
}
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(pht('Edit Profile')); $crumbs->addTextCrumb(pht('Edit Profile'));
$crumbs->setBorder(true);
$nav = $this->getProfileMenu(); $nav = $this->getProfileMenu();
$nav->selectFilter(PhabricatorPeopleProfilePanelEngine::PANEL_MANAGE); $nav->selectFilter(PhabricatorPeopleProfilePanelEngine::PANEL_MANAGE);
$header = id(new PHUIHeaderView())
->setHeader(pht('Edit Profile: %s', $user->getFullName()))
->setHeaderIcon('fa-pencil');
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter(array(
$note,
$form_box,
));
return $this->newPage() return $this->newPage()
->setTitle($title) ->setTitle($title)
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->setNavigation($nav) ->setNavigation($nav)
->appendChild($form_box); ->appendChild($view);
} }
} }

View file

@ -228,6 +228,7 @@ final class PhabricatorPeopleProfilePictureController
$form_box = id(new PHUIObjectBoxView()) $form_box = id(new PHUIObjectBoxView())
->setHeaderText($title) ->setHeaderText($title)
->setFormErrors($errors) ->setFormErrors($errors)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setForm($form); ->setForm($form);
$upload_form = id(new AphrontFormView()) $upload_form = id(new AphrontFormView())
@ -247,22 +248,31 @@ final class PhabricatorPeopleProfilePictureController
$upload_box = id(new PHUIObjectBoxView()) $upload_box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Upload New Picture')) ->setHeaderText(pht('Upload New Picture'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setForm($upload_form); ->setForm($upload_form);
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(pht('Edit Profile Picture')); $crumbs->addTextCrumb(pht('Edit Profile Picture'));
$crumbs->setBorder(true);
$nav = $this->getProfileMenu(); $nav = $this->getProfileMenu();
$nav->selectFilter(PhabricatorPeopleProfilePanelEngine::PANEL_MANAGE); $nav->selectFilter(PhabricatorPeopleProfilePanelEngine::PANEL_MANAGE);
$header = id(new PHUIHeaderView())
->setHeader(pht('Edit Profile Picture'))
->setHeaderIcon('fa-camera');
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter(array(
$form_box,
$upload_box,
));
return $this->newPage() return $this->newPage()
->setTitle($title) ->setTitle($title)
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->setNavigation($nav) ->setNavigation($nav)
->appendChild( ->appendChild($view);
array(
$form_box,
$upload_box,
));
} }
} }