4 $sp_person_autocomplete_uri => '/ajax/people/autocomplete'
5 $trait_autocomplete_uri => '/ajax/stock/trait_autocomplete'
6 $onto_autocomplete_uri => '/ajax/cvterm/autocomplete'
11 $breeding_programs => undef
14 <& /util/import_javascript.mas, classes => [ 'jquery', 'jquery.dataTables', 'CXGN.Effects' ] &>
16 <div class="container-fluid">
18 <& /page/page_title.mas, title=>'Search Accessions and Plots' &>
23 use CXGN::Page::FormattingHelpers qw / conditional_like_input_html simple_selectbox_html/;
26 my $any_name_select = conditional_like_input_html("any_name","contains", "", '30');
28 my $accession_cvterm_id;
30 for (my $i=0; $i<= scalar(@$stock_types); $i++) {
31 if ( $stock_types->[$i][1] eq "accession" ) {
32 $accession_cvterm_id = $stock_types->[$i][0];
37 my $stock_type_select = simple_selectbox_html(
38 choices => $stock_types,
39 id => "stock_type_select",
40 selected => $accession_cvterm_id,
43 my $organism_select = simple_selectbox_html(
44 choices => $organisms ,
45 id => "organism_select",
48 my $breeding_programs_select = simple_selectbox_html(
49 choices => $breeding_programs,
50 id => "organization" ,
56 <&| /page/info_section.mas, title => 'Search', collapsible=>1, collapsed=>0, subtitle=>'[<a href="/stock/0/new/">Submit New Stock</a>]' &>
58 <div id="stock_search_form" class="form-horizontal well">
60 <div class="col-sm-6">
61 <div class="form-group form-group-sm">
62 <label class="col-sm-3 control-label">Stock Name or Description: </label>
63 <div class="col-sm-9" >
64 <% $any_name_select %>
70 <div class="col-sm-6">
71 <div class="form-group form-group-sm">
72 <label class="col-sm-3 control-label">Stock Type: </label>
73 <div class="col-sm-9" >
74 <% $stock_type_select %>
78 <div class="col-sm-6">
79 <div class="form-group form-group-sm">
80 <label class="col-sm-3 control-label">Organism: </label>
81 <div class="col-sm-9" >
82 <% $organism_select %>
88 <div class="col-sm-6">
89 <div class="form-group form-group-sm">
90 <label class="col-sm-3 control-label">Stock Owner: </label>
91 <div class="col-sm-9" >
92 <input type="text" class="form-control" id="person" />
96 <div class="col-sm-6">
97 <div class="form-group form-group-sm">
98 <label class="col-sm-3 control-label">Trait: </label>
99 <div class="col-sm-9" >
100 <input type="text" class="form-control" id="trait" />
106 <div class="col-sm-6">
107 <div class="form-group form-group-sm">
108 <label class="col-sm-3 control-label">Project Name: </label>
109 <div class="col-sm-9" >
110 <input type="text" class="form-control" id="project" />
114 <div class="col-sm-6">
115 <div class="form-group form-group-sm">
116 <label class="col-sm-3 control-label">Project Location: </label>
117 <div class="col-sm-9" >
118 <input type="text" class="form-control" id="location" />
124 <div class="col-sm-6">
125 <div class="form-group form-group-sm">
126 <label class="col-sm-3 control-label">Project Year: </label>
127 <div class="col-sm-9" >
128 <input type="text" class="form-control" id="year" />
132 <div class="col-sm-6">
133 <div class="form-group form-group-sm">
134 <label class="col-sm-3 control-label">Organization: </label>
135 <div class="col-sm-9" >
136 <% $breeding_programs_select %>
141 <button style="float:right" class="btn btn-primary" id="submit_stock_search" />Search</button>
147 <div id="stock_search_form">
149 <tr><td colspan="4" align="right"><a href="/stock/0/new/">[Submit new stock]</a></td>
151 <tr><td><label for="any_name_matchtype">Stock name or description</label></td><td colspan="2"><% $any_name_select %></td>
153 <tr><td><label for="stock_type_select">Stock type</label></td><td><% $stock_type_select %></td>
154 <td><label for="organism_select">Organism</label></td><td><% $organism_select %></td>
156 <tr><td><label for="person">Stock owner</label></td><td><input id="person"></td>
157 <td><label for="trait">Trait</label></td><td><input id="trait"></td>
159 <tr><td><label for="project">Project name</label></td><td><input id="project"></td>
160 <td><label for="location">Project location</label></td><td><input id="location"></td>
162 <tr><td><label for="year">Project year</label></td><td><input id="year"></td>
163 <td><label for="organization">Organization</label></td><td><% $breeding_programs_select %></td>
166 <tr><td colspan="4" align="right"><button id="submit_stock_search" />Search</button></td>
175 <&| /page/info_section.mas, title => 'Search Results', collapsible=>1, collapsed=>0 &>
177 <link rel="stylesheet" type="text/css" href="/documents/inc/datatables/jquery.dataTables.css">
180 <div style="text-align:right">
181 Copy items on this page to list:
182 <span id="item_list_menu">
190 <table id="stock_search_results" class="display">
207 jQuery(document).ready(function () {
209 jQuery("#person").autocomplete({
210 source: '<% $sp_person_autocomplete_uri %>'
212 jQuery("#trait").autocomplete({
213 source: '<% $trait_autocomplete_uri %>'
215 jQuery("#onto").autocomplete({
216 source: '<% $onto_autocomplete_uri %>' + "?db_name=" + '<% $trait_db_name %>'
218 jQuery("#stock_name").autocomplete({
219 source: '/ajax/stock/stock_autocomplete',
221 jQuery("#project").autocomplete({
222 source: '/ajax/stock/project_autocomplete',
224 jQuery("#location").autocomplete({
225 source: '/ajax/stock/geolocation_autocomplete',
227 jQuery("#year").autocomplete({
228 source: '/ajax/stock/project_year_autocomplete',
231 var table = jQuery('#stock_search_results').DataTable( {
237 'ajax': { 'url': '/ajax/search/stocks',
238 'data': function(d) {
239 d.any_name = jQuery('#any_name').val();
240 d.any_name_matchtype = jQuery('#any_name_matchtype').val();
241 d.stock_type = jQuery('#stock_type_select').val();
242 d.organism = jQuery('#organism_select').val();
243 d.person = jQuery('#person').val();
244 d.trait = jQuery('#trait').val();
245 d.project = jQuery('#project').val();
246 d.location = jQuery('#location').val();
247 d.year = jQuery('#year').val();
248 d.organization = jQuery('#organization').val();
254 jQuery('#submit_stock_search').click( function() {
255 table.search("stock_search_results").draw();
258 jQuery('#stock_search_form').keypress( function( e ) {
259 var code = e.keyCode || e.which;
261 jQuery('#submit_stock_search').click();