TNL-5621 Fix discussion topics in MIT course.
This commit is contained in:
@@ -33,8 +33,11 @@
|
||||
entries = courseWideDiscussions.entries,
|
||||
children = courseWideDiscussions.children;
|
||||
|
||||
return HtmlUtils.joinHtml.apply(this, _.map(children, function(name) {
|
||||
var entry = entries[name];
|
||||
return HtmlUtils.joinHtml.apply(this, _.map(children, function(child) {
|
||||
// child[0] is the category name, child[1] is the type.
|
||||
// For course wide discussions, the type is always 'entry'
|
||||
var name = child[0],
|
||||
entry = entries[name];
|
||||
return subCategoryTemplate({
|
||||
name: name,
|
||||
id: entry.id,
|
||||
|
||||
@@ -48,9 +48,12 @@
|
||||
entries = inlineDiscussions.entries,
|
||||
subcategories = inlineDiscussions.subcategories;
|
||||
|
||||
return HtmlUtils.joinHtml.apply(this, _.map(children, function(name) {
|
||||
var htmlSnippet = '', entry;
|
||||
if (entries && _.has(entries, name)) {
|
||||
return HtmlUtils.joinHtml.apply(this, _.map(children, function(child) {
|
||||
var htmlSnippet = '',
|
||||
name = child[0], // child[0] is the category name
|
||||
type = child[1], // child[1] is the type (i.e. 'entry' or 'subcategory')
|
||||
entry;
|
||||
if (entries && _.has(entries, name) && type === 'entry') {
|
||||
entry = entries[name];
|
||||
htmlSnippet = entryTemplate({
|
||||
name: name,
|
||||
|
||||
Reference in New Issue
Block a user