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

{% load filters %}

{% block title %}{{project_name}}: List of records{% endblock %}

{% block header %}
<li class="divider"></li>
<li><a href="/{{project_name}}/">{{project_name}}</a></li>
<li class='divider-vertical'></li>  
<li>
  <a href="/{{project_name}}/data/">
    Switch to Data view
  </a>
</li> 
<li class='divider-vertical'></li>   
<li>
  <a class="settings_togg">
    <i class="icon-cog" style='margin-top:8px'></i> Settings
  </a>
<li class='divider-vertical'></li>  
{% endblock %}


{% block content %} 



<!-- DataTables CSS -->
<link rel="stylesheet" type="text/css"
      href="/media/css/jquery.dataTables.css">

<!-- jQuery -->
<script type="text/javascript" chadatrset="utf8" src="/media/js/jquery.js"></script>

<!-- DataTables -->
<script type="text/javascript" charset="utf8"
        src="/media/js/jquery.dataTables.js"></script>







<script>
  $(document).ready( function () {

  var hd_cl = {{settings.record_hidden_cols|as_json|safe}};
  var record_list = $('#record_dt').DataTable({
    "columnDefs": [
      {"sortable":false,  "targets":["repository-c", "label-c",
       "tag-c", "reason-c", "outcome-c", "main-c", "version-c",
       "input-c", "output-c", "arguments-c"]},   
      {"visible":false, "targets": hd_cl},
    ],
    <!--"dom": 'lfrC<"clear">tip',     <!-- Order: 'l'ength, 'f'ilter,  p'r'ocessing, 'C'olumns, 't'able, 'i'nformation, 'p'agination -->
    "paging": true,
    "ordering": true,
    "info": true, <!-- "Showing x of y entries" -->
    "filter": true, 
    "lengthChange": false,
    "order": [[$('th.time-c').index(), "desc"]], <!-- default sort column -->
    } );


    $('a.settings_togg').on('click', function(e) {
      e.preventDefault();
      $('#settings_panel').toggle()
      $('#settings_panel2').toggle()
    })

    <!-- Column visibility toggle -->
    $('input.check-item').on( 'change', function (e) {
        e.preventDefault();

        // Get the column API object
        var column = record_list.column($(this).attr('data-column')
        );

        console.log($(this).attr('data-column'))
 
        // Toggle the visibility
        column.visible( ! column.visible() );

        <!--console.log($.get("/{{project_name}}/settings"))-->

        // save settings to .smtrc
        // $.post("/{{project_name}}/settings", {'record_hidden_cols':['murloc'],'saveSettings':true}); 
    } );

    // Save changes button   
    $('#save_set').click(function(){  
        record_list.page.len($('#s_nbt').val());
        record_list.draw();
        });



  <!-- Arrow key page turning -->
  document.onkeydown = checkKey;
  function checkKey(e) {

      e = e || window.event;

      if (e.keyCode == '37') {
          record_list.page('previous').draw(false);
      }
      else if (e.keyCode == '39') {
          record_list.page('next').draw(false);
      }
  }

    } );

</script>




