<commit_before><script type="text/javascript" src="https://www.google.com/jsapi"></script>

<h2>Event <%=@event.title%></h2>
<p><%=link_to "Back to Admin", admin_root_path%></p>
<p><%=sanitize @event.description%></p>
<div class="row-fluid">
  <div class="span6">
    <%=link_to admin_event_event_registrations_path(@event) do%>
      <h1><%=@event.registrations.count%></h1> registrants
    <%end%>
    <div id="registrations_chart"></div>
  </div>
  <div class="span6">
    <%=link_to admin_event_projects_path(@event) do%>
      <h1><%=@event.projects.count%></h1> projects
    <%end%>
    <div id="projects_chart"></div>
  </div>
</div>
<div class="row-fluid">
  <div class="span6">
    <h1><%=@event.vote_count%></h1> votes
    <div id="ratings_chart"></div>
  </div>
  <div class="span6">
    <h1><%=@event.volunteer_count%></h1> volunteers
    <div id="volunteers_chart"></div>
  </div>
</div>
<div class="row-fluid">
  <div class="span6">
    <h1><%=@event.comments.count%></h1> comments
    <div id="comments_chart"></div>
  </div>
  <div class="span6">
  </div>
</div>
<hr />

<script type="text/javascript">
      google.load("visualization", "1", {packages:["corechart"]});
      google.setOnLoadCallback(drawCharts);
      function drawCharts() {
        // var data = google.visualization.arrayToDataTable([<%=to_json_table(@event.registrations,'created_at')%>]);

        // var options = {
          
        // };

        // var registrations_chart = new google.visualization.LineChart(document.getElementById('registrations_chart'));

        // registrations_chart.draw(data, options);

        // data = google.visualization.arrayToDataTable([<%=to_json_table(@event.projects,'created_at')%>]);

        // var projects_chart = new google.visualization.LineChart(document.getElementById('projects_chart'));

        // projects_chart.draw(data, options);

        // data = google.visualization.arrayToDataTable([<%=to_json_table(@event.ratings,'project_ratings.created_at')%>]);

        // var ratings_chart = new google.visualization.LineChart(document.getElementById('ratings_chart'));

        // ratings_chart.draw(data, options);

        // data = google.visualization.arrayToDataTable([<%=to_json_table(@event.volunteers,'project_volunteers.created_at')%>]);

        // var volunteers_chart = new google.visualization.LineChart(document.getElementById('volunteers_chart'));

        // volunteers_chart.draw(data, options);

        // data = google.visualization.arrayToDataTable([<%=to_json_table(@event.comments,'project_comments.created_at')%>]);

        // var comments_chart = new google.visualization.LineChart(document.getElementById('comments_chart'));

        // comments_chart.draw(data, options);
  }
</script>
<commit_msg>whoops, uncomment chart function that fails w/sqlite<commit_after><script type="text/javascript" src="https://www.google.com/jsapi"></script>

<h2>Event <%=@event.title%></h2>
<p><%=link_to "Back to Admin", admin_root_path%></p>
<p><%=sanitize @event.description%></p>
<div class="row-fluid">
  <div class="span6">
    <%=link_to admin_event_event_registrations_path(@event) do%>
      <h1><%=@event.registrations.count%></h1> registrants
    <%end%>
    <div id="registrations_chart"></div>
  </div>
  <div class="span6">
    <%=link_to admin_event_projects_path(@event) do%>
      <h1><%=@event.projects.count%></h1> projects
    <%end%>
    <div id="projects_chart"></div>
  </div>
</div>
<div class="row-fluid">
  <div class="span6">
    <h1><%=@event.vote_count%></h1> votes
    <div id="ratings_chart"></div>
  </div>
  <div class="span6">
    <h1><%=@event.volunteer_count%></h1> volunteers
    <div id="volunteers_chart"></div>
  </div>
</div>
<div class="row-fluid">
  <div class="span6">
    <h1><%=@event.comments.count%></h1> comments
    <div id="comments_chart"></div>
  </div>
  <div class="span6">
  </div>
</div>
<hr />

<script type="text/javascript">
      google.load("visualization", "1", {packages:["corechart"]});
      google.setOnLoadCallback(drawCharts);
      function drawCharts() {
        var data = google.visualization.arrayToDataTable([<%=to_json_table(@event.registrations,'created_at')%>]);

        var options = {
          
        };

        var registrations_chart = new google.visualization.LineChart(document.getElementById('registrations_chart'));

        registrations_chart.draw(data, options);

        data = google.visualization.arrayToDataTable([<%=to_json_table(@event.projects,'created_at')%>]);

        var projects_chart = new google.visualization.LineChart(document.getElementById('projects_chart'));

        projects_chart.draw(data, options);

        data = google.visualization.arrayToDataTable([<%=to_json_table(@event.ratings,'project_ratings.created_at')%>]);

        var ratings_chart = new google.visualization.LineChart(document.getElementById('ratings_chart'));

        ratings_chart.draw(data, options);

        data = google.visualization.arrayToDataTable([<%=to_json_table(@event.volunteers,'project_volunteers.created_at')%>]);

        var volunteers_chart = new google.visualization.LineChart(document.getElementById('volunteers_chart'));

        volunteers_chart.draw(data, options);

        data = google.visualization.arrayToDataTable([<%=to_json_table(@event.comments,'project_comments.created_at')%>]);

        var comments_chart = new google.visualization.LineChart(document.getElementById('comments_chart'));

        comments_chart.draw(data, options);
  }
</script>

{'fraction_non_alphanumeric': 0.18175235336712528, 'fraction_numerical': 0.0068790731354091235, 'mean_word_length': 4.327868852459017, 'pattern_counts': {'":': 0, '<': 135, '<?xml version=': 0, '>': 135, 'https://': 2, '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': '348746', 'n_tokens_mistral': 1874, 'n_tokens_neox': 1785, 'n_words': 246}