From f0066ed742338f7e7d9e26c1e2c78812ff86c6b1 Mon Sep 17 00:00:00 2001 From: epriestley Date: Sat, 19 Feb 2011 17:33:53 -0800 Subject: [PATCH] Very very rough cut of profiles. Summary: Test Plan: Reviewers: CC: --- src/__celerity_resource_map__.php | 67 ++++++----- .../PhabricatorPeopleProfileController.php | 107 +++++++++++++++++- .../people/controller/profile/__init__.php | 4 + .../rsrc/css/application/people/profile.css | 86 ++++++++++++++ 4 files changed, 234 insertions(+), 30 deletions(-) create mode 100644 webroot/rsrc/css/application/people/profile.css diff --git a/src/__celerity_resource_map__.php b/src/__celerity_resource_map__.php index ffade93324..45165c3d2c 100644 --- a/src/__celerity_resource_map__.php +++ b/src/__celerity_resource_map__.php @@ -18,7 +18,7 @@ celerity_register_resource_map(array( ), 'aphront-dialog-view-css' => array( - 'uri' => '/res/c8324e86/rsrc/css/aphront/dialog-view.css', + 'uri' => '/res/7101ab69/rsrc/css/aphront/dialog-view.css', 'type' => 'css', 'requires' => array( @@ -154,7 +154,7 @@ celerity_register_resource_map(array( ), 'differential-revision-detail-css' => array( - 'uri' => '/res/230a67c6/rsrc/css/application/differential/revision-detail.css', + 'uri' => '/res/7b5e95cc/rsrc/css/application/differential/revision-detail.css', 'type' => 'css', 'requires' => array( @@ -225,9 +225,18 @@ celerity_register_resource_map(array( ), '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' => array( - 'uri' => '/res/ee35ffe1/rsrc/css/core/buttons.css', + 'uri' => '/res/53b4f712/rsrc/css/core/buttons.css', 'type' => 'css', 'requires' => array( @@ -272,7 +281,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-phabricator-object-selector' => 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', 'requires' => array( @@ -455,7 +464,7 @@ celerity_register_resource_map(array( ), array ( 'packages' => array ( - 'aa43d409' => + '93a93aee' => array ( 'name' => 'core.pkg.css', 'symbols' => @@ -474,10 +483,10 @@ celerity_register_resource_map(array( 11 => 'phabricator-remarkup-css', 12 => 'syntax-highlighting-css', ), - 'uri' => '/res/pkg/aa43d409/core.pkg.css', + 'uri' => '/res/pkg/93a93aee/core.pkg.css', 'type' => 'css', ), - '2525bbc7' => + 'fcf7ec68' => array ( 'name' => 'differential.pkg.css', 'symbols' => @@ -491,7 +500,7 @@ celerity_register_resource_map(array( 6 => 'differential-revision-add-comment-css', 7 => 'differential-revision-comment-list-css', ), - 'uri' => '/res/pkg/2525bbc7/differential.pkg.css', + 'uri' => '/res/pkg/fcf7ec68/differential.pkg.css', 'type' => 'css', ), '30d594cf' => @@ -511,27 +520,27 @@ celerity_register_resource_map(array( ), 'reverse' => array ( - 'phabricator-core-css' => 'aa43d409', - 'phabricator-core-buttons-css' => 'aa43d409', - 'phabricator-standard-page-view' => 'aa43d409', - 'aphront-dialog-view-css' => 'aa43d409', - 'aphront-form-view-css' => 'aa43d409', - 'aphront-panel-view-css' => 'aa43d409', - 'aphront-side-nav-view-css' => 'aa43d409', - 'aphront-table-view-css' => 'aa43d409', - 'aphront-tokenizer-control-css' => 'aa43d409', - 'aphront-typeahead-control-css' => 'aa43d409', - 'phabricator-directory-css' => 'aa43d409', - 'phabricator-remarkup-css' => 'aa43d409', - 'syntax-highlighting-css' => 'aa43d409', - 'differential-core-view-css' => '2525bbc7', - 'differential-changeset-view-css' => '2525bbc7', - 'differential-revision-detail-css' => '2525bbc7', - 'differential-revision-history-css' => '2525bbc7', - 'differential-table-of-contents-css' => '2525bbc7', - 'differential-revision-comment-css' => '2525bbc7', - 'differential-revision-add-comment-css' => '2525bbc7', - 'differential-revision-comment-list-css' => '2525bbc7', + 'phabricator-core-css' => '93a93aee', + 'phabricator-core-buttons-css' => '93a93aee', + 'phabricator-standard-page-view' => '93a93aee', + 'aphront-dialog-view-css' => '93a93aee', + 'aphront-form-view-css' => '93a93aee', + 'aphront-panel-view-css' => '93a93aee', + 'aphront-side-nav-view-css' => '93a93aee', + 'aphront-table-view-css' => '93a93aee', + 'aphront-tokenizer-control-css' => '93a93aee', + 'aphront-typeahead-control-css' => '93a93aee', + 'phabricator-directory-css' => '93a93aee', + 'phabricator-remarkup-css' => '93a93aee', + 'syntax-highlighting-css' => '93a93aee', + 'differential-core-view-css' => 'fcf7ec68', + 'differential-changeset-view-css' => 'fcf7ec68', + 'differential-revision-detail-css' => 'fcf7ec68', + 'differential-revision-history-css' => 'fcf7ec68', + 'differential-table-of-contents-css' => 'fcf7ec68', + 'differential-revision-comment-css' => 'fcf7ec68', + 'differential-revision-add-comment-css' => 'fcf7ec68', + 'differential-revision-comment-list-css' => 'fcf7ec68', 'javelin-behavior-differential-feedback-preview' => '30d594cf', 'javelin-behavior-differential-edit-inline-comments' => '30d594cf', 'javelin-behavior-differential-populate' => '30d594cf', diff --git a/src/applications/people/controller/profile/PhabricatorPeopleProfileController.php b/src/applications/people/controller/profile/PhabricatorPeopleProfileController.php index 4f1a76efbe..a865830539 100644 --- a/src/applications/people/controller/profile/PhabricatorPeopleProfileController.php +++ b/src/applications/people/controller/profile/PhabricatorPeopleProfileController.php @@ -26,6 +26,8 @@ class PhabricatorPeopleProfileController extends PhabricatorPeopleController { public function processRequest() { + $viewer = $this->getRequest()->getUser(); + $user = id(new PhabricatorUser())->loadOneWhere( 'userName = %s', $this->username); @@ -33,9 +35,112 @@ class PhabricatorPeopleProfileController extends PhabricatorPeopleController { 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] = '
  • '.$link.'
  • '; + } + $links = + ''; + + $username_tag = + '

    '. + phutil_escape_html($user->getUserName()). + '

    '; + $realname_tag = + '

    '. + '('.phutil_escape_html($user->getRealName()).')'. + '

    '; + $title_tag = + '

    '. + 'Cool Title'. + '

    '; + + $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 = + '
    +

    Basic Information

    +
    + + + + + + + + + +
    PHID'.phutil_escape_html($user->getPHID()).'
    User Since'.phabricator_format_timestamp($user->getDateCreated()).'
    +
    +
    '; + $content .= + '
    +

    Flavor Text

    +
    + + + + + +
    Blurb'.$blurb.'
    +
    +
    '; + + $profile = + ' + + + + +
    '. + $username_tag. + $realname_tag. + $title_tag. + '
    '. + $picture. + '
    '. + $links. + '
    '. + '
    '. + $content. + '
    '; return $this->buildStandardPageResponse( - array('this is a profile thingie'), + $profile, array( 'title' => $user->getUsername(), )); diff --git a/src/applications/people/controller/profile/__init__.php b/src/applications/people/controller/profile/__init__.php index 6993f52ebb..099425d646 100644 --- a/src/applications/people/controller/profile/__init__.php +++ b/src/applications/people/controller/profile/__init__.php @@ -7,9 +7,13 @@ 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/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'); diff --git a/webroot/rsrc/css/application/people/profile.css b/webroot/rsrc/css/application/people/profile.css new file mode 100644 index 0000000000..75e94007c1 --- /dev/null +++ b/webroot/rsrc/css/application/people/profile.css @@ -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; +}