<div id='settings_panel' style='display:none;'>
  <br/>
  <label class="checkbox">
    <input type="checkbox" id='repository' class='check-item' 
           data-column='0' checked="checked">
    Repository
  </label>
  <label class="checkbox">
    <input type="checkbox" id='label' class='check-item'
    data-column='1'  checked="checked">
    Label
  </label>
  <label class="checkbox">
    <input type="checkbox" id='tag' class='check-item' data-column='2'
     checked="checked">
    Tag
  </label>
  <label class="checkbox">
    <input type="checkbox" id='reason' class='check-item'
    data-column='3' checked="checked">
    Reason
  </label>
  <label class="checkbox">
    <input type="checkbox" id='outcome' class='check-item'
    data-column='4'  checked="checked"> 
    Outcome
  </label>
  <label class="checkbox">
    <input type="checkbox" id='input' class='check-item'
    data-column='5'  checked="checked"> 
    Input
  </label>
  <label class="checkbox">
    <input type="checkbox" id='output' class='check-item'
    data-column='6'  checked="checked"> 
    Output
  </label>
  <label class="checkbox">
    <input type="checkbox" id='duration' class='check-item'
    data-column='7' checked="checked"> 
    Duration
  </label>
  <label class="checkbox">
    <input type="checkbox" id='processes' class='check-item'
    data-column='8' checked="checked">
    Processes
  </label>
  <label class="checkbox">
    <input type="checkbox" id='time' class='check-item'
    data-column='9' checked="checked">
    Time
  </label>
  <label class="checkbox">
    <input type="checkbox" id='ename' class='check-item'
    data-column='10' checked="checked">
    Executable
  </label>

  <label class="checkbox">
    <input type="checkbox" id='main' class='check-item'
    data-column='11' checked="checked">
    Script main file
  </label>
  <label class="checkbox">
    <input type="checkbox" id='version' class='check-item'
           data-column='12' checked="checked"> 
    Script version
  </label>
  <label class="checkbox">
    <input type="checkbox" id='arguments' class='check-item'
    data-column='13' checked="checked"> Script
    arguments
  </label>
  <div style='float:left; padding:8px; padding-left:0px'>Number of
    records per page:</div>
  <input id='s_nbt' class='span1' type='text' style='float:left;margin-bottom:0px' value='{{settings.nb_records_per_page}}'>
  </div>
  <div id="settings_panel2" class="modal-footer" style='display:none;'>
    <a class="btn" data-dismiss="modal">Close</a>
    <a class="btn btn-primary" id='save_set'>Save changes</a>
  </div>
</div>





<br />




<div style="margin-left:2%; margin-right:3%">
<table class='hover row-border' id='record_dt'>

  <thead>
    <tr>
      <th class='repository-c'>repository</th>
      <th class='label-c'>label</th>
      <th class='tag-c'>tag</th>
      <th class='reason-c'>reason</th>
      <th class='outcome-c'>outcome</th>
      <th class='input-c'>input&nbsp;data</th>
      <th class='output-c'>output&nbsp;data</th>
      <th class='duration-c'>duration</th>
      <th class='processes-c'>processes</th>
      <th class='time-c'>time</th>
      <th class='exec-c'>exec.</th>
      <th class='main-c'>main</th>
      <th class='version-c'>version</th>
      <th class='arguments-c'>arguments</th>
    </tr>
  </thead>

  <tbody>

    {% for record in sim_list %}

    <tr>         
      <td class='dataTable_td' id='repository-t'>
        <span class="span-box">
          {{record.repository.url|cut:"repo"}}
        </span>
      </td>
      <td class='dataTable_td' id='label-t'>
        <a href="/{{project_name}}/{{record.label}}/">
          {{record.label|ubreak}}
        </a> 
        
      </td> 
      {% if tag %}
      <td class='dataTable_td' id='tag-t'>
        {% for other_tag in record.tag_objects %}
        {% if tag == other_tag %}
        {{tag}} 
        {% else %}
        <!--<a href="#">
          {{other_tag.name}}
        </a>--> <!-- Fix Link!! -->
        {% endif %}
        {% endfor %}
      </td>
      {% else %}
      <td class='dataTable_td' id='tag-t'>
        {% for tag in record.tag_objects %}
        <!--<a href="#">-->{{tag}}<!---</a>-->, <!-- Fix Link!! -->
        {% endfor %}
      </td> 
      {% endif %}

      <td class='dataTable_td' id='reason-t'>
        {{record.reason}}
      </td>
      <td class='dataTable_td' id='outcome-t'>
        {{record.outcome}}
      </td>
      <td class='dataTable_td' id='input-t'>
        {% for data in record.input_data.all %}
          <a href="/{{project_name}}/data/datafile?path={{data.path|urlencode}}&digest={{data.digest}}">
            {{data.path|basename|ubreak}}<!--
              -->{% if not forloop.last %}, {% endif %}
          <a/>
        {% endfor %}
      </td>
      <td class='dataTable_td' id='output-t'>
        {% for data in record.output_data.all %}
          <a href="/{{project_name}}/data/datafile?path={{data.path|urlencode}}&digest={{data.digest}}">
            {{data.path|basename|ubreak}}<!--
              -->{% if not forloop.last %}, {% endif %}
            </a>
        {% endfor %}
      </td>
      <td class='dataTable_td' id='duration-t'
          data-sort='{{record.duration}}'>
        {{record.duration|human_readable_duration}}
      </td>
      <td class='dataTable_td' id='processes-t'>
        {{record.launch_mode.get_parameters.n|default:"1"}}
      </td>
      <td class='dataTable_td' id='time-t'>
        <span style='display:none;'>
          <!-- hack for correct sorting -->
          {{record.timestamp|date:"YmdHis"}}
        </span>
        {{record.timestamp|date:"d/m/Y H:i:s"}}
      </td>
      <td class='dataTable_td' id='ename-t'>
        {{record.executable.name}} {{record.executable.version}}
      </td>
      <td class='dataTable_td' id='main-t'>
        <!--<a class='id-script'  data-toggle="modal" href="#">-->
          {{record.main_file|ubreak}}
        <!--</a>--> <!-- Fix Link!! -->
      </td>
      <td class='dataTable_td' id='version-t'>
        <span class="span-box">
          {{record.version|cut:"vers"}}
          {% if record.diff %}
          *
          {% endif %}
        </span>
      </td>
      <td class='dataTable_td' id='arguments-t'>
        <a class='href_args' href='#'>
          {{record.script_arguments}}
        </a> <!-- Fix Link!! -->
      </td> 
    </tr>
    {% endfor %}
  <tbody>
