<commit_before>{% extends "admin/base_site_nav.html" %}
{% load i18n %}
{% block extrahead %}{{block.super}}
{% if args.0 or mode == 'graph' %}<script type="text/javascript" src="{{STATIC_URL}}js/d3.min.js"></script>
{% endif %}<script type="text/javascript">

{% block crosses %}function crosses (cellvalue, options, rowdata) {
  for (i in cellvalue)
    if (i == 0) res = cellvalue[i];
    else res += '<br/>' + cellvalue[i];
  return res;
};{% endblock %}

var initialfilter{% if filters %} = {{filters|safe}}{% endif %};
var resizing;
{% if reportclass.hasTimeBuckets %}var numbuckets = {{request.report_bucketlist|length}};
var timebuckets = [ {% for f in request.report_bucketlist %}{% if not forloop.first %},{% endif %}{'name':'{{f.name}}','startdate':'{{f.startdate|date:"Y-m-d"}}','enddate':'{{f.enddate|date:"Y-m-d"}}'}{% endfor %} ];
{% endif %}var cross = [
{{cross_list|safe}}
];

$(function() {
  $("#toolicons").tooltip({show: {effect: "fade", delay: 500} });{% if reportclass.hasTimeBuckets and not bucketnames %}
  $('#curfilter').html("{% trans 'Error: Missing time buckets or bucket dates' %}");
{% else %}{% if reportclass.hasTimeBuckets %}$("#displaymode").buttonset();
{% endif %}
  jQuery("#grid").jqGrid({
   	url: (location.href.indexOf("#") != -1 ? location.href.substr(0,location.href.indexOf("#")) : location.href)
      + (location.search.length > 0 ? "&format=json" : "?format=json"),
	  datatype: "json",
	  jsonReader : {repeatitems:false},
   	colModel:[
      {{colmodel|safe}}{% if mode == "table" %},
      {% for f in request.report_bucketlist %}{% if not forloop.first %},
      {% endif %}{ name:'{{f.name|safe}}',startdate:'{{f.startdate|date:"Y-m-d"}}',enddate:'{{f.enddate|date:"Y-m-d"}}',sortable:false,width:90,align:'center',formatter:crosses,search:false,title:false }{% endfor %}
      {% endif %}],{% if reportclass.editable and haschangeperm %}
    cellsubmit: 'clientArray',
    editurl: location.pathname,
    beforeSaveCell: upload.select,{% else %}
    onSelectRow: function() {$(this).resetSelection();},
    {% endif %}rowNum: {{request.pagesize}},
   	pager: '#gridpager',
    viewrecords: true,
    sortorder: "asc",
    iconSet: "fontAwesome",
    hidegrid: false,
    scrollRows: true,
    altRows: true,
    altclass:'altRow',
    autowidth: true,
	  shrinkToFit: {% if mode == "table" %}false{% else %}true{% endif %},
	  loadError: function(xhr,st,err) {
	    $('#load_grid').show();
	    if (xhr.status == 200)
      {
        $('#curfilter').html("{{_('Warning: no data found')|escapejs}}");
        $('#grid').clearGridData();
      }
      else
        $('#curfilter').html("{{_('Error retrieving report data')|escapejs}}" + ":&nbsp;" + xhr.status + "&nbsp;" + xhr.statusText);
    },{% if filters %}
    postData: {filters: JSON.stringify(initialfilter)},
    search : true,{% endif %}
    {% block extra_grid %}{% endblock %}
	  height: {% if reportclass.height %}{{reportclass.height}}{% else %}$(window).height() - $("#grid").offset().top - {{reportclass.heightmargin}}{% endif %}
    });
  {% if mode == "table" %}jQuery("#grid").jqGrid('setFrozenColumns');
  {% endif %}jQuery("#radio1").click(function() {grid.displayMode("table");});
  jQuery("#radio2").click(function() {grid.displayMode("graph");});{% if reportclass.editable and haschangeperm %}
  $("th").bindFirst('click', upload.validateSort);{% endif %}
  {% endif %}});


