<commit_before>/* global define */
define([
  'jquery',
  'underscore',
  'backbone',
  'text!templates/search/searchTemplate.html',
  'views/dashboard/DashboardItemView',
  'collections/courses/CourseCollection',
  'models/course/Course'
], function($, _, Backbone, SearchTemplate, SearchItemView, CourseCollection, Course){

  //Handlebars
  _.templateSettings = {
  interpolate: /\{\{(.+?)\}\}/g
  };
  var DashboardView = Backbone.View.extend({
    el: $("#page"),
    initialize: function() {
      var self = this;

      var Courses = new CourseCollection();
      Courses.fetch({
        success: function(err,data) {

        _.each(data, function(data) {
          var aCourse = new Course();
          aCourse.set(data);
          Courses.add(aCourse);
          // var item = new SearchItemView({model:data});
          // body.find("#course_list").append(item.render().el);
        });
        this.Courses = Courses;
      }});
    },
    modelView: SearchItemView,
    collection: new CourseCollection(),
    events: {
      "click #search": "search"
    },
    search: function () {
      var term = this.$("#term").val();
      var dropdown = this.$("#dropdown").val();
      console.log(dropdown);
      // console.log("searching!");
      console.log(self.Courses.where({"crn":"21330"}));
    },
    render: function () {
      var body = this.$el.html(SearchTemplate);
    }
  });

  //DashboardView.render();
  return DashboardView;<commit_msg>search filtering for specific professor classes done<commit_after>/* global define */
define([
  'jquery',
  'underscore',
  'backbone',
  'text!templates/search/searchTemplate.html',
  'views/dashboard/DashboardItemView',
  'collections/courses/CourseCollection',
  'models/course/Course'
], function($, _, Backbone, SearchTemplate, SearchItemView, CourseCollection, Course){

  //Handlebars
  _.templateSettings = {
  interpolate: /\{\{(.+?)\}\}/g
  };
  var DashboardView = Backbone.View.extend({
    el: $("#page"),
    initialize: function() {
      var self = this;

      var Courses = new CourseCollection();
      Courses.fetch({
        success: function(err,data) {

        _.each(data, function(data) {
          var aCourse = new Course();
          aCourse.set(data);
          Courses.add(aCourse);
          // var item = new SearchItemView({model:data});
          // body.find("#course_list").append(item.render().el);
        });
        this.Courses = Courses;
      }});
    },
    modelView: SearchItemView,
    collection: new CourseCollection(),
    events: {
      "click #search": "search"
    },
    search: function () {
      var term = this.$("#term").val();
      var dropdown = this.$("#dropdown").val();
      var body = this.$el.html(SearchTemplate);
      console.log(self.Courses.where({"avaliableSeats":"0"}));
      // console.log("searching!");
      _.each(self.Courses.where({"crn":term}), function(data) {
         var item = new SearchItemView({model:data.attributes});
         body.find("#course_list").append(item.render().el);
      });
    },
    render: function () {
      return this.$el.html(SearchTemplate);
    }
  });

  //DashboardView.render();
  return DashboardView;
{'fraction_non_alphanumeric': 0.17361328737073017, 'fraction_numerical': 0.001880288310874334, 'mean_word_length': 2.8045292014302743, 'pattern_counts': {'":': 5, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1528554', 'n_tokens_mistral': 977, 'n_tokens_neox': 954, 'n_words': 175}