<commit_before>{{define "body"}}
  <div class="container contents">
    <div class="row">
      <div class="span6">
        {{range $project := .Projects}}
        <div class="project" data-id="{{$project.Name}}">
          <h3><a href="#" class="refresh">↻</a> {{.Name}}</h3>
          <div class="deployments">
          <table class="table table-striped">
            <thead>
              <tr>
                <th class="column-environment">Environment</th>
                <th class="column-hosts">Hosts</th>
                <th class="column-deployed-revision">Deployed Revision</th>
                <th class="column-deploy"></th>
              </tr>
            </thead>
            <tbody>
            {{range $environment := .Environments}}
              <tr class="environment" data-id="{{$environment.Name}}">
                <td><a href="/deployLog/{{$project.Name}}-{{.Name}}">{{.Name}}</a></td>
                <td>
                  {{range $host := $environment.Hosts}}
                    <div>{{$host.URI}}</div>
                  {{end}}
                </td>
                <td class="hosts">
                  Loading...
                </td>
                <td>
                  <form class="form-deploy hidden" method="POST" action="/deploy" target="_blank" style="margin-bottom: 0">
                    <input type="hidden" name="environment" value="{{$environment.Name}}"/>
                    <input type="hidden" name="project" value="{{$project.Name}}"/>
                    <input type="hidden" name="repo_owner" value="{{$project.RepoOwner}}"/>
                    <input type="hidden" name="repo_name" value="{{$project.RepoName}}"/>
                    <input type="hidden" name="from_revision" value=""/>
                    <input type="hidden" name="to_revision" value=""/>
                    <input type="hidden" name="user" value="PlaceholderUser"/>
                    <input type="submit" class="btn btn-success" value="Deploy" />
                  </form>
                </td>
              </tr>
            {{end}}
            </tbody>
          </table>
          </div>
        </div>
        {{end}}
      </div>
      <div class="span6">
      </div>
    </div>
  </div>

  <div class="hidden" id="host-skeleton"><a class="GitHubCommitURL" href=""></a> <span class="hidden"> (<a class="GitHubDiffURL" href="">diff</a>)</span></div>

  <script type="text/javascript">

  $(function(){
    // make ajax queries for each project
    $('.project').each(function(){
        refreshProject(this);
    });
  });

  $('.refresh').click(function(e) {
    refreshProject($(this).closest('.project'));
    e.preventDefault();
  })
  {{ if .ConfirmDeployFlag }}
  $('form.form-deploy').submit(function(e){
      var env = $(this).parents("tr.environment").data("id");
      return confirm("Are you sure you wish to deploy to " + env + "?");
  });
  {{ end }}

  function refreshProject(project) {
      var $hostSkeleton = $("#host-skeleton");
      var $project = $(project),
      projectId = $project.attr('data-id');
      $project.find('.hosts').text('Loading...');
      $project.find('.form-deploy').addClass('hidden');
      $.ajax({
        type: 'GET',
        url: '/commits/' + projectId,
        dataType: 'json',
        success: function(response) {
          var environments = response.Environments,
            project = response.Name,
            $project = $("[data-id='" + project +"']");

          for (var e = 0; e < environments.length; e++) {<commit_msg>[#92191452] use single quotes<commit_after>{{define "body"}}
  <div class="container contents">
    <div class="row">
      <div class="span6">
        {{range $project := .Projects}}
        <div class="project" data-id="{{$project.Name}}">
          <h3><a href="#" class="refresh">↻</a> {{.Name}}</h3>
          <div class="deployments">
          <table class="table table-striped">
            <thead>
              <tr>
                <th class="column-environment">Environment</th>
                <th class="column-hosts">Hosts</th>
                <th class="column-deployed-revision">Deployed Revision</th>
                <th class="column-deploy"></th>
              </tr>
            </thead>
            <tbody>
            {{range $environment := .Environments}}
              <tr class="environment" data-id="{{$environment.Name}}">
                <td><a href="/deployLog/{{$project.Name}}-{{.Name}}">{{.Name}}</a></td>
                <td>
                  {{range $host := $environment.Hosts}}
                    <div>{{$host.URI}}</div>
                  {{end}}
                </td>
                <td class="hosts">
                  Loading...
                </td>
                <td>
                  <form class="form-deploy hidden" method="POST" action="/deploy" target="_blank" style="margin-bottom: 0">
                    <input type="hidden" name="environment" value="{{$environment.Name}}"/>
                    <input type="hidden" name="project" value="{{$project.Name}}"/>
                    <input type="hidden" name="repo_owner" value="{{$project.RepoOwner}}"/>
                    <input type="hidden" name="repo_name" value="{{$project.RepoName}}"/>
                    <input type="hidden" name="from_revision" value=""/>
                    <input type="hidden" name="to_revision" value=""/>
                    <input type="hidden" name="user" value="PlaceholderUser"/>
                    <input type="submit" class="btn btn-success" value="Deploy" />
                  </form>
                </td>
              </tr>
            {{end}}
            </tbody>
          </table>
          </div>
        </div>
        {{end}}
      </div>
      <div class="span6">
      </div>
    </div>
  </div>

  <div class="hidden" id="host-skeleton"><a class="GitHubCommitURL" href=""></a> <span class="hidden"> (<a class="GitHubDiffURL" href="">diff</a>)</span></div>

  <script type="text/javascript">

  $(function(){
    // make ajax queries for each project
    $('.project').each(function(){
        refreshProject(this);
    });
  });

  $('.refresh').click(function(e) {
    refreshProject($(this).closest('.project'));
    e.preventDefault();
  })
  {{ if .ConfirmDeployFlag }}
  $('form.form-deploy').submit(function(e){
      var env = $(this).parents('tr.environment').data('id');
      return confirm('Are you sure you wish to deploy to ' + env + '?');
  });
  {{ end }}

  function refreshProject(project) {
      var $hostSkeleton = $("#host-skeleton");
      var $project = $(project),
      projectId = $project.data('id');
      $project.find('.hosts').text('Loading...');
      $project.find('.form-deploy').addClass('hidden');
      $.ajax({
        type: 'GET',
        url: '/commits/' + projectId,
        dataType: 'json',
        success: function(response) {
          var environments = response.Environments,
            project = response.Name,
            $project = $("[data-id='" + project +"']");

          for (var e = 0; e < environments.length; e++) {
{'fraction_non_alphanumeric': 0.1948659764572401, 'fraction_numerical': 0.002836477095447454, 'mean_word_length': 1.9297881179891982, 'pattern_counts': {'":': 0, '<': 135, '<?xml version=': 0, '>': 133, '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': '5681278', 'n_tokens_mistral': 2068, 'n_tokens_neox': 1951, 'n_words': 387}