1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +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);
}
$dialog = id(new AphrontDialogView())
->setUser($admin)
return $this->newDialog()
->setTitle(pht('Confirm Approval'))
->appendChild(
pht(
@ -62,7 +61,5 @@ final class PhabricatorPeopleApproveController
phutil_tag('strong', array(), $user->getUsername())))
->addCancelButton($done_uri)
->addSubmitButton(pht('Approve Account'));
return id(new AphrontDialogResponse())->setDialog($dialog);
}
}

View file

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

View file

@ -125,8 +125,10 @@ final class PhabricatorPeopleInviteSendController
} else {
$crumbs->addTextCrumb(pht('Invite Users'));
}
$crumbs->setBorder(true);
$confirm_box = null;
$info_view = null;
if ($is_confirm) {
$handles = array();
@ -157,14 +159,15 @@ final class PhabricatorPeopleInviteSendController
->setValue(pht('Send Invitations')));
}
$info_view = id(new PHUIInfoView())
->setErrors($confirm_errors)
->setSeverity($severity);
$confirm_box = id(new PHUIObjectBoxView())
->setInfoView(
id(new PHUIInfoView())
->setErrors($confirm_errors)
->setSeverity($severity))
->setHeaderText(pht('Confirm Invites'))
->setTable($invite_table)
->appendChild($confirm_form);
->appendChild($confirm_form)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY);
}
$form = id(new AphrontFormView())
@ -197,23 +200,32 @@ final class PhabricatorPeopleInviteSendController
: pht('Continue'))
->addCancelButton($this->getApplicationURI('invite/')));
$header = id(new PHUIHeaderView())
->setHeader($title)
->setHeaderIcon('fa-group');
$box = id(new PHUIObjectBoxView())
->setHeaderText(
$is_confirm
? pht('Revise Invites')
: pht('Invite Users'))
->setFormErrors($errors)
->setForm($form);
->setForm($form)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY);
return $this->buildApplicationPage(
array(
$crumbs,
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter(array(
$info_view,
$confirm_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/'));
$nav = $this->buildSideNavView();
$nav->setCrumbs($crumbs);
$nav->selectFilter('ldap');
$nav->appendChild($content);
@ -56,11 +55,10 @@ final class PhabricatorPeopleLdapController
$nav->appendChild($this->processSearchRequest($request));
}
return $this->buildApplicationPage(
$nav,
array(
'title' => pht('Import Ldap Users'),
));
return $this->newPage()
->setTitle(pht('Import Ldap Users'))
->setCrumbs($crumbs)
->setNavigation($nav);
}
private function processImportRequest($request) {

View file

@ -208,22 +208,28 @@ final class PhabricatorPeopleNewController
$title = pht('Create New User');
$form_box = id(new PHUIObjectBoxView())
->setHeaderText($title)
$box = id(new PHUIObjectBoxView())
->setHeaderText(pht('User'))
->setFormErrors($errors)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setForm($form);
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb($title);
$crumbs->setBorder(true);
return $this->buildApplicationPage(
array(
$crumbs,
$form_box,
),
array(
'title' => $title,
));
$header = id(new PHUIHeaderView())
->setHeader($title)
->setHeaderIcon('fa-user');
$view = id(new PHUITwoColumnView())
->setHeader($header)
->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())
->setHeaderText(pht('Edit Profile'))
->setHeaderText(pht('Profile'))
->setValidationException($validation_exception)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setForm($form);
if ($note) {
$form_box->setInfoView($note);
}
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(pht('Edit Profile'));
$crumbs->setBorder(true);
$nav = $this->getProfileMenu();
$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()
->setTitle($title)
->setCrumbs($crumbs)
->setNavigation($nav)
->appendChild($form_box);
->appendChild($view);
}
}

View file

@ -228,6 +228,7 @@ final class PhabricatorPeopleProfilePictureController
$form_box = id(new PHUIObjectBoxView())
->setHeaderText($title)
->setFormErrors($errors)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setForm($form);
$upload_form = id(new AphrontFormView())
@ -247,22 +248,31 @@ final class PhabricatorPeopleProfilePictureController
$upload_box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Upload New Picture'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setForm($upload_form);
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(pht('Edit Profile Picture'));
$crumbs->setBorder(true);
$nav = $this->getProfileMenu();
$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()
->setTitle($title)
->setCrumbs($crumbs)
->setNavigation($nav)
->appendChild(
array(
$form_box,
$upload_box,
));
->appendChild($view);
}
}