+ );
+ }
+
+ // If we're viewing the end of the discussion, the user can reply, and
+ // is not already doing so, then show a 'write a reply' placeholder.
+ if (this.viewingEnd && (!app.session.user || this.discussion.canReply())) {
+ items.push(
+
- {this.posts().map((post, i) => {
- let content;
- const attrs = {'data-index': this.visibleStart + i};
-
- if (post) {
- const time = post.time();
- const PostComponent = app.postComponents[post.contentType()];
- content = PostComponent ? PostComponent.component({post}) : '';
-
- attrs.key = 'post' + post.id();
- attrs.config = fadeIn;
- attrs['data-time'] = time.toISOString();
- attrs['data-number'] = post.number();
- attrs['data-id'] = post.id();
-
- // If the post before this one was more than 4 hours ago, we will
- // display a 'time gap' indicating how long it has been in between
- // the posts.
- const dt = time - lastTime;
-
- if (dt > 1000 * 60 * 60 * 24 * 4) {
- content = [
-
;
- })}
-
- {
- // If we're viewing the end of the discussion, the user can reply, and
- // is not already doing so, then show a 'write a reply' placeholder.
- this.viewingEnd &&
- (!app.session.user || this.discussion.canReply())
- ? (
-