</table>
</div>

 

{% endblock %}

<commit_msg>default record_list setting<commit_after>{% extends "base.html" %}

{% load filters %}

{% block title %}{{project_name}}: List of records{% endblock %}

{% block header %}
<li class="divider"></li>
<li><a href="/{{project_name}}/">{{project_name}}</a></li>
<li class='divider-vertical'></li>  
<li>
  <a href="/{{project_name}}/data/">
    Switch to Data view
  </a>
</li> 
<li class='divider-vertical'></li>   
<li>
  <a class="settings_togg">
    <i class="icon-cog" style='margin-top:8px'></i> Settings
  </a>
<li class='divider-vertical'></li>  
{% endblock %}


{% block content %} 



<!-- DataTables CSS -->
<link rel="stylesheet" type="text/css"
      href="/media/css/jquery.dataTables.css">

<!-- jQuery -->
<script type="text/javascript" chadatrset="utf8" src="/media/js/jquery.js"></script>

<!-- DataTables -->
<script type="text/javascript" charset="utf8"
        src="/media/js/jquery.dataTables.js"></script>







<script>
  $(document).ready( function () {

  var hd_cl = {{settings.record_hidden_cols|as_json|safe}};
  var record_list = $('#record_dt').DataTable({
    "columnDefs": [
      {"sortable":false,  "targets":["repository-c", "label-c",
       "tag-c", "reason-c", "outcome-c", "main-c", "version-c",
       "input-c", "output-c", "arguments-c"]},   
      <!--{"visible":false, "targets": hd_cl},-->
      {"visible":false, "targets": ["arguments-c", "repository-c", "processes-c"]},
    ],
    <!--"dom": 'lfrC<"clear">tip',     <!-- Order: 'l'ength, 'f'ilter,  p'r'ocessing, 'C'olumns, 't'able, 'i'nformation, 'p'agination -->
    "paging": true,
    "ordering": true,
    "info": true, <!-- "Showing x of y entries" -->
    "filter": true, 
    "lengthChange": false,
    "order": [[$('th.time-c').index(), "desc"]], <!-- default sort column -->
    } );


    $('a.settings_togg').on('click', function(e) {
      e.preventDefault();
      $('#settings_panel').toggle()
      $('#settings_panel2').toggle()
    })

    <!-- Column visibility toggle -->
    $('input.check-item').on( 'change', function (e) {
        e.preventDefault();

        // Get the column API object
        var column = record_list.column($(this).attr('data-column')
        );

        console.log($(this).attr('data-column'))
 
        // Toggle the visibility
        column.visible( ! column.visible() );

        <!--console.log($.get("/{{project_name}}/settings"))-->

        // save settings to .smtrc
        // $.post("/{{project_name}}/settings", {'record_hidden_cols':['murloc'],'saveSettings':true}); 
    } );

    // Save changes button   
    $('#save_set').click(function(){  
        record_list.page.len($('#s_nbt').val());
        record_list.draw();
        });



  <!-- Arrow key page turning -->
  document.onkeydown = checkKey;
  function checkKey(e) {

      e = e || window.event;

      if (e.keyCode == '37') {
          record_list.page('previous').draw(false);
      }
      else if (e.keyCode == '39') {
          record_list.page('next').draw(false);
      }
  }

    } );

