1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-03 11:21:01 +01:00

Very very rough cut of profiles.

Summary:

Test Plan:

Reviewers:

CC:
This commit is contained in:
epriestley 2011-02-19 17:33:53 -08:00
parent 490280e6eb
commit f0066ed742
4 changed files with 234 additions and 30 deletions

View file

@ -18,7 +18,7 @@ celerity_register_resource_map(array(
), ),
'aphront-dialog-view-css' => 'aphront-dialog-view-css' =>
array( array(
'uri' => '/res/c8324e86/rsrc/css/aphront/dialog-view.css', 'uri' => '/res/7101ab69/rsrc/css/aphront/dialog-view.css',
'type' => 'css', 'type' => 'css',
'requires' => 'requires' =>
array( array(
@ -154,7 +154,7 @@ celerity_register_resource_map(array(
), ),
'differential-revision-detail-css' => 'differential-revision-detail-css' =>
array( array(
'uri' => '/res/230a67c6/rsrc/css/application/differential/revision-detail.css', 'uri' => '/res/7b5e95cc/rsrc/css/application/differential/revision-detail.css',
'type' => 'css', 'type' => 'css',
'requires' => 'requires' =>
array( array(
@ -225,9 +225,18 @@ celerity_register_resource_map(array(
), ),
'disk' => '/rsrc/css/application/objectselector/object-selector.css', 'disk' => '/rsrc/css/application/objectselector/object-selector.css',
), ),
'phabricator-profile-css' =>
array(
'uri' => '/res/c3c5c82e/rsrc/css/application/people/profile.css',
'type' => 'css',
'requires' =>
array(
),
'disk' => '/rsrc/css/application/people/profile.css',
),
'phabricator-core-buttons-css' => 'phabricator-core-buttons-css' =>
array( array(
'uri' => '/res/ee35ffe1/rsrc/css/core/buttons.css', 'uri' => '/res/53b4f712/rsrc/css/core/buttons.css',
'type' => 'css', 'type' => 'css',
'requires' => 'requires' =>
array( array(
@ -272,7 +281,7 @@ celerity_register_resource_map(array(
), ),
'javelin-behavior-phabricator-object-selector' => 'javelin-behavior-phabricator-object-selector' =>
array( array(
'uri' => '/res/e849ced6/rsrc/js/application/core/behavior-object-selector.js', 'uri' => '/res/4fe735af/rsrc/js/application/core/behavior-object-selector.js',
'type' => 'js', 'type' => 'js',
'requires' => 'requires' =>
array( array(
@ -455,7 +464,7 @@ celerity_register_resource_map(array(
), array ( ), array (
'packages' => 'packages' =>
array ( array (
'aa43d409' => '93a93aee' =>
array ( array (
'name' => 'core.pkg.css', 'name' => 'core.pkg.css',
'symbols' => 'symbols' =>
@ -474,10 +483,10 @@ celerity_register_resource_map(array(
11 => 'phabricator-remarkup-css', 11 => 'phabricator-remarkup-css',
12 => 'syntax-highlighting-css', 12 => 'syntax-highlighting-css',
), ),
'uri' => '/res/pkg/aa43d409/core.pkg.css', 'uri' => '/res/pkg/93a93aee/core.pkg.css',
'type' => 'css', 'type' => 'css',
), ),
'2525bbc7' => 'fcf7ec68' =>
array ( array (
'name' => 'differential.pkg.css', 'name' => 'differential.pkg.css',
'symbols' => 'symbols' =>
@ -491,7 +500,7 @@ celerity_register_resource_map(array(
6 => 'differential-revision-add-comment-css', 6 => 'differential-revision-add-comment-css',
7 => 'differential-revision-comment-list-css', 7 => 'differential-revision-comment-list-css',
), ),
'uri' => '/res/pkg/2525bbc7/differential.pkg.css', 'uri' => '/res/pkg/fcf7ec68/differential.pkg.css',
'type' => 'css', 'type' => 'css',
), ),
'30d594cf' => '30d594cf' =>
@ -511,27 +520,27 @@ celerity_register_resource_map(array(
), ),
'reverse' => 'reverse' =>
array ( array (
'phabricator-core-css' => 'aa43d409', 'phabricator-core-css' => '93a93aee',
'phabricator-core-buttons-css' => 'aa43d409', 'phabricator-core-buttons-css' => '93a93aee',
'phabricator-standard-page-view' => 'aa43d409', 'phabricator-standard-page-view' => '93a93aee',
'aphront-dialog-view-css' => 'aa43d409', 'aphront-dialog-view-css' => '93a93aee',
'aphront-form-view-css' => 'aa43d409', 'aphront-form-view-css' => '93a93aee',
'aphront-panel-view-css' => 'aa43d409', 'aphront-panel-view-css' => '93a93aee',
'aphront-side-nav-view-css' => 'aa43d409', 'aphront-side-nav-view-css' => '93a93aee',
'aphront-table-view-css' => 'aa43d409', 'aphront-table-view-css' => '93a93aee',
'aphront-tokenizer-control-css' => 'aa43d409', 'aphront-tokenizer-control-css' => '93a93aee',
'aphront-typeahead-control-css' => 'aa43d409', 'aphront-typeahead-control-css' => '93a93aee',
'phabricator-directory-css' => 'aa43d409', 'phabricator-directory-css' => '93a93aee',
'phabricator-remarkup-css' => 'aa43d409', 'phabricator-remarkup-css' => '93a93aee',
'syntax-highlighting-css' => 'aa43d409', 'syntax-highlighting-css' => '93a93aee',
'differential-core-view-css' => '2525bbc7', 'differential-core-view-css' => 'fcf7ec68',
'differential-changeset-view-css' => '2525bbc7', 'differential-changeset-view-css' => 'fcf7ec68',
'differential-revision-detail-css' => '2525bbc7', 'differential-revision-detail-css' => 'fcf7ec68',
'differential-revision-history-css' => '2525bbc7', 'differential-revision-history-css' => 'fcf7ec68',
'differential-table-of-contents-css' => '2525bbc7', 'differential-table-of-contents-css' => 'fcf7ec68',
'differential-revision-comment-css' => '2525bbc7', 'differential-revision-comment-css' => 'fcf7ec68',
'differential-revision-add-comment-css' => '2525bbc7', 'differential-revision-add-comment-css' => 'fcf7ec68',
'differential-revision-comment-list-css' => '2525bbc7', 'differential-revision-comment-list-css' => 'fcf7ec68',
'javelin-behavior-differential-feedback-preview' => '30d594cf', 'javelin-behavior-differential-feedback-preview' => '30d594cf',
'javelin-behavior-differential-edit-inline-comments' => '30d594cf', 'javelin-behavior-differential-edit-inline-comments' => '30d594cf',
'javelin-behavior-differential-populate' => '30d594cf', 'javelin-behavior-differential-populate' => '30d594cf',

View file

@ -26,6 +26,8 @@ class PhabricatorPeopleProfileController extends PhabricatorPeopleController {
public function processRequest() { public function processRequest() {
$viewer = $this->getRequest()->getUser();
$user = id(new PhabricatorUser())->loadOneWhere( $user = id(new PhabricatorUser())->loadOneWhere(
'userName = %s', 'userName = %s',
$this->username); $this->username);
@ -33,9 +35,112 @@ class PhabricatorPeopleProfileController extends PhabricatorPeopleController {
return new Aphront404Response(); return new Aphront404Response();
} }
$links = array();
if ($user->getPHID() == $viewer->getPHID()) {
$links[] = phutil_render_tag(
'a',
array(
'href' => '/p/'.$user->getUsername().'/edit/',
),
'Edit Profile');
}
$fbuid = $user->getFacebookUID();
if ($fbuid) {
$links[] = phutil_render_tag(
'a',
array(
'href' => 'http://www.facebook.com/profile.php?id='.$fbuid,
),
'Facebook Profile');
}
foreach ($links as $k => $link) {
$links[$k] = '<li>'.$link.'</li>';
}
$links =
'<ul class="profile-nav-links">'.
implode("\n", $links).
'</ul>';
$username_tag =
'<h1 class="profile-username">'.
phutil_escape_html($user->getUserName()).
'</h1>';
$realname_tag =
'<h2 class="profile-realname">'.
'('.phutil_escape_html($user->getRealName()).')'.
'</h2>';
$title_tag =
'<h2 class="profile-usertitle">'.
'Cool Title'.
'</h2>';
$src_phid = $user->getProfileImagePHID();
$src = PhabricatorFileURI::getViewURIForPHID($src_phid);
$picture = phutil_render_tag(
'img',
array(
'class' => 'profile-image',
'src' => $src,
));
require_celerity_resource('phabricator-profile-css');
$blurb = 'just build marawdars dood';
$content =
'<div class="phabricator-profile-info-group">
<h1 class="phabricator-profile-info-header">Basic Information</h1>
<div class="phabricator-profile-info-pane">
<table class="phabricator-profile-info-table">
<tr>
<th>PHID</th>
<td>'.phutil_escape_html($user->getPHID()).'</td>
</tr>
<tr>
<th>User Since</th>
<td>'.phabricator_format_timestamp($user->getDateCreated()).'</td>
</tr>
</table>
</div>
</div>';
$content .=
'<div class="phabricator-profile-info-group">
<h1 class="phabricator-profile-info-header">Flavor Text</h1>
<div class="phabricator-profile-info-pane">
<table class="phabricator-profile-info-table">
<tr>
<th>Blurb</th>
<td>'.$blurb.'</td>
</tr>
</table>
</div>
</div>';
$profile =
'<table class="phabricator-profile-master-layout">
<tr>
<td class="phabricator-profile-navigation">'.
$username_tag.
$realname_tag.
$title_tag.
'<hr />'.
$picture.
'<hr />'.
$links.
'<hr />'.
'</td>
<td class="phabricator-profile-content">'.
$content.
'</td>
</tr>
</table>';
return $this->buildStandardPageResponse( return $this->buildStandardPageResponse(
array('this is a profile thingie'), $profile,
array( array(
'title' => $user->getUsername(), 'title' => $user->getUsername(),
)); ));

View file

@ -7,9 +7,13 @@
phutil_require_module('phabricator', 'aphront/response/404'); phutil_require_module('phabricator', 'aphront/response/404');
phutil_require_module('phabricator', 'applications/files/uri');
phutil_require_module('phabricator', 'applications/people/controller/base'); phutil_require_module('phabricator', 'applications/people/controller/base');
phutil_require_module('phabricator', 'applications/people/storage/user'); phutil_require_module('phabricator', 'applications/people/storage/user');
phutil_require_module('phabricator', 'infrastructure/celerity/api');
phutil_require_module('phabricator', 'view/utils');
phutil_require_module('phutil', 'markup');
phutil_require_module('phutil', 'utils'); phutil_require_module('phutil', 'utils');

View file

@ -0,0 +1,86 @@
/**
* @provides phabricator-profile-css
*/
.phabricator-profile-master-layout {
width: 100%;
}
.phabricator-profile-navigation {
width: 300px;
background: #efefef;
border-right: 1px solid #cccccc;
}
.phabricator-profile-content {
padding: 2em 2%;
}
.phabricator-profile-info-group {
margin-bottom: 2em;
background: #efefef;
border-top: 1px solid #cccccc;
}
.phabricator-profile-info-header {
padding: 8px;
background: #dfdfdf;
}
.phabricator-profile-info-pane {
padding: 8px 2em;
}
.phabricator-profile-info-table {
width: 100%;
}
.phabricator-profile-info-table th {
font-weight: bold;
text-align: right;
color: #666666;
width: 10%;
padding: 4px;
}
.phabricator-profile-info-table td {
width: 100%;
padding: 4px;
}
.phabricator-profile-navigation hr {
border: none;
background: #cccccc;
padding: 0;
margin: 10px 0;
height: 1px;
}
.phabricator-profile-navigation {
padding-top: 8px;
padding-bottom: 8em;
}
.phabricator-profile-navigation h1,
.phabricator-profile-navigation h2 {
padding: 2px 8px;
}
h2.profile-realname {
color: #666666;
}
img.profile-image {
width: 280px;
margin: 10px;
}
ul.profile-nav-links li a {
display: block;
padding: 4px 8px 4px 12px;
font-weight: bold;
}
ul.profile-nav-links li a:hover {
background: #cccccc;
}