<commit_before><%= javascript_include_tag "sharing.js" -%>
<%= javascript_include_tag 'survey_checkbox.js' -%>
<%= stylesheet_link_tag 'survey_ul'%>
<%= stylesheet_link_tag 'faux_table'%>
<% @survey_search_query="Enter search terms" unless @survey_search_query -%>

<ul class="sectionIcons">
	<!-- might be able to upload user surveys in future -->
  <!--<li><%#= icon "new", new_survey_path, "Upload New Survey", nil, "Upload New Survey" %></li>-->
  <!-- <li><%#= icon "view-all", all_files_path, nil, nil, "View All Files" %></li> -->
</ul>
<div class="show_basic" style="padding-right: 2em;">
  <div id="survey_selector">
    <% form_tag(:action => "search_variables") do -%>
      <!-- jquery grid experiment-->
      <%# form_tag(:action => "grid_view") do -%>

      <%= hidden_field_tag "page", 1 -%>
      <%= hidden_field_tag "per_page", 10 -%>
      <% if !logged_in? -%>
        <h2>Welcome, guest.  Please select some surveys and search for variables of interest to your research.  You can browse the metadata and see what is inside the MethodBox but only <%= link_to "registered users", signup_url, :onclick=>"if(#{REGISTRATION_CLOSED}==true){alert('registration is not currently open'); return false;} else return true;" -%> can add variables to their cart and download them.</h2><br/>		
      <% else -%>
        <h2>Select some surveys, enter a search term and click the button to find some variables</h2><br/>
      <% end -%>
      <div style="position: relative;background-color:#ACCBE0;padding-top:5px;padding-bottom:5px;padding-left:5px;width:100%;height:60px;">
        <div style="position: absolute; ;top:1em;left:1em"><%= text_field_tag :survey_search_query, @survey_search_query,:onclick=>"javascript:$('survey_search_query').select();" %>
          <%= submit_tag 'Search selected surveys',:id => "search_button" %>
        </div>
		  <% if logged_in? && !@recent_searches.empty? -%>
		  <div style="position: absolute; top:1em;left:30em">
			Previous searches:
		<%= select_tag 'recent searches' ,options_from_collection_for_select(@recent_searches, 'id', 'terms'), :onchange=>"javascript:$('survey_search_query').value = this.options[this.selectedIndex].text" -%>  
		</div>
        <!-- jquery grid experiment -->
        <%#= submit_to_remote 'submit', 'JQ Grid', {:url=>{:controller => "variables", :action=> "grid_view"}} -%>
        <% if logged_in? -%>
          <div id="cart_button" style="position: absolute; top:1em; right:1em;">
            <%= render :partial => "cart_button" -%>
          </div>
        <% end -%>
        <div style="position: absolute; bottom:1em; left:1em;">Select:<commit_msg>needed an extra <% end -%> tag.  got lost in an update<commit_after><%= javascript_include_tag "sharing.js" -%>
<%= javascript_include_tag 'survey_checkbox.js' -%>
<%= stylesheet_link_tag 'survey_ul'%>
<%= stylesheet_link_tag 'faux_table'%>
<% @survey_search_query="Enter search terms" unless @survey_search_query -%>

<ul class="sectionIcons">
	<!-- might be able to upload user surveys in future -->
  <!--<li><%#= icon "new", new_survey_path, "Upload New Survey", nil, "Upload New Survey" %></li>-->
  <!-- <li><%#= icon "view-all", all_files_path, nil, nil, "View All Files" %></li> -->
</ul>
<div class="show_basic" style="padding-right: 2em;">
  <div id="survey_selector">
    <% form_tag(:action => "search_variables") do -%>
      <!-- jquery grid experiment-->
      <%# form_tag(:action => "grid_view") do -%>

      <%= hidden_field_tag "page", 1 -%>
      <%= hidden_field_tag "per_page", 10 -%>
      <% if !logged_in? -%>
        <h2>Welcome, guest.  Please select some surveys and search for variables of interest to your research.  You can browse the metadata and see what is inside the MethodBox but only <%= link_to "registered users", signup_url, :onclick=>"if(#{REGISTRATION_CLOSED}==true){alert('registration is not currently open'); return false;} else return true;" -%> can add variables to their cart and download them.</h2><br/>		
      <% else -%>
        <h2>Select some surveys, enter a search term and click the button to find some variables</h2><br/>
      <% end -%>
      <div style="position: relative;background-color:#ACCBE0;padding-top:5px;padding-bottom:5px;padding-left:5px;width:100%;height:60px;">
        <div style="position: absolute; ;top:1em;left:1em"><%= text_field_tag :survey_search_query, @survey_search_query,:onclick=>"javascript:$('survey_search_query').select();" %>
          <%= submit_tag 'Search selected surveys',:id => "search_button" %>
        </div>
		  <% if logged_in? && !@recent_searches.empty? -%>
		  <div style="position: absolute; top:1em;left:30em">
			Previous searches:
		<%= select_tag 'recent searches' ,options_from_collection_for_select(@recent_searches, 'id', 'terms'), :onchange=>"javascript:$('survey_search_query').value = this.options[this.selectedIndex].text" -%>  
		</div>
		<% end -%>
        <!-- jquery grid experiment -->
        <%#= submit_to_remote 'submit', 'JQ Grid', {:url=>{:controller => "variables", :action=> "grid_view"}} -%>
        <% if logged_in? -%>
          <div id="cart_button" style="position: absolute; top:1em; right:1em;">
            <%= render :partial => "cart_button" -%>
          </div>
        <% end -%>
        <div style="position: absolute; bottom:1em; left:1em;">Select:
{'fraction_non_alphanumeric': 0.18122188905547226, 'fraction_numerical': 0.009745127436281859, 'mean_word_length': 4.087702573879886, 'pattern_counts': {'":': 0, '<': 105, '<?xml version=': 0, '>': 125, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '358034', 'n_tokens_mistral': 1873, 'n_tokens_neox': 1737, 'n_words': 415}