</script>




<div id='settings_panel' style='display:none;'>
  <br/>
  <label class="checkbox">
    <input type="checkbox" id='repository' class='check-item' 
           data-column='0' >
    Repository
  </label>
  <label class="checkbox">
    <input type="checkbox" id='label' class='check-item'
    data-column='1'  checked="checked">
    Label
  </label>
  <label class="checkbox">
    <input type="checkbox" id='tag' class='check-item' data-column='2'
     checked="checked">
    Tag
  </label>
  <label class="checkbox">
    <input type="checkbox" id='reason' class='check-item'
    data-column='3' checked="checked">
    Reason
  </label>
  <label class="checkbox">
    <input type="checkbox" id='outcome' class='check-item'
    data-column='4'  checked="checked"> 
    Outcome
  </label>
  <label class="checkbox">
    <input type="checkbox" id='input' class='check-item'
    data-column='5'  checked="checked"> 
    Input
  </label>
  <label class="checkbox">
    <input type="checkbox" id='output' class='check-item'
    data-column='6'  checked="checked"> 
    Output
  </label>
  <label class="checkbox">
    <input type="checkbox" id='duration' class='check-item'
    data-column='7' checked="checked"> 
    Duration
  </label>
  <label class="checkbox">
    <input type="checkbox" id='processes' class='check-item'
    data-column='8'>
    Processes
  </label>
  <label class="checkbox">
    <input type="checkbox" id='time' class='check-item'
    data-column='9' checked="checked">
    Time
  </label>
  <label class="checkbox">
    <input type="checkbox" id='ename' class='check-item'
    data-column='10' checked="checked">
    Executable
  </label>

  <label class="checkbox">
    <input type="checkbox" id='main' class='check-item'
    data-column='11' checked="checked">
    Script main file
  </label>
  <label class="checkbox">
    <input type="checkbox" id='version' class='check-item'
           data-column='12' checked="checked"> 
    Script version
  </label>
  <label class="checkbox">
    <input type="checkbox" id='arguments' class='check-item'
    data-column='13'> Script
    arguments
  </label>
  <div style='float:left; padding:8px; padding-left:0px'>Number of
    records per page:</div>
  <input id='s_nbt' class='span1' type='text' style='float:left;margin-bottom:0px' value='{{settings.nb_records_per_page}}'>
  </div>
  <div id="settings_panel2" class="modal-footer" style='display:none;'>
    <a class="btn" data-dismiss="modal">Close</a>
    <a class="btn btn-primary" id='save_set'>Save changes</a>
  </div>
</div>





<br />




