8 <& /util/import_javascript.mas, classes => [ 'CXGN.BreedersToolbox.HTMLSelect' ] &>
10 <& /page/page_title.mas, title=>"Manage Plot Phenotyping" &>
12 <div class="well well-sm">
14 <div class="col-md-1 col-lg-1">
16 <div class="col-md-10 col-lg-10">
18 <div class="form-group form-group-sm">
19 <label class="col-sm-4 control-label for="plot_name">Plot:</label>
20 <div class="col-sm-8">
21 <input type="text" value="<%$plot_name%>" class="form-control" id="plot_name" name="plot_name" disabled="1"></input>
27 <div class="form-group form-group-sm" id="all_traits">
28 <label class="col-sm-4 control-label" for="select_traits_for_trait_file">Select trait: </label>
29 <div class="col-sm-8">
30 <select class="form-control" id="select_traits_for_trait_file"></select>
34 <div class="form-group form-group-sm">
35 <label class="col-sm-4 control-label">Or Use Trait List: </label>
36 <div class="col-sm-8">
37 <input type="checkbox" id="use_trait_list" value="use_trait_list"/>
43 <div id="show_trait_textbox" style="display: none">
44 <div class="form-group form-group-sm" >
45 <label class="col-sm-4 control-label">Enter a List of Trait Names: </label>
46 <div class="col-sm-8" id="show_trait_selectbox">
53 <div id="show_trait_list_box" style="display: none">
54 <div class="form-group form-group-sm">
55 <label class="col-sm-4 control-label">Or Paste From a List: </label>
56 <div class="col-sm-8">
57 <div id="list_menu_traits"></div>
58 <script defer="defer">
59 jQuery(document).ready(function() {
60 pasteTraitListMenu('show_trait_selectbox', 'list_menu_traits', 'Paste Trait List');
62 function pasteTraitListMenu (div_name, menu_div, button_name) {
63 var list = new CXGN.List();
65 html = list.listSelect(div_name, ['traits'], undefined, undefined, undefined);
66 html = html + '<button class="btn btn-info btn-sm" type="button" id="paste_button_id" value="'+button_name+'" onclick="javascript:pasteTraitList(\''+div_name+'\')" >'+button_name+'</button>';
67 jQuery('#'+menu_div).html(html);
78 <div class="form-group form-group-sm">
79 <label class="col-sm-4 control-label">Enter trait value: </label>
80 <div class="col-sm-3">
81 <input type="number" class="form-control" id="select_pheno_value" name="select_pheno_value"></input>
86 <div class="col-md-1 col-lg-1">
92 <div class="well well-sm">
94 <div class="col-md-1 col-lg-1">
96 <div class="col-md-10 col-lg-10">
98 <&| /page/info_section.mas, id=>"stock_trials_section", title => "Trials", collapsible=> 1, collapsed=>1 &>
100 <& /stock/trials.mas, stock_id => $stock_id &>
105 <div class="col-md-1 col-lg-1">
110 <div class="well well-sm">
112 <div class="col-md-1 col-lg-1">
114 <div class="col-md-10 col-lg-10">
116 <& /stock/download_stock_phenotypes_dialog.mas, stock_id => $stock_id, stock_name => $plot_name, stock_type => $type_name &>
117 <&| /page/info_section.mas, id=>"stock_traits_section", title => "Traits assayed", collapsible=>1, collapsed=>1, hide_if_empty=>1, subtitle=>"[<a id='stock_download_phenotypes_button'>Download Data</a>]" &>
119 <& /stock/traits.mas, stock_id => $stock_id &>
124 <div class="col-md-1 col-lg-1">
130 jQuery(document).ready(function($) {
132 var null_trait_value = '';
134 $("#use_trait_list").click(function () {
135 if ($('#use_trait_list').is(':checked')) {
136 $('#all_traits').hide();
137 jQuery('#select_traits_for_trait_file').empty();
138 $('#show_trait_textbox').show();
139 $('#show_trait_list_box').show();
140 jQuery("#select_pheno_value").val(null_trait_value);
143 $('#all_traits').show();
144 $('#show_trait_textbox').hide();
145 $('#show_trait_list_box').hide();
146 jQuery("#select_pheno_value").val(null_trait_value);
147 jQuery('#select_pheno_value').empty();
148 get_select_box('traits', 'select_traits_for_trait_file', {
149 'name': 'html_select_traits_for_trait_file',
150 'id': 'html_select_traits_for_trait_file',
156 get_select_box('traits', 'select_traits_for_trait_file', {
157 'name': 'html_select_traits_for_trait_file',
158 'id': 'html_select_traits_for_trait_file',
162 jQuery('input[name=select_pheno_value]').change(function() {
163 var plot_name = jQuery("#plot_name").val();
164 var trait = jQuery("#select_traits_for_trait_file").val();
165 var trait_list_option = '';
166 if ($('#use_trait_list').is(':checked')) {
167 trait_list_option = jQuery('#use_trait_list').val();
170 trait = jQuery("#select_traits_for_trait_file_2").val();
172 var trait_value = jQuery("#select_pheno_value").val();
176 url : '/ajax/phenotype/plot_phenotype_upload',
179 'plot_name' : plot_name,
181 'trait_value' : trait_value,
182 'trait_list_option' : trait_list_option,
185 success: function (response) {
187 alert("Error Saving Trait Value: "+response.error);
191 alert('An error occurred saving trait value');
198 function Retrieve_pheno(){
199 var plot_name = jQuery("#plot_name").val();
201 trait = jQuery("#select_traits_for_trait_file").val();
203 trait = jQuery("#select_traits_for_trait_file_2").val();
206 var trait_list_option = '';
207 if ($('#use_trait_list').is(':checked')) {
208 trait_list_option = jQuery('#use_trait_list').val();
213 url : '/ajax/phenotype/plot_phenotype_retrieve',
216 'plot_name' : plot_name,
218 'trait_list_option' : trait_list_option,
221 success: function (response) {
222 var value = response.trait_value;
223 var black = {'color': 'red'};
226 alert("Error Retrieving Trait Value: "+response.error);
229 jQuery("#select_pheno_value").css(black);
231 jQuery("#select_pheno_value").val(value);
235 alert('An error occurred retrieving trait value');
242 jQuery(document).on('change', '#select_traits_for_trait_file_2', function(){
243 jQuery("#select_traits_for_trait_file").empty();
247 jQuery("#select_traits_for_trait_file").on('change', function() {
248 jQuery("#select_traits_for_trait_file_2").empty();