diff --git a/js/collections/CourseCollection.js b/js/collections/CourseCollection.js index 5c1afe1..f224a19 100644 --- a/js/collections/CourseCollection.js +++ b/js/collections/CourseCollection.js @@ -16,6 +16,21 @@ define([ if (activeSpec === 'all' || activeSpec === '' || !activeSpec) { return list; } + + if (activeSpec === 'opt') { + + var res = []; + res = _.filter(list,function(c) { + var specials = c.getSpecials(); + specials = _.map(specials, function (s) { + return s.shortname; + }); + return _.find(specials, function (s) { + return !s.includes('_'); + }); + }); + return res; + } var res = []; res = _.filter(list, function (c) { @@ -161,4 +176,4 @@ define([ return CourseCollection; -}); \ No newline at end of file +}); diff --git a/js/templates/SpecialSelectorTemplate.html b/js/templates/SpecialSelectorTemplate.html index f8ce059..d25a1e5 100644 --- a/js/templates/SpecialSelectorTemplate.html +++ b/js/templates/SpecialSelectorTemplate.html @@ -1,6 +1,7 @@ \ No newline at end of file +