<commit_before>$(document).ready(function () {

  /////////////
  // Add Member
  /////////////
  $('.btn-add-member').click(function (e) {
    e.stopPropagation();
    e.preventDefault();
    let $addMemberModal = $('.add-member-modal');
    populateModalForm($addMemberModal, {
        title: 'Mitglieder hinzufügen',
        closeLabel: 'Abbrechen',
        submitLabel: 'Mitglieder hinzufügen'
    });

    let $modalForm = $addMemberModal.find(".modal-form");
    $addMemberModal.appendTo('body').modal('show');
  });

  $('.add-member-modal form').on('submit', function (e) {
    e.stopPropagation();
    e.preventDefault();

    let newUserIds = $('.add-member-modal form select').val();

    $.ajax({
      url: $(this).attr('action'),
      method: 'PATCH',
      data: {
        newUserIds
      }
    }).done(function() {
      location.reload();
    }).fail(function() {
      // ToDo: Error handling
    });

    return false;
  });

  /////////////
  // Add external Member
  /////////////
  $('.btn-invite-external-member').click(function (e) {
    e.stopPropagation();
    e.preventDefault();
    let $inviteExternalMemberModal = $('.invite-external-member-modal');
    populateModalForm($inviteExternalMemberModal, {
        title: 'Externes Mitglied einladen',
        closeLabel: 'Abbrechen',
        submitLabel: 'Mitglied einladen'
    });

    let $modalForm = $inviteExternalMemberModal.find(".modal-form");
    $inviteExternalMemberModal.appendTo('body').modal('show');
  });

  $('.invite-external-member-modal form').on('submit', function (e) {
    e.stopPropagation();
    e.preventDefault();
    const email = $(this).find('#email').val();
    const role = $(this).find('#role').val();

    $.ajax({
      url: $(this).attr('action'),
      method: 'POST',
      data: {
        email,
        role
      }
    }).done(function() {
      location.reload();
    }).fail(function() {
      // ToDo: Error handling
    });

    return false;
  });

  /////////////
  // Add external Member
  /////////////
  $('.btn-resend-invitation').click(function (e) {
    e.stopPropagation();
    e.preventDefault();
    console.log('Resend!')
  });

<commit_msg>js anpassung<commit_after>$(document).ready(function () {

  /////////////
  // Add Member
  /////////////
  $('.btn-add-member').click(function (e) {
    e.stopPropagation();
    e.preventDefault();
    let $addMemberModal = $('.add-member-modal');
    populateModalForm($addMemberModal, {
        title: 'Mitglieder hinzufügen',
        closeLabel: 'Abbrechen',
        submitLabel: 'Mitglieder hinzufügen'
    });

    let $modalForm = $addMemberModal.find(".modal-form");
    $addMemberModal.appendTo('body').modal('show');
  });

  $('.add-member-modal form').on('submit', function (e) {
    e.stopPropagation();
    e.preventDefault();

    let newUserIds = $('.add-member-modal form select').val();

    $.ajax({
      url: $(this).attr('action'),
      method: 'PATCH',
      data: {
        newUserIds
      }
    }).done(function() {
      $.showNotification('Mitglieder erfolgreich zum Team hinzugefügt', "success", true);
      location.reload();
    }).fail(function() {
      $.showNotification('Problem beim Hinzufügen der Mitglieder', "danger", true);
    });

    return false;
  });

  /////////////
  // Add external Member
  /////////////
  $('.btn-invite-external-member').click(function (e) {
    e.stopPropagation();
    e.preventDefault();
    let $inviteExternalMemberModal = $('.invite-external-member-modal');
    populateModalForm($inviteExternalMemberModal, {
        title: 'Externes Mitglied einladen',
        closeLabel: 'Abbrechen',
        submitLabel: 'Mitglied einladen'
    });

    let $modalForm = $inviteExternalMemberModal.find(".modal-form");
    $inviteExternalMemberModal.appendTo('body').modal('show');
  });

  $('.invite-external-member-modal form').on('submit', function (e) {
    e.stopPropagation();
    e.preventDefault();
    const email = $(this).find('#email').val();
    const role = $(this).find('#role').val();

    $.ajax({
      url: $(this).attr('action'),
      method: 'POST',
      data: {
        email,
        role
      }
    }).done(function() {
      location.reload();
    }).fail(function() {
      // ToDo: Error handling
    });

    return false;
  });

  /////////////
  // Add external Member
  /////////////
  $('.btn-resend-invitation').click(function (e) {
    e.stopPropagation();
    e.preventDefault();
    $.showNotification('Einladung wurde verschickt', "success", true);
  });


{'fraction_non_alphanumeric': 0.21140717903545475, 'fraction_numerical': 0.0, 'mean_word_length': 2.483128834355828, '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': '6249142', 'n_tokens_mistral': 1411, 'n_tokens_neox': 1399, 'n_words': 234}