<commit_before>define([

  'Backbone',

  //Model
  'app/models/project',

  //Collection
  'app/collections/projects',

  //View
  'app/views/taskController',
  'app/views/projectsController',
  'app/views/filterController',
  'app/views/gameController',

  //Templates
  'text!templates/project-page/gamePageTemplate.html',
  'text!templates/project-page/errorTemplate.html'

], function(

  Backbone,

  //Model
  Project,

  //Collection
  Projects,

  //Views
  taskController,
  projectsController,
  filterController,
  gameController,

  //Templates
  gamePageTemplate,
  errorTemplate
){

  var ProjectManager = Backbone.View.extend({

    template: _.template(gamePageTemplate),
    errorTemplate: _.template(errorTemplate),

    model: new Project(),

    initialize: function(){
      this.model.clear({silent: true}).off();
      this.model.bind('change:error', this.error, this);
      this.model.bind('change:name', this.render, this);

      this.model.fetch({data: {id: this.options.projectId}});

      this.projectsList = new projectsController({
        collection: new Projects(),
        router: this.options.router
      });

      this.games = new gameController({
        projectId: this.options.projectId
      });

      this.taskList = new taskController({
        projectId: this.options.projectId
      });

      this.filter = new filterController({
        collection: this.taskList.collection
      });
    },

    error: function(){
      var message = this.model.get('error');
      this.$el.html(this.errorTemplate({message: message}));
    },

    render: function(){
      this.$el.html(this.template({project: {name: this.model.get('name')}}));
      this.taskList.setElement('.js-taskList');
      this.taskList.collection.fetch();

      if(!$('.projects-list li')[0]){
        this.projectsList.setElement('.projects-list').start();
      }

      this.filter.setElement('.fn-filter-task');
      this.games.setElement('.js-game-list');
    }
  });

  return ProjectManager;

});
<commit_msg>Send project id on GET request for games<commit_after>define([

  'Backbone',

  //Model
  'app/models/project',

  //Collection
  'app/collections/projects',

  //View
  'app/views/taskController',
  'app/views/projectsController',
  'app/views/filterController',
  'app/views/gameController',

  //Templates
  'text!templates/project-page/gamePageTemplate.html',
  'text!templates/project-page/errorTemplate.html'

], function(

  Backbone,

  //Model
  Project,

  //Collection
  Projects,

  //Views
  taskController,
  projectsController,
  filterController,
  gameController,

  //Templates
  gamePageTemplate,
  errorTemplate
){

  var ProjectManager = Backbone.View.extend({

    template: _.template(gamePageTemplate),
    errorTemplate: _.template(errorTemplate),

    model: new Project(),

    initialize: function(){
      this.model.clear({silent: true}).off();
      this.model.bind('change:error', this.error, this);
      this.model.bind('change:name', this.render, this);

      this.model.fetch({data: {id: this.options.projectId}});

      this.projectsList = new projectsController({
        collection: new Projects(),
        router: this.options.router
      });

      this.games = new gameController({
        projectId: this.options.projectId
      });

      this.taskList = new taskController({
        projectId: this.options.projectId
      });

      this.filter = new filterController({
        collection: this.taskList.collection
      });
    },

    error: function(){
      var message = this.model.get('error');
      this.$el.html(this.errorTemplate({message: message}));
    },

    render: function(){
      this.$el.html(this.template({project: {name: this.model.get('name')}}));
      this.taskList.setElement('.js-taskList');
      this.filter.setElement('.fn-filter-task');
      this.games.setElement('.js-game-list');

      this.taskList.collection.fetch();
      this.games.collection.fetch({data: {project_id: this.options.projectId}});

      if(!$('.projects-list li')[0]){
        this.projectsList.setElement('.projects-list').start();
      }

    }
  });

  return ProjectManager;

});

{'fraction_non_alphanumeric': 0.15513526454393106, 'fraction_numerical': 0.00047881254488867607, 'mean_word_length': 3.0367149758454106, 'pattern_counts': {'":': 0, '<': 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': '926001', 'n_tokens_mistral': 1283, 'n_tokens_neox': 1226, 'n_words': 200}