<commit_before><% provide(:title, "Edit account") %>
<% provide(:button_text, "Save changes") %>
<% provide(:path, user_path(@user)) %>
<% provide(:verb, :patch) %>

<h1>Your account</h1>
<div class="row">
  <div class="col-md-6 col-md-offset-3">
    <%= render 'form' %><br>
    <a href="#" class="js-payments">Your payments...</a>
    <div id="list"></div>
  </div>
</div>



<script type="text/javascript" charset="utf-8">
$(function () {
  $(".js-payments").on('click', function(event) {
    event.preventDefault();
    $.get("/payments", function(payments) {
      var paymentsString = "";
      $.each(payments, function(i, payment) {
        // var myDate = payment["created_at"].strftime('%m/%d/%Y');
        var dateTime = new Date(payment["created_at"]);
        var day = dateTime.getDate();
        var month = dateTime.getMonth() + 1;
        var year = dateTime.getFullYear();
        console.log(`${day}/${month}/${year}`)
        paymentsString += `<p data-paymentid="${payment["id"]}">` + "$" + `${payment["amount"]} ` + "spent at " + `${payment["store"]} ` + "on " + `${day}/${month}/${year}` + "</p>";
      });
      $("#list").html(paymentsString);
    });
  });
});
</script><commit_msg>Remove commented code from javascript in User edit view<commit_after><% provide(:title, "Edit account") %>
<% provide(:button_text, "Save changes") %>
<% provide(:path, user_path(@user)) %>
<% provide(:verb, :patch) %>

<h1>Your account</h1>
<div class="row">
  <div class="col-md-6 col-md-offset-3">
    <%= render 'form' %><br>
    <a href="#" class="js-payments">Your payments...</a>
    <div id="list"></div>
  </div>
</div>



<script type="text/javascript" charset="utf-8">
$(function () {
  $(".js-payments").on('click', function(event) {
    event.preventDefault();
    $.get("/payments", function(payments) {
      var paymentsString = "";
      $.each(payments, function(i, payment) {
        var dateTime = new Date(payment["created_at"]);
        var day = dateTime.getDate();
        var month = dateTime.getMonth() + 1;
        var year = dateTime.getFullYear();
        paymentsString += `<p data-paymentid="${payment["id"]}">` + "$" + `${payment["amount"]} ` + "spent at " + `${payment["store"]} ` + "on " + `${day}/${month}/${year}` + "</p>";
      });
      $("#list").html(paymentsString);
    });
  });
});
</script>
{'fraction_non_alphanumeric': 0.2490405117270789, 'fraction_numerical': 0.00511727078891258, 'mean_word_length': 3.573099415204678, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 43, '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': '7194286', 'n_tokens_mistral': 804, 'n_tokens_neox': 792, 'n_words': 149}