<commit_before>:javascript
  dojo.require("dijit.dijit");
  dojo.require("dijit.Dialog");
  dojo.require("dijit.form.Form");
  dojo.require("dijit.form.Button");
  dojo.require("dojox.form.Uploader");
  dojo.require("dojox.grid.EnhancedGrid");
  dojo.require("dojox.grid.enhanced.plugins.NestedSorting");
  dojo.require("dojox.grid.enhanced.plugins.Filter");
  dojo.require("dijit.layout.TabContainer");
  dojo.require("dojox.grid.enhanced.plugins.IndirectSelection");
  dojo.require("dojox.grid.enhanced.plugins.Pagination");
  dojo.require("dojo.data.ItemFileReadStore");
  dojo.require("dojo.data.ItemFileWriteStore");
  dojo.require("dojox.grid.enhanced.plugins.exporter.CSVWriter");
  var variables = #{@variables.to_json}
     
  var variable_json = {
    identifier: 'id',
    items: #{@variables.to_json} };
  var var_store = new dojo.data.ItemFileWriteStore({data: variable_json });
  var site_json = {
    identifier: 'id',
    items: #{@sites.to_json} };
  var site_store = new dojo.data.ItemFileWriteStore({data: site_json }); 
  
%h3{:style=>"margin:5px 0;"}
  Project Search:

Select Site:
#siteGrid{:style=>"width:900px;height:300px;"}
%button(dojoType="dijit.form.Button" name="search_button" id="update_variable_button" onclick="") 
  Update Variables From Selected Sites
=clear_break
=clear_break
Select Variables:
#varGrid{:style=>"width:900px;height:300px;"}
%button(dojoType="dijit.form.Button" name="search_button" id="search_button" onclick="") 
  Perform Search

:javascript
  
  //formatter: 'val_grid_formatter.dateTime',
  // grid formatters
  var val_grid_formatter = {};
  val_grid_formatter.dateTime = function(value) {
    if(value==null || value=='') return '-';
    // Format DateTime string
    var d = new Date(value);
    //var fmt = d.getMonth()+'/'+d.getFullYear()
    return dojo.date.locale.format(d,{datePattern:"yyyy-MM-dd", timePattern:"HH:mm:ss z"});
  };
  val_grid_formatter.selectItem = function(item) {
    //var checked_img = '<img src="/images/notice.png" alt="SELCT" />';
    var selected_img = '<img src="/images/1abu007.gif" alt="SELCT" />';
    var blank_img = '<img src="/images/blank.gif" width="16" height="16" />';
  
    //if(siteDataGrid.value_selected(item)) 
    //  return selected_img;
    return blank_img;
  };
  
  val_grid_formatter.variable_name = function(value){
    return variables[value]
  }
  var site_layout = [
  {
     field: '_item',
     name: '-',
     formatter: val_grid_formatter.selectItem,
     width: '24px'
  },
  {
     field: 'id',
     name: 'ID',
     width: 'auto'
  },
  {
     field: 'name',
     name: 'Name',
     width: 'auto'
  }
  ];
  var var_layout = [
  {
     field: '_item',
     name: '-',
     formatter: val_grid_formatter.selectItem,
     width: '24px'
  },
  {
     field: 'id',
     name: 'ID',
     width: 'auto'
  },
  {
     field: 'variable_name',
     name: 'Name',
     width: 'auto'
  }
  ];
  
  
  // create a new site grid:
  siteDataGrid = new dojox.grid.EnhancedGrid({
     store: site_store,
     grid_click: true,
     clientSort: true,
     rowSelector: '20px',
     indirectSelection: true,
     structure: site_layout,
     style: 'width:95%;',
     plugins: {filter:true, exporter:true,
       pagination:{
         sizeSwitch: true,
         position: "top",
         itemTitle: "Data Points"
     }},
      onClick: function(ev) {
        this.grid_click = ev;
      },<commit_msg>added dijit DateBoxes to queryform vs Calendar<commit_after>:javascript
  dojo.require("dijit.dijit");
  dojo.require("dijit.Dialog");
  dojo.require("dijit.form.Form");
  dojo.require("dijit.form.Button");
  dojo.require("dojox.form.Uploader");
  dojo.require("dojox.grid.EnhancedGrid");
  dojo.require("dojox.grid.enhanced.plugins.NestedSorting");
  dojo.require("dojox.grid.enhanced.plugins.Filter");
  dojo.require("dijit.layout.TabContainer");
  dojo.require("dojox.grid.enhanced.plugins.IndirectSelection");
  dojo.require("dojox.grid.enhanced.plugins.Pagination");
  dojo.require("dojo.data.ItemFileReadStore");
  dojo.require("dojo.data.ItemFileWriteStore");
  dojo.require("dojox.grid.enhanced.plugins.exporter.CSVWriter");
  var units = #{@unit_names.to_json}
     
  var variable_json = {
    identifier: 'id',
    items: #{@variables.to_json} };
  var var_store = new dojo.data.ItemFileWriteStore({data: variable_json });
  var site_json = {
    identifier: 'id',
    items: #{@sites.to_json} };
  var site_store = new dojo.data.ItemFileWriteStore({data: site_json }); 
  
%h3{:style=>"margin:5px 0;"}
  Project Search:

Select Site:
#siteGrid{:style=>"width:900px;height:300px;"}
%button(dojoType="dijit.form.Button" name="search_button" id="update_variable_button" onclick="") 
  Update Variables From Selected Sites
=clear_break
=clear_break
Select Variables:
#varGrid{:style=>"width:900px;height:300px;"}
=clear_break
=clear_break
%div{:style=>"float: left;"}
  %label{:for=>"date1"}
    Start Date Selection:
  %input{:type=>"text", :name=>"start_date", :id=>"start_date", :value=>"2005-12-30",
      :dojoType=>"dijit.form.DateTextBox", :required=>"true"}
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
%div{:style=>"float: left;"}
  
  %label{:for=>"date1"}
    End Date Selection:
  %input{:type=>"text", :name=>"end_date", :id=>"end_date", :value=>"2005-12-30",
      :dojoType=>"dijit.form.DateTextBox", :required=>"true"}

=clear_break
%p{:id=>"formatted"}
=clear_break
%p{:id=>"formatted2"}
=clear_break
%button(dojoType="dijit.form.Button" name="search_button" id="search_button" onclick="") 
  Perform Search

:javascript
  
  //formatter: 'val_grid_formatter.dateTime',
  // grid formatters
  var val_grid_formatter = {};
  val_grid_formatter.dateTime = function(value) {
    if(value==null || value=='') return '-';
    // Format DateTime string
    var d = new Date(value);
    //var fmt = d.getMonth()+'/'+d.getFullYear()
    return dojo.date.locale.format(d,{datePattern:"yyyy-MM-dd", timePattern:"HH:mm:ss z"});
  };
  val_grid_formatter.selectItem = function(item) {
    //var checked_img = '<img src="/images/notice.png" alt="SELCT" />';
    var selected_img = '<img src="/images/1abu007.gif" alt="SELCT" />';
    var blank_img = '<img src="/images/blank.gif" width="16" height="16" />';
  
    //if(siteDataGrid.value_selected(item)) 
    //  return selected_img;
    return blank_img;
  };
  
  val_grid_formatter.unit_name = function(value){
    return units[value]
  }
  var site_layout = [
  {
     field: '_item',
     name: '-',
     formatter: val_grid_formatter.selectItem,
     width: '24px'
  },
  {
     field: 'id',
     name: 'ID',
     width: '40px'
  },
  {
     field: 'name',
     name: 'Name',
     width: 'auto'
  }
  ];
  var var_layout = [
  {
     field: '_item',
     name: '-',
     formatter: val_grid_formatter.selectItem,
     width: '24px'
  },
  {
     field: 'id',
     name: 'ID',
     width: '40px'
  },
  {
     field: 'variable_name',
     name: 'Name',
     width: 'auto'
  },
  {
     field: 'variable_units_id',
     name: 'Units',
     formatter: val_grid_formatter.unit_name,
     width: 'auto'
  },
  ];
  
  
  // create a new site grid:
  siteDataGrid = new dojox.grid.EnhancedGrid({
     store: site_store,
     grid_click: true,
     clientSort: true,
     rowSelector: '20px',
     indirectSelection: true,
     structure: site_layout,
     style: 'width:95%;',
     plugins: {filter:true, exporter:true,
       pagination:{
         sizeSwitch: true,
         position: "top",
         itemTitle: "Data Points"
     }},
      onClick: function(ev) {
        this.grid_click = ev;
      },
{'fraction_non_alphanumeric': 0.17071560602059677, 'fraction_numerical': 0.011222603644045419, 'mean_word_length': 3.621720561317877, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 33, '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': '352051', 'n_tokens_mistral': 2815, 'n_tokens_neox': 2714, 'n_words': 444}