diff --git a/framework/core/ember/app/components/discussions/post.js b/framework/core/ember/app/components/discussions/post-full.js
similarity index 92%
rename from framework/core/ember/app/components/discussions/post.js
rename to framework/core/ember/app/components/discussions/post-full.js
index 5e1bf63ad..a42a018d4 100644
--- a/framework/core/ember/app/components/discussions/post.js
+++ b/framework/core/ember/app/components/discussions/post-full.js
@@ -5,12 +5,12 @@ import ActionButton from '../ui/controls/action-button';
export default Ember.Component.extend({
tagName: 'article',
- templateName: 'components/discussions/post',
+ layoutName: 'components/discussions/post-full',
// controls: null,
contentComponent: function() {
- return 'discussions/post-'+this.get('post.type');
+ return 'discussions/post-content-'+this.get('post.type');
}.property('post.type'),
classNames: ['post'],
diff --git a/framework/core/ember/app/components/ui/controls/item-list.js b/framework/core/ember/app/components/ui/controls/item-list.js
index 72899f14e..99dd5f714 100644
--- a/framework/core/ember/app/components/ui/controls/item-list.js
+++ b/framework/core/ember/app/components/ui/controls/item-list.js
@@ -7,7 +7,7 @@ export default Ember.Component.extend({
layoutName: 'components/ui/controls/item-list',
listItems: function() {
- if (!this.get('items')) return [];
+ if (!Ember.isArray(this.get('items'))) return [];
var listItems = [];
this.get('items').forEach(function(item) {
if (item.tagName != 'li') {
diff --git a/framework/core/ember/app/models/discussion.js b/framework/core/ember/app/models/discussion.js
index fb9fdd6d6..cff307ef8 100644
--- a/framework/core/ember/app/models/discussion.js
+++ b/framework/core/ember/app/models/discussion.js
@@ -34,48 +34,12 @@ var Discussion = DS.Model.extend({
return this.get('posts').split(',');
}.property('posts'),
+ readTime: DS.attr('date'),
readNumber: DS.attr('number'),
unreadCount: function() {
return this.get('lastPostNumber') - this.get('readNumber');
}.property('lastPostNumber', 'readNumber'),
-
- //--------------------------------
- // Prototype generated properties
-
- // category: function() {
- // var categories = [null, 'Announcements', 'General', 'Support', 'Feedback', 'Core', 'Plugins', 'Themes'];
- // return categories[Math.floor(Math.random() * categories.length)];
- // }.property(),
- category: DS.attr('string'),
-
- _recent: function() {
- var cutoff = new Date('September 19, 2014');
- return this.get('lastTime') > cutoff;
- }.property('lastTime'),
-
- unread: function() {
- return Math.round(Math.random() * (this.get('_recent') ? 0.8 : 0) * this.get('postsCount'));
- }.property(),
-
- // sticky: function() {
- // return Math.random() > (this.get('_recent') ? 0.95 : 0.99);
- // }.property(),
- sticky: DS.attr('boolean'),
-
- excerpt: function() {
- // return 'I want to get your thoughts on this one TV Addicts: what new show have you been getting into this year, and why?';
- // return 'Here\'s the near-final game list, in no particular order. The list may be subject to amendments, as we\'re still chasing up copies of some games.';
- // return 'Nominating for the Annual General Meeting is easy. Read this to find out how.'
- return 'There are many apps made with Ninetech in the Mac App Store. If you\'d like, take a moment to share your Nintech-made apps in this thread.';
- }.property(),
-
- locked: function() {
- return Math.random() > 0.95;
- }.property(),
-
- following: function() {
- return Math.random() > 0.95;
- }.property()
+ isUnread: Ember.computed.bool('unreadCount')
});
export default Discussion;
diff --git a/framework/core/ember/app/templates/components/discussions/discussion-listing.hbs b/framework/core/ember/app/templates/components/discussions/discussion-listing.hbs
index 096e67475..967931c0c 100644
--- a/framework/core/ember/app/templates/components/discussions/discussion-listing.hbs
+++ b/framework/core/ember/app/templates/components/discussions/discussion-listing.hbs
@@ -26,7 +26,7 @@
{{/link-to}}
- {{#if discussion.unread}}
+ {{#if discussion.isUnread}}
{{abbreviate-number discussion.unreadCount}} unread
{{else}}
{{abbreviate-number discussion.repliesCount}} replies
diff --git a/framework/core/ember/app/templates/components/discussions/post-comment.hbs b/framework/core/ember/app/templates/components/discussions/post-comment.hbs
deleted file mode 100644
index 8af1bacd7..000000000
--- a/framework/core/ember/app/templates/components/discussions/post-comment.hbs
+++ /dev/null
@@ -1,26 +0,0 @@
-{{#if post.deleteTime}}
-
-{{/if}}
-
-
-
- {{#link-to "user" post.user}}{{user-avatar post.user}} {{post.user.username}}{{/link-to}}
-
-
-
-
- {{{post.contentHtml}}}
-
-
-
diff --git a/framework/core/ember/app/templates/components/discussions/post-content-comment.hbs b/framework/core/ember/app/templates/components/discussions/post-content-comment.hbs
new file mode 100644
index 000000000..cbfef68a6
--- /dev/null
+++ b/framework/core/ember/app/templates/components/discussions/post-content-comment.hbs
@@ -0,0 +1,23 @@
+{{#if post.deleteTime}}
+ {{fa-icon "trash-o" class="post-icon"}}
+{{/if}}
+
+
+
+ {{#link-to "user" post.user}}{{user-avatar post.user}} {{post.user.username}}{{/link-to}}
+
+ {{#link-to "discussion" post.discussion (query-params start=post.number) class="time"}}
+ {{abbreviate-time post.time}}
+ {{/link-to}}
+ {{#if post.editTime}}
+ {{fa-icon "pencil"}}
+ {{/if}}
+
+
+
+ {{{post.contentHtml}}}
+
+
+
+ {{ui/controls/item-list items=meta}}
+
diff --git a/framework/core/ember/app/templates/components/discussions/post-content-title.hbs b/framework/core/ember/app/templates/components/discussions/post-content-title.hbs
new file mode 100644
index 000000000..b74045598
--- /dev/null
+++ b/framework/core/ember/app/templates/components/discussions/post-content-title.hbs
@@ -0,0 +1,4 @@
+
+ {{fa-icon "pencil" class="post-icon"}}
+ {{#link-to "user" post.user}}{{post.user.username}}{{/link-to}} changed the title from {{post.oldTitle}} to {{post.newTitle}} .
+
diff --git a/framework/core/ember/app/templates/components/discussions/post-full.hbs b/framework/core/ember/app/templates/components/discussions/post-full.hbs
new file mode 100644
index 000000000..fc7df099f
--- /dev/null
+++ b/framework/core/ember/app/templates/components/discussions/post-full.hbs
@@ -0,0 +1,3 @@
+{{ui/controls/dropdown-button items=controls}}
+
+{{dynamic-component type=contentComponent post=post}}
diff --git a/framework/core/ember/app/templates/components/discussions/post-title.hbs b/framework/core/ember/app/templates/components/discussions/post-title.hbs
deleted file mode 100644
index f87bdd2f7..000000000
--- a/framework/core/ember/app/templates/components/discussions/post-title.hbs
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- {{#link-to "user" post.user}}{{post.user.username}}{{/link-to}} named the discussion: {{post.content}} .
-
diff --git a/framework/core/ember/app/templates/components/discussions/post.hbs b/framework/core/ember/app/templates/components/discussions/post.hbs
deleted file mode 100644
index 33b8bb121..000000000
--- a/framework/core/ember/app/templates/components/discussions/post.hbs
+++ /dev/null
@@ -1,12 +0,0 @@
-{{!-- {{#if view.controls}}
-
- {{fa-icon "caret-down"}}
- {{menu-list items=controls class="dropdown-menu pull-right"}}
-
-{{/if}} --}}
-
-{{#link-to "discussion" post.discussion (query-params start=post.number) class="time"}}
- {{abbreviate-time post.time}}
-{{/link-to}}
-
-{{dynamic-component type=contentComponent post=post}}
diff --git a/framework/core/ember/app/templates/discussion.hbs b/framework/core/ember/app/templates/discussion.hbs
index 232547901..7dc434675 100644
--- a/framework/core/ember/app/templates/discussion.hbs
+++ b/framework/core/ember/app/templates/discussion.hbs
@@ -1,17 +1,15 @@
- {{view view.sidebar viewName="sidebar"}}
+ {{ui/controls/item-list items=view.sidebarItems}}
-
-{{#each item in postStream}}
-
- {{#discussion-item item=item}}
- {{#if item.post}}{{discussion-post post=item.post}}{{/if}}
- {{/discussion-item}}
-
-{{/each}}
+
+ {{#each item in stream}}
+ {{#discussions/stream-item item=item loadRange="loadRange"}}
+ {{#if item.post}}{{discussions/post-full post=item.post}}{{/if}}
+ {{/discussions/stream-item}}
+ {{/each}}
\ No newline at end of file
diff --git a/framework/core/ember/app/templates/discussions.hbs b/framework/core/ember/app/templates/discussions.hbs
index c940cd9f5..e7346d187 100644
--- a/framework/core/ember/app/templates/discussions.hbs
+++ b/framework/core/ember/app/templates/discussions.hbs
@@ -25,7 +25,7 @@
{{else}}
{{#each discussion in content}}
- {{discussions/discussion-listing discussion=discussion}}
+ {{discussions/discussion-listing discussion=discussion searchQuery=searchQuery}}
{{/each}}
diff --git a/framework/core/ember/app/templates/partials/discussion-header.hbs b/framework/core/ember/app/templates/partials/discussion-header.hbs
deleted file mode 100644
index e69de29bb..000000000