v1.18.x
Julian Lam 12 years ago
parent 743e0569c1
commit 7ec8358369

@ -152,7 +152,14 @@
padding: 5px 5px 5px 0px; padding: 5px 5px 5px 0px;
li { li {
clear: both;
line-height: 16px; line-height: 16px;
margin-bottom: 1em;
&:last-child {
margin-bottom: 0;
}
img { img {
display: block; display: block;
float: left; float: left;
@ -162,8 +169,10 @@
padding-left:5px; padding-left:5px;
overflow: hidden; overflow: hidden;
height: 32px; height: 32px;
margin-bottom: 0.5em;
} }
span { span {
font-size: 12px;
display: block; display: block;
overflow: hidden; overflow: hidden;
height: 16px; height: 16px;

@ -66,25 +66,25 @@
if (!posts || posts.length === 0) { if (!posts || posts.length === 0) {
return; return;
} }
var recent_replies = document.getElementById('category_recent_replies'); var recent_replies = document.getElementById('category_recent_replies');
recent_replies.innerHTML = ''; recent_replies.innerHTML = '';
for (var i=0, ii=posts.length; i<ii; i++) { var frag = document.createDocumentFragment(),
li = document.createElement('li');
var a = document.createElement('a'), for (var i=0,numPosts=posts.length; i<numPosts; i++) {
ul = document.createElement('ul'), var dateString = utils.relativeTime(posts[i].timestamp);
username = posts[i].username, li.setAttribute('data-pid', posts[i].pid);
picture = posts[i].picture; li.innerHTML = '<img title="' + posts[i].username + '" style="width: 48px; height: 48px; /*temporary*/" class="img-polaroid" src="' + posts[i].picture + '" class="" />' +
'<p>' +
'<strong>' + posts[i].username + '</strong>: ' + posts[i].content +
'</p>' +
'<span>posted ' + utils.relativeTime(posts[i].timestamp) + ' ago</span>';
ul.innerHTML = '<li><img title="' + username + '" style="width: 48px; height: 48px; /*temporary*/" class="img-polaroid" src="' + picture + '" class="" />' frag.appendChild(li.cloneNode(true));
+ '<p><strong>' + username + '</strong>: ' + posts[i].content + '</p><span>posted ' + utils.relativeTime(posts[i].timestamp) + ' ago</span></li>'; recent_replies.appendChild(frag);
a.appendChild(ul);
recent_replies.appendChild(a);
} }
}); });
})(); })();

@ -63,8 +63,8 @@
<div class="block-header"> <div class="block-header">
Recent Replies Recent Replies
</div> </div>
<div class="block-content recent-replies" id="category_recent_replies"> <div class="block-content recent-replies">
<ul id="category_recent_replies"></ul>
</div> </div>
</div> </div>
<div class="sidebar-block img-polaroid"> <div class="sidebar-block img-polaroid">

Loading…
Cancel
Save