<commit_before>{% extends "layout.html" %}

{% block title %}Jobs+{% endblock %}
{% block h1 %}Jobs+{% endblock %}
{% block page_id %}jobsplus{% endblock %}

{% block js %}
  <script type="text/javascript">

    var client = {
      steps: 5,
      getJobsAwaitingApproval: function()
        {
          if (client.step < client.steps - 1)
          {
            client.step++;

            return;
          }
          // First time this function is called
          else
          {
            client.step = 0;
          }

          window.clearInterval(client.intervalID);

          $.ajax({
            cache: false,
            complete: function()
              {
                // client.intervalID = window.setInterval(client.getJobsAwaitingApproval, 1000);
              },
            dataType: 'xml',
            error: function(xhr, text)
              {
                $('#result').html(text);
              },
            type: 'GET',
            success: function(data)
              {
                $jobs = $(data).find('Job');

                $jobs.each(function (index)
                  {
                    var $this = $(this);
                    var uuid = $this.children('UUID').text();
                    var $tr = $('tr[uuid=' + uuid + ']');

                    $tr
                      .css('background-color', '#ffdda7')
                      .insertBefore('table tr:eq(1)')
                      .find('p.approval_description').show().children('span').html($this.children('descriptionForApproval').text());
                  
                    $tr.find('p.actions a').show().end().find('a.btn_approve_job').removeClass('hidden').click(function (event)
                      {
                        event.preventDefault();

                        $.ajax({
                          data: { uuid: uuid },
                          type: 'POST',
                          success: function(data)
                            {
                              if (0 < data.length)
                              {
                                this.replaceWith('<span>Approved!</span>');
                              }
                            },
                          url: '/mcp/approve-job/'
                        });
                      });
                  });
              },
            url: '/mcp/jobs-awaiting-approval/'
          });
        }
    };

    $(document).ready(function()
      {
        client.getJobsAwaitingApproval();

        $('a.btn_show_tasks').live('click', function (event)
          {
            event.preventDefault();
            
            var $this = $(this);
            
            if ($this.text() == 'Show tasks')
            {<commit_msg>Pass anchor to an. function.<commit_after>{% extends "layout.html" %}

{% block title %}Jobs+{% endblock %}
{% block h1 %}Jobs+{% endblock %}
{% block page_id %}jobsplus{% endblock %}

{% block js %}
  <script type="text/javascript">

    var client = {
      steps: 5,
      getJobsAwaitingApproval: function()
        {
          if (client.step < client.steps - 1)
          {
            client.step++;

            return;
          }
          // First time this function is called
          else
          {
            client.step = 0;
          }

          window.clearInterval(client.intervalID);

          $.ajax({
            cache: false,
            complete: function()
              {
                // client.intervalID = window.setInterval(client.getJobsAwaitingApproval, 1000);
              },
            dataType: 'xml',
            error: function(xhr, text)
              {
                $('#result').html(text);
              },
            type: 'GET',
            success: function(data)
              {
                $jobs = $(data).find('Job');

                $jobs.each(function (index)
                  {
                    var $this = $(this);
                    var uuid = $this.children('UUID').text();
                    var $tr = $('tr[uuid=' + uuid + ']');

                    $tr
                      .css('background-color', '#ffdda7')
                      .insertBefore('table tr:eq(1)')
                      .find('p.approval_description').show().children('span').html($this.children('descriptionForApproval').text());
                  
                    $tr.find('p.actions a').show().end().find('a.btn_approve_job').removeClass('hidden').click(function (event)
                      {
                        event.preventDefault();

                        $.ajax({
                          context: $(this),
                          data: { uuid: uuid },
                          type: 'POST',
                          success: function(data)
                            {
                              if (0 < data.length)
                              {
                                this.replaceWith('<span>Approved!</span>');
                              }
                            },
                          url: '/mcp/approve-job/'
                        });
                      });
                  });
              },
            url: '/mcp/jobs-awaiting-approval/'
          });
        }
    };

    $(document).ready(function()
      {
        client.getJobsAwaitingApproval();

        $('a.btn_show_tasks').live('click', function (event)
          {
            event.preventDefault();
            
            var $this = $(this);
            
            if ($this.text() == 'Show tasks')
            {
{'fraction_non_alphanumeric': 0.13630619245351147, 'fraction_numerical': 0.00397183607149305, 'mean_word_length': 0.9935228499460238, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5616939', 'n_tokens_mistral': 1440, 'n_tokens_neox': 1345, 'n_words': 230}