diff --git a/src/applications/project/controller/profile/PhabricatorProjectProfileController.php b/src/applications/project/controller/profile/PhabricatorProjectProfileController.php index e2e5ed65ac..679b3b4d1d 100644 --- a/src/applications/project/controller/profile/PhabricatorProjectProfileController.php +++ b/src/applications/project/controller/profile/PhabricatorProjectProfileController.php @@ -111,76 +111,122 @@ class PhabricatorProjectProfileController $profile->getBlurb(), '//Nothing is known about this elusive project.//'); - $factory = new DifferentialMarkupEngineFactory(); - $engine = $factory->newDifferentialCommentMarkupEngine(); - $blurb = $engine->markupText($blurb); + $factory = new DifferentialMarkupEngineFactory(); + $engine = $factory->newDifferentialCommentMarkupEngine(); + $blurb = $engine->markupText($blurb); - $affiliations = $project->loadAffiliations(); + $affiliations = $project->loadAffiliations(); - $phids = array_merge( - array($project->getAuthorPHID()), - mpull($affiliations, 'getUserPHID')); - $handles = id(new PhabricatorObjectHandleData($phids)) - ->loadHandles(); + $phids = array_merge( + array($project->getAuthorPHID()), + mpull($affiliations, 'getUserPHID')); + $handles = id(new PhabricatorObjectHandleData($phids)) + ->loadHandles(); - $affiliated = array(); - foreach ($affiliations as $affiliation) { - $user = $handles[$affiliation->getUserPHID()]->renderLink(); - $role = phutil_escape_html($affiliation->getRole()); + $affiliated = array(); + foreach ($affiliations as $affiliation) { + $user = $handles[$affiliation->getUserPHID()]->renderLink(); + $role = phutil_escape_html($affiliation->getRole()); - $status = null; - if ($affiliation->getStatus() == 'former') { - $role = 'Former '.$role.''; - } + $status = null; + if ($affiliation->getStatus() == 'former') { + $role = 'Former '.$role.''; + } - $affiliated[] = '
  • '.$user.' — '.$role.$status.'
  • '; - } - if ($affiliated) { - $affiliated = ''; - } else { - $affiliated = '

    No one is affiliated with this project.

    '; - } + $affiliated[] = '
  • '.$user.' — '.$role.$status.'
  • '; + } + if ($affiliated) { + $affiliated = ''; + } else { + $affiliated = '

    No one is affiliated with this project.

    '; + } - $timestamp = phabricator_format_timestamp($project->getDateCreated()); - $status = PhabricatorProjectStatus::getNameForStatus( - $project->getStatus()); + $timestamp = phabricator_format_timestamp($project->getDateCreated()); + $status = PhabricatorProjectStatus::getNameForStatus( + $project->getStatus()); - $content = - '
    -

    Basic Information

    -
    - - - - - - - - - - - - - - - - - - - - - -
    Creator'.$handles[$project->getAuthorPHID()]->renderLink().'
    Status'.phutil_escape_html($status).'
    Created'.$timestamp.'
    PHID'.phutil_escape_html($project->getPHID()).'
    Blurb'.$blurb.'
    -
    -
    '; + $content = + '
    +

    Basic Information

    +
    + + + + + + + + + + + + + + + + + + + + + +
    Creator'.$handles[$project->getAuthorPHID()]->renderLink().'
    Status'.phutil_escape_html($status).'
    Created'.$timestamp.'
    PHID'.phutil_escape_html($project->getPHID()).'
    Blurb'.$blurb.'
    +
    +
    '; - $content .= - '
    -

    Resources

    -
    '. + $content .= + '
    +

    Resources

    +
    '. $affiliated. - '
    -
    '; + '
    +
    '; + + $query = id(new ManiphestTaskQuery()) + ->withProjects(array($project->getPHID())) + ->withStatus(ManiphestTaskQuery::STATUS_OPEN) + ->setOrderBy(ManiphestTaskQuery::ORDER_PRIORITY) + ->setLimit(10) + ->setCalculateRows(true); + $tasks = $query->execute(); + $count = $query->getRowCount(); + + $task_views = array(); + foreach ($tasks as $task) { + $view = id(new ManiphestTaskSummaryView()) + ->setTask($task) + ->setHandles($handles) + ->setUser($this->getRequest()->getUser()); + $task_views[] = $view->render(); + } + + if (empty($tasks)) { + $task_views = 'No open tasks.'; + } else { + $task_views = implode('', $task_views); + } + + $open = number_format($count); + + $more_link = phutil_render_tag( + 'a', + array( + 'href' => '/maniphest/view/all/?projects='.$project->getPHID(), + ), + "View All Open Tasks \xC2\xBB"); + + $content .= + '
    +

    '. + "Open Tasks ({$open})". + '

    '. + '
    '. + $task_views. + ''. + '
    +
    '; return $content; } diff --git a/src/applications/project/controller/profile/__init__.php b/src/applications/project/controller/profile/__init__.php index b78ed711a8..dd824451e2 100644 --- a/src/applications/project/controller/profile/__init__.php +++ b/src/applications/project/controller/profile/__init__.php @@ -9,6 +9,8 @@ phutil_require_module('phabricator', 'aphront/response/404'); phutil_require_module('phabricator', 'applications/differential/parser/markup'); phutil_require_module('phabricator', 'applications/files/uri'); +phutil_require_module('phabricator', 'applications/maniphest/query'); +phutil_require_module('phabricator', 'applications/maniphest/view/tasksummary'); phutil_require_module('phabricator', 'applications/phid/handle/data'); phutil_require_module('phabricator', 'applications/project/constants/status'); phutil_require_module('phabricator', 'applications/project/controller/base'); diff --git a/webroot/rsrc/css/application/profile/profile-view.css b/webroot/rsrc/css/application/profile/profile-view.css index 2f54294380..43c48395f2 100644 --- a/webroot/rsrc/css/application/profile/profile-view.css +++ b/webroot/rsrc/css/application/profile/profile-view.css @@ -95,3 +95,10 @@ img.phabricator-profile-image { width: 280px; margin: 10px; } + +.phabricator-profile-info-pane-more-link { + text-align: right; + padding: .25em; + font-weight: bold; + margin: .5em 1em 0; +}