<commit_before>var CoreView = require('backbone/core-view');
var GuessingTogglerView = require('./guessing-toggler-view');
var PrivacyTogglerView = require('./privacy-toggler-view');
var template = require('./footer.tpl');
var checkAndBuildOpts = require('builder/helpers/required-opts');

var REQUIRED_OPTS = [
  'privacyModel',
  'guessingModel',
  'createModel',
  'userModel',
  'configModel'
];

/**
 * Footer view for the add layer modal.
 */
module.exports = CoreView.extend({
  events: {
    'click .js-ok': '_finish'
  },

  initialize: function (opts) {
    checkAndBuildOpts(opts, REQUIRED_OPTS, this);

    this._initBinds();
  },

  render: function () {
    this.clearSubViews();

    this.$el.html(
      template({
        canFinish: this._createModel.canFinish(),
        listing: this._createModel.get('listing')
      })
    );

    this._initViews();

    return this;
  },

  _initViews: function () {
    var guessingTogglerView = new GuessingTogglerView({
      guessingModel: this._guessingModel,
      createModel: this._createModel,
      configModel: this._configModel
    });
    this.$('.js-footer-info').append(guessingTogglerView.render().el);
    this.addView(guessingTogglerView);

    var privacyTogglerView = new PrivacyTogglerView({
      privacyModel: this._privacyModel,
      userModel: this._userModel,
      createModel: this._createModel,
      configModel: this._configModel
    });
    this.$('.js-footerActions').prepend(privacyTogglerView.render().el);
    this.addView(privacyTogglerView);
  },

  _initBinds: function () {
    this.listenTo(this._createModel.getUploadModel(), 'change', this.render);
    this.listenTo(this._createModel.getSelectedDatasetsCollection(), 'all', this._update);<commit_msg>Added userModel to footer-view<commit_after>var CoreView = require('backbone/core-view');
var GuessingTogglerView = require('./guessing-toggler-view');
var PrivacyTogglerView = require('./privacy-toggler-view');
var template = require('./footer.tpl');
var checkAndBuildOpts = require('builder/helpers/required-opts');

var REQUIRED_OPTS = [
  'privacyModel',
  'guessingModel',
  'createModel',
  'userModel',
  'configModel'
];

/**
 * Footer view for the add layer modal.
 */
module.exports = CoreView.extend({
  events: {
    'click .js-ok': '_finish'
  },

  initialize: function (opts) {
    checkAndBuildOpts(opts, REQUIRED_OPTS, this);

    this._initBinds();
  },

  render: function () {
    this.clearSubViews();

    this.$el.html(
      template({
        canFinish: this._createModel.canFinish(),
        listing: this._createModel.get('listing')
      })
    );

    this._initViews();

    return this;
  },

  _initViews: function () {
    var guessingTogglerView = new GuessingTogglerView({
      guessingModel: this._guessingModel,
      userModel: this._userModel,
      createModel: this._createModel,
      configModel: this._configModel
    });
    this.$('.js-footer-info').append(guessingTogglerView.render().el);
    this.addView(guessingTogglerView);

    var privacyTogglerView = new PrivacyTogglerView({
      privacyModel: this._privacyModel,
      userModel: this._userModel,
      createModel: this._createModel,
      configModel: this._configModel
    });
    this.$('.js-footerActions').prepend(privacyTogglerView.render().el);
    this.addView(privacyTogglerView);
  },

  _initBinds: function () {
    this.listenTo(this._createModel.getUploadModel(), 'change', this.render);
    this.listenTo(this._createModel.getSelectedDatasetsCollection(), 'all', this._update);
{'fraction_non_alphanumeric': 0.14241486068111456, 'fraction_numerical': 0.0, 'mean_word_length': 3.789757412398922, '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': '4377811', 'n_tokens_mistral': 1154, 'n_tokens_neox': 1120, 'n_words': 184}