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

  User.MenuView = Marionette.View.extend({

    el: "#user",

    ui: {
      signInToggle: "#login"
    },

    events: {
      "click #login": "toggleAuth",
      "click #add-farm": "addFarm",
      "click #add-depot": "addDepot"
    },

    initialize: function(controller) {
      this.bindUIElements();
      App.vent.on("user:signin:success", this.onLogin, this);
      App.vent.on("user:logout:success", this.onLogout, this);
    },

    toggleAuth: function(event) {
      event.preventDefault();
      var loggedIn = this.model.get("loggedIn");
      if (!loggedIn) {
        this.trigger("login:selected");
      }
      else {
        this.trigger("logout:selected");
      }
    },

    addFarm: function(event) {
      event.preventDefault();
      App.vent.trigger("user:add:farm");
    },

    addDepot: function(event) {
      event.preventDefault();
      App.vent.trigger("user:add:depot");
    },


    onLogin: function() {
      this.ui.signInToggle.text("Abmelden");
    },

    onLogout: function() {
      this.ui.signInToggle.text("Anmelden");
    }
  });
});<commit_msg>Rename method.<commit_after>Teikei.module("User", function(User, App, Backbone, Marionette, $, _) {

  User.MenuView = Marionette.View.extend({

    el: "#user",

    ui: {
      signInToggle: "#login"
    },

    events: {
      "click #login": "toggleAuth",
      "click #add-farm": "addFarm",
      "click #add-depot": "addDepot"
    },

    initialize: function(controller) {
      this.bindUIElements();
      App.vent.on("user:signin:success", this.onSignIn, this);
      App.vent.on("user:logout:success", this.onLogout, this);
    },

    toggleAuth: function(event) {
      event.preventDefault();
      var loggedIn = this.model.get("loggedIn");
      if (!loggedIn) {
        this.trigger("login:selected");
      }
      else {
        this.trigger("logout:selected");
      }
    },

    addFarm: function(event) {
      event.preventDefault();
      App.vent.trigger("user:add:farm");
    },

    addDepot: function(event) {
      event.preventDefault();
      App.vent.trigger("user:add:depot");
    },


    onSignIn: function() {
      this.ui.signInToggle.text("Abmelden");
    },

    onLogout: function() {
      this.ui.signInToggle.text("Anmelden");
    }
  });
});
{'fraction_non_alphanumeric': 0.17418810628426823, 'fraction_numerical': 0.0, 'mean_word_length': 2.6324655436447166, 'pattern_counts': {'":': 6, '<': 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': '3004307', 'n_tokens_mistral': 809, 'n_tokens_neox': 790, 'n_words': 113}