<commit_before><template>
  <div>
    <div v-if="submited" class="container">
      <div class="col center">
        Votre message a bien été envoyé.
        <br /><br />
        <input @click="submited = false" type="button" value="Retour" class="btn btn-primary" />
      </div>
    </div>
    <form v-else data-netlify="true" action="post" name="contact" netlify-honeypot="field" @submit.prevent="handleSubmit">
      <p class="hidden">
        <label>Don’t fill this out if you're human: <input name="field"/></label>
      </p>
      <input type="hidden" name="form-name" value="contact" />
      <div class="container">
        <div class="col">
          <input v-model="lastname" class="form-control" type="text" name="Nom" placeholder="Nom *" required/>
        </div>
        <div class="col">
          <input v-model="firstname" class="form-control" type="text" name="Prénom" placeholder="Prénom *" required  />
        </div>
      </div>
      <div class="container">
        <div class="col">
          <input v-model="email" class="form-control" type="email" name="Email" placeholder="Email *" required />
        </div>
      </div>
      <div class="container">
        <div class="col">
          <textarea v-model="message" class="form-control" rows="10" name="Message" placeholder="Ma question / Mon message *" required />
        </div>
      </div>
      <div class="container">
        <div class="col center">
          <input type="submit" value="Envoyer" class="btn btn-primary" />
        </div>
      </div>
    </form>
  </div>
</template>

<script>
export default {
  name: "Contact",
  data() {
    return {
      submited: false,
      lastname: "",
      firstname: "",
      email: "",
      message: "",
    };
  },
  methods: {
    encode(data) {
      return Object.keys(data)
        .map(
          (key) => encodeURIComponent(key) + "=" + encodeURIComponent(data[key])
        )
        .join("&");
    },
    handleSubmit() {
      fetch("/contact", {
        body: this.encode({
          "form-name": "contact",
          lastname: this.lastname,
          firstname: this.firstname,
          email: this.email,
          message: this.message,
        }),
        cache: "no-cache",
        method: "POST",
        mode: "cors",
        headers: { "Content-Type": "application/x-www-form-urlencoded" },
        referrer: "no-referrer",
      }).then(() => {
        this.submited = true;
      });

      this.submited = true;

      this.lastname = "";<commit_msg>Change submited field name<commit_after><template>
  <div>
    <div v-if="submited" class="container">
      <div class="col center">
        Votre message a bien été envoyé.
        <br /><br />
        <input @click="submited = false" type="button" value="Retour" class="btn btn-primary" />
      </div>
    </div>
    <form v-else data-netlify="true" action="post" name="contact" netlify-honeypot="field" @submit.prevent="handleSubmit">
      <p class="hidden">
        <label>Don’t fill this out if you're human: <input name="field"/></label>
      </p>
      <input type="hidden" name="form-name" value="contact" />
      <div class="container">
        <div class="col">
          <input v-model="lastname" class="form-control" type="text" name="Nom" placeholder="Nom *" required/>
        </div>
        <div class="col">
          <input v-model="firstname" class="form-control" type="text" name="Prénom" placeholder="Prénom *" required  />
        </div>
      </div>
      <div class="container">
        <div class="col">
          <input v-model="email" class="form-control" type="email" name="Email" placeholder="Email *" required />
        </div>
      </div>
      <div class="container">
        <div class="col">
          <textarea v-model="message" class="form-control" rows="10" name="Message" placeholder="Ma question / Mon message *" required />
        </div>
      </div>
      <div class="container">
        <div class="col center">
          <input type="submit" value="Envoyer" class="btn btn-primary" />
        </div>
      </div>
    </form>
  </div>
</template>

<script>
export default {
  name: "Contact",
  data() {
    return {
      submited: false,
      lastname: "",
      firstname: "",
      email: "",
      message: "",
    };
  },
  methods: {
    encode(data) {
      return Object.keys(data)
        .map(
          (key) => encodeURIComponent(key) + "=" + encodeURIComponent(data[key])
        )
        .join("&");
    },
    handleSubmit() {
      fetch("/contact", {
        body: this.encode({
          "form-name": "contact",
          "Nom": this.lastname,
          "Prénom": this.firstname,
          "Email": this.email,
          "Message": this.message,
        }),
        cache: "no-cache",
        method: "POST",
        mode: "cors",
        headers: { "Content-Type": "application/x-www-form-urlencoded" },
        referrer: "no-referrer",
      }).then(() => {
        this.submited = true;
      });

      this.submited = true;

      this.lastname = "";
{'fraction_non_alphanumeric': 0.17874875868917578, 'fraction_numerical': 0.0007944389275074479, 'mean_word_length': 2.2199488491048593, 'pattern_counts': {'":': 8, '<': 89, '<?xml version=': 0, '>': 93, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1187769', 'n_tokens_mistral': 1572, 'n_tokens_neox': 1565, 'n_words': 339}