<commit_before>Teikei.module("Places", function(Places, App, Backbone, Marionette, $, _) {

  Places.Controller = Backbone.Marionette.Controller.extend( {

    initialize: function(){
      this.placeMessage = new Teikei.PlaceMessage.Model();
      this.collection = new Teikei.Places.Collection();
      this.collection.bind("reset", function(collection){
        App.vent.trigger("places:change", collection);
      });

      this.mapView = new Teikei.Places.MapView({
        collection: this.collection
      });

      this.mapView.bind("select:details", this.showDetails, this);
      this.mapView.bind("select:network", this.showNetwork, this);

      App.vent.on("user:add:depot", this.showEntryDepotForm, this);
      App.vent.on("user:add:farm", this.showEntryFarmForm, this);
      App.vent.on("user:logout:success", this.refreshCollection, this);
      App.vent.on("user:show:entrylist", this.showEntryList, this);

      App.vent.on("edit:entry", this.editEntry, this);
      App.vent.on("delete:entry", this.deleteEntry, this);

      this.refreshCollection();
    },

    refreshCollection: function() {
      this.collection.fetch({reset: true});
    },

    editEntry: function(model) {
      var showEntryForm = this.showEntryForm;
      model.fetch({
        success: function(model, response, options) {
          var type = model.get("type");
          Backbone.history.navigate("places/" + model.id + "/edit");
          if (type == "Farm") {
            showEntryForm(Places.EntryFarmView, "Angaben zum Betrieb editieren", model, model.collection);
          }
          else if (type == "Depot") {
            showEntryForm(Places.EntryDepotView, "Angaben zur Gruppe editieren", model, model.collection);
          }
        }
      });
    },

    deleteEntry: function(model) {
      var deleteEntryView = new Places.DeleteEntryView({model: model});
      App.alertRegion.show(deleteEntryView);
    },

    submitPlaceMessage: function(data) {
      var model = this.placeMessage;
      // Wrap form data into :place_form hash to satisfy the API controller.
      var messageData = { place_form: data };<commit_msg>Bugfix: DeleteEntryView did not appear.<commit_after>Teikei.module("Places", function(Places, App, Backbone, Marionette, $, _) {

  Places.Controller = Backbone.Marionette.Controller.extend( {

    initialize: function(){
      this.placeMessage = new Teikei.PlaceMessage.Model();
      this.collection = new Teikei.Places.Collection();
      this.collection.bind("reset", function(collection){
        App.vent.trigger("places:change", collection);
      });

      this.mapView = new Teikei.Places.MapView({
        collection: this.collection
      });

      this.mapView.bind("select:details", this.showDetails, this);
      this.mapView.bind("select:network", this.showNetwork, this);

      App.vent.on("user:add:depot", this.showEntryDepotForm, this);
      App.vent.on("user:add:farm", this.showEntryFarmForm, this);
      App.vent.on("user:logout:success", this.refreshCollection, this);
      App.vent.on("user:show:entrylist", this.showEntryList, this);

      App.vent.on("edit:entry", this.editEntry, this);
      App.vent.on("delete:entry", this.deleteEntry, this);

      this.refreshCollection();
    },

    refreshCollection: function() {
      this.collection.fetch({reset: true});
    },

    editEntry: function(model) {
      var showEntryForm = this.showEntryForm;
      model.fetch({
        success: function(model, response, options) {
          var type = model.get("type");
          Backbone.history.navigate("places/" + model.id + "/edit");
          if (type == "Farm") {
            showEntryForm(Places.EntryFarmView, "Angaben zum Betrieb editieren", model, model.collection);
          }
          else if (type == "Depot") {
            showEntryForm(Places.EntryDepotView, "Angaben zur Gruppe editieren", model, model.collection);
          }
        }
      });
    },

    deleteEntry: function(model) {
      var deleteEntryView = new Places.DeleteEntryView({model: model});
      App.modalRegion.show(deleteEntryView);
    },

    submitPlaceMessage: function(data) {
      var model = this.placeMessage;
      // Wrap form data into :place_form hash to satisfy the API controller.
      var messageData = { place_form: data };
{'fraction_non_alphanumeric': 0.13967517401392113, 'fraction_numerical': 0.0, 'mean_word_length': 3.059322033898305, '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': '3518084', 'n_tokens_mistral': 1286, 'n_tokens_neox': 1262, 'n_words': 240}