<div style="margin-left:2%; margin-right:3%">
<table class='hover row-border' id='record_dt'>

  <thead>
    <tr>
      <th class='repository-c'>repository</th>
      <th class='label-c'>label</th>
      <th class='tag-c'>tag</th>
      <th class='reason-c'>reason</th>
      <th class='outcome-c'>outcome</th>
      <th class='input-c'>input&nbsp;data</th>
      <th class='output-c'>output&nbsp;data</th>
      <th class='duration-c'>duration</th>
      <th class='processes-c'>processes</th>
      <th class='time-c'>time</th>
      <th class='exec-c'>exec.</th>
      <th class='main-c'>main</th>
      <th class='version-c'>version</th>
      <th class='arguments-c'>arguments</th>
    </tr>
  </thead>

  <tbody>

    {% for record in sim_list %}

    <tr>         
      <td class='dataTable_td' id='repository-t'>
        <span class="span-box">
          {{record.repository.url|cut:"repo"}}
        </span>
      </td>
      <td class='dataTable_td' id='label-t'>
        <a href="/{{project_name}}/{{record.label}}/">
          {{record.label|ubreak}}
        </a> 
        
      </td> 
      {% if tag %}
      <td class='dataTable_td' id='tag-t'>
        {% for other_tag in record.tag_objects %}
        {% if tag == other_tag %}
        {{tag}} 
        {% else %}
        <!--<a href="#">
          {{other_tag.name}}
        </a>--> <!-- Fix Link!! -->
        {% endif %}
        {% endfor %}
      </td>
      {% else %}
      <td class='dataTable_td' id='tag-t'>
        {% for tag in record.tag_objects %}
        <!--<a href="#">-->{{tag}}<!---</a>-->, <!-- Fix Link!! -->
        {% endfor %}
      </td> 
      {% endif %}

      <td class='dataTable_td' id='reason-t'>
        {{record.reason}}
      </td>
      <td class='dataTable_td' id='outcome-t'>
        {{record.outcome}}
      </td>
      <td class='dataTable_td' id='input-t'>
        {% for data in record.input_data.all %}
          <a href="/{{project_name}}/data/datafile?path={{data.path|urlencode}}&digest={{data.digest}}">
            {{data.path|basename|ubreak}}<!--
              -->{% if not forloop.last %}, {% endif %}
          <a/>
        {% endfor %}
      </td>
      <td class='dataTable_td' id='output-t'>
        {% for data in record.output_data.all %}
          <a href="/{{project_name}}/data/datafile?path={{data.path|urlencode}}&digest={{data.digest}}">
            {{data.path|basename|ubreak}}<!--
              -->{% if not forloop.last %}, {% endif %}
            </a>
        {% endfor %}
      </td>
      <td class='dataTable_td' id='duration-t'
          data-sort='{{record.duration}}'>
        {{record.duration|human_readable_duration}}
      </td>
      <td class='dataTable_td' id='processes-t'>
        {{record.launch_mode.get_parameters.n|default:"1"}}
      </td>
      <td class='dataTable_td' id='time-t'>
        <span style='display:none;'>
          <!-- hack for correct sorting -->
          {{record.timestamp|date:"YmdHis"}}
        </span>
        {{record.timestamp|date:"d/m/Y H:i:s"}}
      </td>
      <td class='dataTable_td' id='ename-t'>
        {{record.executable.name}} {{record.executable.version}}
      </td>
      <td class='dataTable_td' id='main-t'>
        <!--<a class='id-script'  data-toggle="modal" href="#">-->
          {{record.main_file|ubreak}}
        <!--</a>--> <!-- Fix Link!! -->
      </td>
      <td class='dataTable_td' id='version-t'>
        <span class="span-box">
          {{record.version|cut:"vers"}}
          {% if record.diff %}
          *
          {% endif %}
        </span>
      </td>
      <td class='dataTable_td' id='arguments-t'>
        <a class='href_args' href='#'>
          {{record.script_arguments}}
        </a> <!-- Fix Link!! -->
      </td> 
    </tr>
    {% endfor %}
  <tbody>
</table>
</div>

 

{% endblock %}


{'fraction_non_alphanumeric': 0.21383681295270557, 'fraction_numerical': 0.003621644652748189, 'mean_word_length': 2.6623756582796956, 'pattern_counts': {'":': 26, '<': 398, '<?xml version=': 0, '>': 396, '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': '3732899', 'n_tokens_mistral': 6512, 'n_tokens_neox': 6217, 'n_words': 1140}