mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 00:42:41 +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:
parent
ce891cbf4e
commit
2cec36d858
9 changed files with 72 additions and 20 deletions
|
@ -1352,7 +1352,7 @@ celerity_register_resource_map(array(
|
|||
),
|
||||
'phabricator-feed-css' =>
|
||||
array(
|
||||
'uri' => '/res/32e5879b/rsrc/css/application/feed/feed.css',
|
||||
'uri' => '/res/7d1d0015/rsrc/css/application/feed/feed.css',
|
||||
'type' => 'css',
|
||||
'requires' =>
|
||||
array(
|
||||
|
@ -1409,7 +1409,7 @@ celerity_register_resource_map(array(
|
|||
),
|
||||
'phabricator-profile-css' =>
|
||||
array(
|
||||
'uri' => '/res/ebe1ac2f/rsrc/css/application/profile/profile-view.css',
|
||||
'uri' => '/res/9869d10b/rsrc/css/application/profile/profile-view.css',
|
||||
'type' => 'css',
|
||||
'requires' =>
|
||||
array(
|
||||
|
|
|
@ -50,18 +50,44 @@ final class PhabricatorFeedBuilder {
|
|||
|
||||
$null_view = new AphrontNullView();
|
||||
|
||||
$views = array();
|
||||
require_celerity_resource('phabricator-feed-css');
|
||||
|
||||
$last_date = null;
|
||||
$today = phabricator_date(time(), $user);
|
||||
foreach ($stories as $story) {
|
||||
$story->setHandles($handles);
|
||||
$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->setViewer($user);
|
||||
|
||||
$null_view->appendChild($view);
|
||||
}
|
||||
|
||||
return $null_view;
|
||||
return id(new AphrontNullView())->appendChild(
|
||||
'<div class="phabricator-feed-frame">'.
|
||||
$null_view->render().
|
||||
'</div>');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -7,8 +7,11 @@
|
|||
|
||||
|
||||
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/utils');
|
||||
|
||||
phutil_require_module('phutil', 'markup');
|
||||
phutil_require_module('phutil', 'utils');
|
||||
|
||||
|
||||
|
|
|
@ -59,4 +59,8 @@ abstract class PhabricatorFeedStory {
|
|||
return $this->data;
|
||||
}
|
||||
|
||||
final public function getEpoch() {
|
||||
return $this->getStoryData()->getEpoch();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ class PhabricatorFeedStoryDifferential extends PhabricatorFeedStory {
|
|||
|
||||
$view->setTitle(
|
||||
'<strong>'.$handles[$author_phid]->renderLink().'</strong>'.
|
||||
' '.$verb.' '.
|
||||
' '.$verb.' revision '.
|
||||
'<strong>'.$handles[$revision_phid]->renderLink().'</strong>.');
|
||||
$view->setEpoch($data->getEpoch());
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ class PhabricatorFeedStoryManiphest extends PhabricatorFeedStory {
|
|||
$verb = ManiphestAction::getActionPastTenseVerb($action);
|
||||
$title =
|
||||
'<strong>'.$handles[$author_phid]->renderLink().'</strong>'.
|
||||
" {$verb} ".
|
||||
" {$verb} task ".
|
||||
'<strong>'.$handles[$task_phid]->renderLink().'</strong>';
|
||||
switch ($action) {
|
||||
case ManiphestAction::ACTION_ASSIGN:
|
||||
|
|
|
@ -82,14 +82,7 @@ class PhabricatorProjectProfileController
|
|||
));
|
||||
$stories = $query->execute();
|
||||
|
||||
$builder = new PhabricatorFeedBuilder($stories);
|
||||
$builder->setUser($user);
|
||||
$view = $builder->buildView();
|
||||
|
||||
$content .=
|
||||
'<div style="padding: 2em;">'.
|
||||
$view->render().
|
||||
'</div>';
|
||||
$content .= $this->renderStories($stories);
|
||||
break;
|
||||
case 'about':
|
||||
$content = $this->renderAboutPage($project, $profile);
|
||||
|
@ -104,7 +97,7 @@ class PhabricatorProjectProfileController
|
|||
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);
|
||||
|
||||
$header = new PhabricatorProfileHeaderView();
|
||||
|
@ -238,11 +231,22 @@ class PhabricatorProjectProfileController
|
|||
));
|
||||
$stories = $query->execute();
|
||||
|
||||
return $this->renderStories($stories);
|
||||
}
|
||||
|
||||
private function renderStories(array $stories) {
|
||||
|
||||
$builder = new PhabricatorFeedBuilder($stories);
|
||||
$builder->setUser($this->getRequest()->getUser());
|
||||
$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>';
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -2,6 +2,11 @@
|
|||
* @provides phabricator-feed-css
|
||||
*/
|
||||
|
||||
.phabricator-feed-frame {
|
||||
width: 640px;
|
||||
padding: 1em;
|
||||
}
|
||||
|
||||
.phabricator-feed-story {
|
||||
padding-left: 64px;
|
||||
margin: .5em 0 1em;
|
||||
|
@ -27,3 +32,14 @@
|
|||
color: #888888;
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -70,17 +70,16 @@ td.phabricator-profile-content {
|
|||
|
||||
.phabricator-profile-info-group {
|
||||
margin-bottom: 2em;
|
||||
background: #efefef;
|
||||
border-top: 1px solid #cccccc;
|
||||
}
|
||||
|
||||
.phabricator-profile-info-header {
|
||||
padding: 8px;
|
||||
background: #dfdfdf;
|
||||
background: #f0f0f0;
|
||||
border-top: 1px solid #d9d9d9;
|
||||
}
|
||||
|
||||
.phabricator-profile-info-pane {
|
||||
padding: 8px 2em;
|
||||
padding: 8px .5em;
|
||||
}
|
||||
|
||||
.phabricator-profile-info-table {
|
||||
|
|
Loading…
Reference in a new issue