Skip to content

Commit

Permalink
Some details about the display of the activity stream.
Browse files Browse the repository at this point in the history
  • Loading branch information
gdetrez committed Apr 25, 2011
1 parent e521985 commit 3b55698
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 14 deletions.
6 changes: 5 additions & 1 deletion css/activitystream.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,8 @@
#activitystream .item-list ul img {
margin: 0 0 0 -32px;
float: left;
}
}


/* identi.ca only */
.ostatus a {}
12 changes: 6 additions & 6 deletions css/layout-fixed.css
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,15 @@ body {
}

.sidebar-second #content {
width: 720px;
width: 640px;
margin-left: 0; /* LTR */
margin-right: -720px; /* LTR */ /* Negative value of #content's width + left margin. */
margin-right: -640px; /* LTR */ /* Negative value of #content's width + left margin. */
}

.two-sidebars #content {
width: 480px;
width: 400px;
margin-left: 240px; /* LTR */ /* The width of .region-sidebar-first */
margin-right: -760px; /* LTR */ /* Negative value of #content's width + left margin. */
margin-right: -640px; /* LTR */ /* Negative value of #content's width + left margin. */
}

#content .section {
Expand Down Expand Up @@ -183,8 +183,8 @@ body {
*/
.region-sidebar-second {
float: left; /* LTR */
width: 240px;
margin-left: 720px; /* LTR */ /* Width of content + sidebar-first. */
width: 320px;
margin-left: 640px; /* LTR */ /* Width of content + sidebar-first. */
margin-right: -960px; /* LTR */ /* Negative value of .region-sidebar-second's width + left margin. */
padding: 0; /* DO NOT CHANGE. Add padding or margin to .region-sidebar-second .section. */
}
Expand Down
4 changes: 4 additions & 0 deletions css/pages.css
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,10 @@ ul.links li {
.region-content-bottom /* Wrapper for any blocks placed in the "content bottom" region */ {
}


.sidebar {
border: thin #eee solid;
}
/*
* First sidebar (on left in LTR languages, on right in RTL)
*
Expand Down
6 changes: 3 additions & 3 deletions css/typography.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
}

/* grid */
#main {
background: transparent url("../images/grid.png") center -4px;
}
/* #main { */
/* background: transparent url("../images/grid.png") center -4px; */
/* } */

/* some resets */
p, ol, ul {
Expand Down
33 changes: 29 additions & 4 deletions template.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,30 @@ function STARTERKIT_preprocess_block(&$vars, $hook) {
// */

// *** Activity stream theming
// this first function is the same as the default one but patched

// this first function is the same as the default one but patched
// to avoid a warning:
function fscons_activitystream_header($action) {
return '<h3 class="datehead">' . format_date($action->created, 'medium') . '</h3>';
// I don't display headers
//return '<h3 class="datehead">' . format_date($action->created, 'medium') . '</h3>';
return null;
}

// hack the main theme function to avoid empty li (bad for accessibility)
function fscons_activitystream($items) {
drupal_add_css(drupal_get_path('module', 'activitystream') .'/activitystream.css');
$filtered_items = array();
if (!count($items)) {
$filtered_items = array(t('There are no activities to show.'));
}
foreach ($items as $an_item) {
if ($an_item != null)
$filtered_items[] = $an_item;
}
return '<div id="activitystream">'."\n". theme('item_list', $filtered_items) ."\n</div>";
}


function fscons_activitystream_item($action) {
$node = node_load($action->nid);
$date = theme('activitystream_date',$node->created);
Expand All @@ -181,7 +199,7 @@ function fscons_twitter_search_feeds_item($activity) {
$user = activitystream_user_load($node->uid);
$title = twitter_search_feeds_makelinks($node->title);
$name = theme('activitystream_username', $user);
return '<span class="activitystream-item">'. theme('twitter_search_feeds_icon') ." <span> ". $title ."\" <span class=\"activitystream-created\">$date</span></span>". l('#', 'node/'. $node->nid, array('class' => 'permalink')) .'</span>';
return '<span class="activitystream-item">'. theme('twitter_search_feeds_icon') ." <span> ". $title ." <span class=\"activitystream-created\">$date</span></span>". l('#', 'node/'. $node->nid, array('class' => 'permalink')) .'</span>';
}

/* function fscons_activitystream_identica_icon() { */
Expand All @@ -194,9 +212,16 @@ function fscons_activitystream_identicagroup_item($activity) {
$date = theme('activitystream_date', $node->created);
$user = activitystream_user_load($node->uid);
$name = theme('activitystream_username', $user);
return '<span class="activitystream-item">'. theme('activitystream_identicagroup_icon') .' <span>'." ". l($node->title, $activity->link) .'<span class="activitystream-created">'. $date .'</span></span>'. l('#', 'node/'. $node->nid, array('class' => 'permalink')) .'</span>';
return '<span class="activitystream-item ostatus">'. theme('activitystream_identicagroup_icon') .' <span>'." ". l($node->title, $activity->link) .'<span class="activitystream-created">'. $date .'</span></span>'. l('#', 'node/'. $node->nid, array('class' => 'permalink')) .'</span>';
}


function fscons_activitystream_date($date) {
$date = format_date($date, 'custom', 'Y-m-d g:ia');
return $date;
}


/* function fscons_activitystream_identicagroup_item($activity) { */
/* $node = node_load($activity->nid); */
/* $date = theme('activitystream_date', $node->created); */
Expand Down

0 comments on commit 3b55698

Please sign in to comment.