<commit_before>App.Views.DeleteButtonView = Backbone.View.extend({

  tagName: 'div' ,

  id: 'delete_button_view' ,

  className: 'content_box col-xs-12 col-sm-12 col-md-12 col-lg-8 col-lg-offset-2' ,

  initialize: function() {
    this.render();
    this.listenTo(this.model, "change", this.render);
  } ,

  render: function() {
    console.log("%cDeleteButtonView","color:rgba(210,210,210,1.0);font-size:1.35em;");
    console.log( this.model );
    console.log( this.model.collection );
    console.log( this.model.collection === app.profile_content );
    console.log( this.model.collection === app.project_content );

    var $delete_button_anchor_element = $( '<a>' ).attr({
      'class' : 'btn btn-danger btn-lg edit_save_button_bottom',
      'id': 'delete_button'
    })

    if ( this.model.collection === app.profile_content ) {
      $delete_button_anchor_element.text( "Deactivate My Account" );
    }

    if ( this.model.collection === app.project_content ) {
      $delete_button_anchor_element.text( "Delete This Project" );
    }

    this.$el.append( $delete_button_anchor_element );
  } ,

  events: {
    'click #delete_button' : 'delete_this_model'
  } ,

  delete_this_model: function() {

    var redirector = '';

    if ( this.model.collection === app.project_content ) {
      redirector = 'projects';
    } else if ( this.model.collection === app.profile_content ) {
      redirector = 'index';
    } else {
      console.log("something is broken in delete button");
    }

    this.model.destroy({
      wait: true ,
      success: function( model, response ) {

        console.log("model.destroy() success");
        console.log( model , response );

        if ( redirector = 'projects' ) {

          console.log( "navigate to #projects" );
          app.router.navigate("#projects", {trigger: true});

        } else if ( redirector = 'index' ) {

          console.log( "navigate to /logout" );
          app.router.navigate("/logout");

        } else {

          console.log("something is broken in the delete button");

        }

      } ,
      error: function() {
        console.log("model.destroy() error");
      }
    });
  } ,

  dummy_delete: function() {
    console.log('dummy delete');
  }

});
<commit_msg>Get deactivated user to logout<commit_after>App.Views.DeleteButtonView = Backbone.View.extend({

  tagName: 'div' ,

  id: 'delete_button_view' ,

  className: 'content_box col-xs-12 col-sm-12 col-md-12 col-lg-12' ,

  initialize: function() {
    this.render();
    this.listenTo(this.model, "change", this.render);
  } ,

  render: function() {
    console.log("%cDeleteButtonView","color:rgba(210,210,210,1.0);font-size:1.35em;");
    console.log( this.model );
    console.log( this.model.collection );
    console.log( this.model.collection === app.profile_content );
    console.log( this.model.collection === app.project_content );

    var $delete_button_anchor_element = $( '<a>' ).attr({
      'class' : 'btn btn-danger btn-lg edit_save_button_bottom',
      'id': 'delete_button'
    })

    if ( this.model.collection === app.profile_content ) {
      $delete_button_anchor_element.text( "Deactivate My Account" );
    }

    if ( this.model.collection === app.project_content ) {
      $delete_button_anchor_element.text( "Delete This Project" );
    }

    this.$el.append( $delete_button_anchor_element );
  } ,

  events: {
    'click #delete_button' : 'delete_this_model'
  } ,

  delete_this_model: function() {

    var redirector = '';

    console.log("%c TEST AREA" , "font-size: 4em; color: rgba(220,220,220,1.0);")
    console.log(this.model.collection === app.project_content)
    console.log(this.model.collection === app.profile_content)

    if ( false ) {
      redirector = 'projects';
    } else if ( true ) {
      redirector = 'index';
    } else {
      console.log("something is broken in delete button");
    }


    this.model.destroy({
      wait: true ,
      success: function( model, response ) {

        console.log("model.destroy() success");
        console.log( model , response );

        if ( redirector === 'projects' ) {

          console.log( "navigate to #projects" );
          app.router.navigate("#projects", {trigger: true});

        } else if ( redirector === 'index' ) {

          console.log( "navigate to /logout" );
          window.location.href = '/logout';

        } else {

          console.log("something is broken in the delete button");

        }

      } ,
      error: function() {
        console.log("model.destroy() error");
      }
    });
  } ,

  dummy_delete: function() {
    console.log('dummy delete');
  }

});

{'fraction_non_alphanumeric': 0.15576056640205965, 'fraction_numerical': 0.012014589143960523, 'mean_word_length': 2.7296, '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': '3293319', 'n_tokens_mistral': 1530, 'n_tokens_neox': 1446, 'n_words': 277}