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

Minor style/layout tweaks to Project profiles and feed

Summary: Just trying to improve the design/layout a little here.

Test Plan:
https://secure.phabricator.com/file/view/PHID-FILE-xglufh3wxy34evec4o4u/

Reviewers: btrahan, jungejason

Reviewed By: jungejason

CC: aran, jungejason

Differential Revision: https://secure.phabricator.com/D1265
This commit is contained in:
epriestley 2011-12-22 08:22:07 -08:00
parent ce891cbf4e
commit 2cec36d858
9 changed files with 72 additions and 20 deletions

View file

@ -1352,7 +1352,7 @@ celerity_register_resource_map(array(
), ),
'phabricator-feed-css' => 'phabricator-feed-css' =>
array( array(
'uri' => '/res/32e5879b/rsrc/css/application/feed/feed.css', 'uri' => '/res/7d1d0015/rsrc/css/application/feed/feed.css',
'type' => 'css', 'type' => 'css',
'requires' => 'requires' =>
array( array(
@ -1409,7 +1409,7 @@ celerity_register_resource_map(array(
), ),
'phabricator-profile-css' => 'phabricator-profile-css' =>
array( array(
'uri' => '/res/ebe1ac2f/rsrc/css/application/profile/profile-view.css', 'uri' => '/res/9869d10b/rsrc/css/application/profile/profile-view.css',
'type' => 'css', 'type' => 'css',
'requires' => 'requires' =>
array( array(

View file

@ -50,18 +50,44 @@ final class PhabricatorFeedBuilder {
$null_view = new AphrontNullView(); $null_view = new AphrontNullView();
$views = array(); require_celerity_resource('phabricator-feed-css');
$last_date = null;
$today = phabricator_date(time(), $user);
foreach ($stories as $story) { foreach ($stories as $story) {
$story->setHandles($handles); $story->setHandles($handles);
$story->setObjects($objects); $story->setObjects($objects);
$date = phabricator_date($story->getEpoch(), $user);
if ($date == $today) {
$date = 'Today';
}
if ($date !== $last_date) {
if ($last_date !== null) {
$null_view->appendChild(
'<div class="phabricator-feed-story-date-separator"></div>');
}
$last_date = $date;
$null_view->appendChild(
phutil_render_tag(
'div',
array(
'class' => 'phabricator-feed-story-date',
),
phutil_escape_html($date)));
}
$view = $story->renderView(); $view = $story->renderView();
$view->setViewer($user); $view->setViewer($user);
$null_view->appendChild($view); $null_view->appendChild($view);
} }
return $null_view; return id(new AphrontNullView())->appendChild(
'<div class="phabricator-feed-frame">'.
$null_view->render().
'</div>');
} }
} }

View file

@ -7,8 +7,11 @@
phutil_require_module('phabricator', 'applications/phid/handle/data'); phutil_require_module('phabricator', 'applications/phid/handle/data');
phutil_require_module('phabricator', 'infrastructure/celerity/api');
phutil_require_module('phabricator', 'view/null'); phutil_require_module('phabricator', 'view/null');
phutil_require_module('phabricator', 'view/utils');
phutil_require_module('phutil', 'markup');
phutil_require_module('phutil', 'utils'); phutil_require_module('phutil', 'utils');

View file

@ -59,4 +59,8 @@ abstract class PhabricatorFeedStory {
return $this->data; return $this->data;
} }
final public function getEpoch() {
return $this->getStoryData()->getEpoch();
}
} }

View file

@ -50,7 +50,7 @@ class PhabricatorFeedStoryDifferential extends PhabricatorFeedStory {
$view->setTitle( $view->setTitle(
'<strong>'.$handles[$author_phid]->renderLink().'</strong>'. '<strong>'.$handles[$author_phid]->renderLink().'</strong>'.
' '.$verb.' '. ' '.$verb.' revision '.
'<strong>'.$handles[$revision_phid]->renderLink().'</strong>.'); '<strong>'.$handles[$revision_phid]->renderLink().'</strong>.');
$view->setEpoch($data->getEpoch()); $view->setEpoch($data->getEpoch());

View file

@ -49,7 +49,7 @@ class PhabricatorFeedStoryManiphest extends PhabricatorFeedStory {
$verb = ManiphestAction::getActionPastTenseVerb($action); $verb = ManiphestAction::getActionPastTenseVerb($action);
$title = $title =
'<strong>'.$handles[$author_phid]->renderLink().'</strong>'. '<strong>'.$handles[$author_phid]->renderLink().'</strong>'.
" {$verb} ". " {$verb} task ".
'<strong>'.$handles[$task_phid]->renderLink().'</strong>'; '<strong>'.$handles[$task_phid]->renderLink().'</strong>';
switch ($action) { switch ($action) {
case ManiphestAction::ACTION_ASSIGN: case ManiphestAction::ACTION_ASSIGN:

View file

@ -82,14 +82,7 @@ class PhabricatorProjectProfileController
)); ));
$stories = $query->execute(); $stories = $query->execute();
$builder = new PhabricatorFeedBuilder($stories); $content .= $this->renderStories($stories);
$builder->setUser($user);
$view = $builder->buildView();
$content .=
'<div style="padding: 2em;">'.
$view->render().
'</div>';
break; break;
case 'about': case 'about':
$content = $this->renderAboutPage($project, $profile); $content = $this->renderAboutPage($project, $profile);
@ -104,7 +97,7 @@ class PhabricatorProjectProfileController
throw new Exception("Unimplemented filter '{$this->page}'."); throw new Exception("Unimplemented filter '{$this->page}'.");
} }
$content = '<div style="padding: 2em;">'.$content.'</div>'; $content = '<div style="padding: 1em;">'.$content.'</div>';
$nav_view->appendChild($content); $nav_view->appendChild($content);
$header = new PhabricatorProfileHeaderView(); $header = new PhabricatorProfileHeaderView();
@ -238,11 +231,22 @@ class PhabricatorProjectProfileController
)); ));
$stories = $query->execute(); $stories = $query->execute();
return $this->renderStories($stories);
}
private function renderStories(array $stories) {
$builder = new PhabricatorFeedBuilder($stories); $builder = new PhabricatorFeedBuilder($stories);
$builder->setUser($this->getRequest()->getUser()); $builder->setUser($this->getRequest()->getUser());
$view = $builder->buildView(); $view = $builder->buildView();
return $view->render(); return
'<div class="phabricator-profile-info-group">'.
'<h1 class="phabricator-profile-info-header">Activity Feed</h1>'.
'<div class="phabricator-profile-info-pane">'.
$view->render().
'</div>'.
'</div>';
} }

