{"size": 596, "ext": "js", "max_stars_repo_path": "app/exercises/collections/exercises.js", "max_stars_repo_name": "scott-w/reps-js", "max_stars_repo_stars_event_min_datetime": "2016-02-09T09:06:52.000Z", "max_stars_repo_stars_event_max_datetime": "2017-04-20T15:23:57.000Z", "max_issues_repo_path": "app/exercises/collections/exercises.js", "max_issues_repo_name": "scott-w/reps-js", "max_issues_repo_issues_event_min_datetime": "2016-01-22T21:29:05.000Z", "max_issues_repo_issues_event_max_datetime": "2020-09-25T09:22:38.000Z", "max_forks_repo_path": "app/exercises/collections/exercises.js", "max_forks_repo_name": "scott-w/reps-js", "max_forks_repo_forks_event_min_datetime": "2016-02-09T09:06:56.000Z", "max_forks_repo_forks_event_max_datetime": "2018-11-22T14:16:08.000Z"}
{"max_stars_count": 11, "max_issues_count": 67, "max_forks_count": 6, "avg_line_length": 19.2258064516, "max_line_length": 55, "alphanum_fraction": 0.6711409396}
import _ from 'underscore';
import PageableCollection from 'backbone.paginator';

import {authSync} from '../../base/models/auth';

import {ExerciseModel} from '../models/exercise';


export const ExerciseList = PageableCollection.extend({
  mode: 'client',
  model: ExerciseModel,
  sync: authSync,

  state: {
    pageSize: 6
  },

  comparator: 'exercise_name',

  initialize: function(data, options) {
    this.searchModel = options.searchModel;
  },

  url: function() {
    if (_.isUndefined(this.searchModel)) {
      return '/exercises/';
    }
    return this.searchModel.url();
  }
});