$(window).bind('resize', function() {<commit_msg>Toggling between graph and table was broken. Thanks Bruce for reporting the issue.<commit_after>{% extends "admin/base_site_nav.html" %}
{% load i18n %}
{% block extrahead %}{{block.super}}
{% if args.0 or mode == 'graph' %}<script type="text/javascript" src="{{STATIC_URL}}js/d3.min.js"></script>
{% endif %}<script type="text/javascript">

{% block crosses %}function crosses (cellvalue, options, rowdata) {
  for (i in cellvalue)
    if (i == 0) res = cellvalue[i];
    else res += '<br/>' + cellvalue[i];
  return res;
};{% endblock %}

var initialfilter{% if filters %} = {{filters|safe}}{% endif %};
var resizing;
{% if reportclass.hasTimeBuckets %}var numbuckets = {{request.report_bucketlist|length}};
var timebuckets = [ {% for f in request.report_bucketlist %}{% if not forloop.first %},{% endif %}{'name':'{{f.name}}','startdate':'{{f.startdate|date:"Y-m-d"}}','enddate':'{{f.enddate|date:"Y-m-d"}}'}{% endfor %} ];
{% endif %}var cross = [
{{cross_list|safe}}
];

$(function() {
  $("#toolicons").tooltip({show: {effect: "fade", delay: 500} });{% if reportclass.hasTimeBuckets and not bucketnames %}
  $('#curfilter').html("{% trans 'Error: Missing time buckets or bucket dates' %}");
{% else %}{% if reportclass.hasTimeBuckets %}$("#displaymode").buttonset();
{% endif %}
  jQuery("#grid").jqGrid({
   	url: (location.href.indexOf("#") != -1 ? location.href.substr(0,location.href.indexOf("#")) : location.href)
      + (location.search.length > 0 ? "&format=json" : "?format=json"),
	  datatype: "json",
	  jsonReader : {repeatitems:false},
   	colModel:[
      {{colmodel|safe}}{% if mode == "table" %},
      {% for f in request.report_bucketlist %}{% if not forloop.first %},
      {% endif %}{ name:'{{f.name|safe}}',startdate:'{{f.startdate|date:"Y-m-d"}}',enddate:'{{f.enddate|date:"Y-m-d"}}',sortable:false,width:90,align:'center',formatter:crosses,search:false,title:false }{% endfor %}
      {% endif %}],{% if reportclass.editable and haschangeperm %}
    cellsubmit: 'clientArray',
    editurl: location.pathname,
    beforeSaveCell: upload.select,{% else %}
    onSelectRow: function() {$(this).resetSelection();},
    {% endif %}rowNum: {{request.pagesize}},
   	pager: '#gridpager',
    viewrecords: true,
    sortorder: "asc",
    iconSet: "fontAwesome",
    hidegrid: false,
    scrollRows: true,
    altRows: true,
    altclass:'altRow',
    autowidth: true,
	  shrinkToFit: {% if mode == "table" %}false{% else %}true{% endif %},
	  loadError: function(xhr,st,err) {
	    $('#load_grid').show();
	    if (xhr.status == 200)
      {
        $('#curfilter').html("{{_('Warning: no data found')|escapejs}}");
        $('#grid').clearGridData();
      }
      else
        $('#curfilter').html("{{_('Error retrieving report data')|escapejs}}" + ":&nbsp;" + xhr.status + "&nbsp;" + xhr.statusText);
    },{% if filters %}
    postData: {filters: JSON.stringify(initialfilter)},
    search : true,{% endif %}
    {% block extra_grid %}{% endblock %}
	  height: {% if reportclass.height %}{{reportclass.height}}{% else %}$(window).height() - $("#grid").offset().top - {{reportclass.heightmargin}}{% endif %}
    });
  {% if mode == "table" %}jQuery("#grid").jqGrid('setFrozenColumns');
  {% endif %}jQuery("#gridmode").click(function() {grid.displayMode("table");});
  jQuery("#graphmode").click(function() {grid.displayMode("graph");});{% if reportclass.editable and haschangeperm %}
  $("th").bindFirst('click', upload.validateSort);{% endif %}
  {% endif %}});


$(window).bind('resize', function() {
{'fraction_non_alphanumeric': 0.22744199369808077, 'fraction_numerical': 0.0048696648524778, 'mean_word_length': 4.663422546634226, 'pattern_counts': {'":': 2, '<': 11, '<?xml version=': 0, '>': 13, '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': '5325245', 'n_tokens_mistral': 2494, 'n_tokens_neox': 2279, 'n_words': 466}