<commit_before>define([
  'jquery',
  'underscore',
  'backbone',
  'views/session',
  'views/detail_resume',
  'views/new_resume',
  'views/resumes',
  'views/edit_resume',
  'models/resume',
  'collections/resume'
], function ($, _, Backbone, SessionView, DetailResumeView, NewResumeView, ResumesView, EditResumeView, Resume, ResumeCollection) {
  'use strict';

  var ContentView = Backbone.View.extend({

    id: 'content',

    initialize: function(vent) {
      this.vent = vent;
      this.vent.on('show:signin', this.showSignin, this);
      this.vent.on('show:home', this.showHome.bind(this));
      this.vent.on('show:active_resume', this.showActiveResume.bind(this));
      this.vent.on('show:resume', this.showResume.bind(this));
      this.vent.on('show:new_resume', this.showNewResume.bind(this));
      this.vent.on('show:resumes', this.showResumes.bind(this));
      this.vent.on('show:edit_resume', this.showEditResume.bind(this));

      this.resumes = new ResumeCollection();
      this.listenTo(this.resumes, 'sync', this.contentLoaded);
    },

    render: function() {
      return this;
    },

    setAuth: function(auth) {
      this.auth = auth;
    },

    destroyAuth: function() {
      delete this.auth;
    },

    loadContent: function() {
      this.resumes.fetch();
    },

    contentLoaded: function() {
      this.trigger('content:loaded');
    },

    showSignin: function() {
      this.$el.html(new SessionView(this.vent).render().el);
    },

    showHome: function() {
      Backbone.history.navigate("");
      this.$el.html("<NAME>annery.me");
    },

    showActiveResume: function() {
      Backbone.history.navigate("resume");
      var resume = this.resumes.get(1);
      this.listenTo(resume, 'resume:loaded', this.renderResume);
      resume.fetchAssociatedObjects();
    },

    showResume: function(resumeId) {
      console.log('resume showing: ' + resumeId);
      Backbone.history.navigate("resumes/" + resumeId);
      var resume = this.resumes.get(resumeId);
      this.listenToOnce(resume, 'resume:loaded', this.renderResume);
      resume.fetchAssociatedObjects();
    },

    renderResume: function(resume) {
      console.log('rendering resume:');
      console.log(resume);
      var resumeView = new DetailResumeView({ model: resume, auth: this.auth });
      this.listenToOnce(resumeView, 'show:new_resume', this.showNewResume);
      this.listenToOnce(resumeView, 'show:resumes', this.showResumes);
      this.listenToOnce(resumeView, 'show:edit_resume', this.showEditResume);
      this.$el.html(resumeView.render().el);
    },

    showNewResume: function() {<commit_msg>use listenTo instead of on and listenToOnce where possible<commit_after>define([
  'jquery',
  'underscore',
  'backbone',
  'views/session',
  'views/detail_resume',
  'views/new_resume',
  'views/resumes',
  'views/edit_resume',
  'models/resume',
  'collections/resume'
], function ($, _, Backbone, SessionView, DetailResumeView, NewResumeView, ResumesView, EditResumeView, Resume, ResumeCollection) {
  'use strict';

  var ContentView = Backbone.View.extend({

    id: 'content',

    initialize: function(vent) {
      this.vent = vent;
      this.listenTo(this.vent, 'show:signin', this.showSignin);
      this.listenTo(this.vent, 'show:home', this.showHome);
      this.listenTo(this.vent, 'show:active_resume', this.showActiveResume);
      this.listenTo(this.vent, 'show:resume', this.showResume);
      this.listenTo(this.vent, 'show:new_resume', this.showNewResume);
      this.listenTo(this.vent, 'show:resumes', this.showResumes);
      this.listenTo(this.vent, 'show:edit_resume', this.showEditResume);

      this.resumes = new ResumeCollection();
      this.listenToOnce(this.resumes, 'sync', this.contentLoaded);
    },

    render: function() {
      return this;
    },

    setAuth: function(auth) {
      this.auth = auth;
    },

    destroyAuth: function() {
      delete this.auth;
    },

    loadContent: function() {
      this.resumes.fetch();
    },

    contentLoaded: function() {
      this.trigger('content:loaded');
    },

    showSignin: function() {
      this.$el.html(new SessionView(this.vent).render().el);
    },

    showHome: function() {
      Backbone.history.navigate("");
      this.$el.html("<NAME>ery.me");
    },

    showActiveResume: function() {
      Backbone.history.navigate("resume");
      var resume = this.resumes.get(1);
      this.listenToOnce(resume, 'resume:loaded', this.renderResume);
      resume.fetchAssociatedObjects();
    },

    showResume: function(resumeId) {
      console.log('resume showing: ' + resumeId);
      Backbone.history.navigate("resumes/" + resumeId);
      var resume = this.resumes.get(resumeId);
      this.listenToOnce(resume, 'resume:loaded', this.renderResume);
      resume.fetchAssociatedObjects();
    },

    renderResume: function(resume) {
      console.log('rendering resume:');
      console.log(resume);
      var resumeView = new DetailResumeView({ model: resume, auth: this.auth });
      this.listenToOnce(resumeView, 'show:new_resume', this.showNewResume);
      this.listenToOnce(resumeView, 'show:resumes', this.showResumes);
      this.listenToOnce(resumeView, 'show:edit_resume', this.showEditResume);
      this.$el.html(resumeView.render().el);
    },

    showNewResume: function() {
{'fraction_non_alphanumeric': 0.15473960284750843, 'fraction_numerical': 0.0003746721618583739, 'mean_word_length': 3.5054852320675107, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3599134', 'n_tokens_mistral': 1727, 'n_tokens_neox': 1752, 'n_words': 268}