View file

@ -2,6 +2,11 @@
* @provides phabricator-feed-css * @provides phabricator-feed-css
*/ */
.phabricator-feed-frame {
width: 640px;
padding: 1em;
}
.phabricator-feed-story { .phabricator-feed-story {
padding-left: 64px; padding-left: 64px;
margin: .5em 0 1em; margin: .5em 0 1em;
@ -27,3 +32,14 @@
color: #888888; color: #888888;
font-size: 11px; font-size: 11px;
} }
.phabricator-feed-story-date {
color: #666666;
font-size: 11px;
border-bottom: 1px solid #eeeeee;
padding: .5em 0;
}
.phabricator-feed-story-date-separator {
margin-top: 2em;
}

View file

@ -70,17 +70,16 @@ td.phabricator-profile-content {
.phabricator-profile-info-group { .phabricator-profile-info-group {
margin-bottom: 2em; margin-bottom: 2em;
background: #efefef;
border-top: 1px solid #cccccc;
} }
.phabricator-profile-info-header { .phabricator-profile-info-header {
padding: 8px; padding: 8px;
background: #dfdfdf; background: #f0f0f0;
border-top: 1px solid #d9d9d9;
} }
.phabricator-profile-info-pane { .phabricator-profile-info-pane {
padding: 8px 2em; padding: 8px .5em;
} }
.phabricator-profile-info-table { .phabricator-profile-info-table {