graphical filtering of accession search
[sgn.git] / mason / barcode / index.mas
blob3f308dfa89a59d5e8a0bf420a9a667eafe452f5f
2 <%doc>
4 </%doc>
6 <%args>
7 @tools_def => ()
8 @projects => ()   # [ id, name, description ]
9 @locations => ()  # [ id, description ]
10 </%args>
12 <%perl>
13 use DateTime;
14 my $dt = DateTime->from_epoch( epoch=>time );
15 my $date = join "/", ($dt->year, $dt->month, $dt->day);
16 </%perl>
18 <& /page/page_title.mas, title=>"Barcode Tools" &>
22 %#<&| /page/info_section.mas, title=>'Generate Metadata Barcode', collapsible=>1, %#collapsed=>0 &>
24 %#<form action="/barcode/metadata" >
25 %#  <table>
26 %#    <tr><td>Operator name</td><td><input name="operator" /></td></tr>
27 %#    <tr><td>Date</td><td><input name="date" value="<% $date %>" /> (FORMAT: YYYY/MM/DD)</td></tr>
28 %#    <tr><td>Location</td><td><& /page/html_select.mas, name=>'location', choices=>\@locations &> [<a href="/breeders/home">Add new location</a>]</td></tr>
29 %#    <tr><td>Project</td><td><& /page/html_select.mas, name=>'project', choices=>\@projects &> [<a href="/breeders/home">Add new project</a>]</td></tr>
31 %#  </table>
33 %#  <input type="radio" name="image_size" value="small" checked="1" /> small<br />
34 %#  <input type="radio" name="image_size" value="large" /> large<br />
36 %#  <input type="submit" value="Generate barcode" />
37 %#  </form>
39 %#</&>
41 %#<&| /page/info_section.mas, title=>'Excel Sheet Download',  collapsible=>1, collapsed=>0 &>
43 %#<div class="well well-sm">
44 %#<div class="row">
45 %#  <div class="col-md-1 col-lg-1">
46 %#  </div>
47 %#  <div class="col-md-10 col-lg-10">
48 %#<& /barcode/excel_download.mas, locations=>\@locations, projects=>\@projects, available_cvterms => \@tools_def  &>
49 %#  </div>
50 %#  <div class="col-md-1 col-lg-1">
51 %#  </div>
52 %#</div>
53 %#</div>
55 %#</&>
58 %#<&| /page/info_section.mas, title=>'Metadata &amp; Multibarcode Tool', collapsible=>1, collapsed=>0 &>
60 %#<div class="well well-sm">
61 %#<div class="row">
62 %#  <div class="col-md-1 col-lg-1">
63 %#  </div>
64 %#  <div class="col-md-10 col-lg-10">
65 %#  <& /barcode/multi_tool_input.mas, locations=>\@locations, projects=>\@projects, available_cvterms => \@tools_def &>
66 %#  </div>
67 %#  <div class="col-md-1 col-lg-1">
68 %#  </div>
69 %#</div>
70 %#</div>
72 %#</&>
75 %#<&| /page/info_section.mas, title=>'Generate Continuous Barcode', collapsible=>1, collapsed=>1 &>
77 %#<h3>Note: This tool is experimental</h3>
78 %#<form action="/barcode/continuous_scale" >
79 %#<table>
80 %#<tr><td>Start value</td><td> <input name="start" value="0" size="4" /></td></tr>
81 %#<tr><td>End value</td><td><input name="end" value="1000" size="4"  /></td></tr>
82 %#<tr><td>Step</td><td><input name="step" value="10" size="4" /></td></tr>
83 %#<tr><td>Step height&nbsp;&nbsp;&nbsp;</td><td><input name="height" value="10" size="4" /></td></tr>
84 %#</table>
85 %#<input type="submit" value="Create continuous barcode" />
87 %#</form>
88 %#<br />
89 %#<br />
90 %#</&>
92 <&| /page/info_section.mas, title=>'Generate Barcode', collapsible=>1, collapsed=>1 &>
94 <div class="well well-sm">
95 <div class="row">
96   <div class="col-md-1 col-lg-1">
97   </div>
98   <div class="col-md-10 col-lg-10">
100 <form class="form-horizontal" role="form" action="/barcode/generate">
101   <div class="form-group form-group-sm">
102     <label class="col-sm-2 control-label">Barcode Text: </label>
103     <div class="col-sm-10">
104       <input type="text" class="form-control" name="text" />
105     </div>
106   </div>
107   <div class="form-group form-group-sm">
108     <label class="col-sm-2 control-label">Small: </label>
109     <div class="col-sm-10">
110       <input type="radio" name="size" value="small" checked="1" />
111     </div>
112   </div>
113   <div class="form-group form-group-sm">
114     <label class="col-sm-2 control-label">Large: </label>
115     <div class="col-sm-10">
116       <input type="radio" name="size" value="large" />
117     </div>
118   </div>
120   <button style="float:right" type="submit" class="btn btn-info btn-sm" type="submit" value="Generate barcode">Generate Barcode</button>
121 </form>
123 <br/>
125   </div>
126   <div class="col-md-1 col-lg-1">
127   </div>
128 </div>
129 </div>
131 </&>
133 <&| /page/info_section.mas, title=>'Download Stock Barcodes', collapsible=>1, collapsed=>0 &>
135 <div class="well well-sm">
136 <div class="row">
137   <div class="col-md-1 col-lg-1">
138   </div>
139   <div class="col-md-10 col-lg-10">
141 <form class="form-horizontal" role="form" enctype="multipart/form-data" method="post" action="/barcode/stock/download/pdf" >
142   <div class="form-group form-group-sm">
143     <label class="col-sm-4 control-label">Enter a List of Stock Names: </label>
144     <div class="col-sm-8">
145       <textarea class="form-control" id="stock_names" name="stock_names" ></textarea>
146     </div>
147   </div>
148   <div class="form-group form-group-sm">
149     <label class="col-sm-4 control-label">Or Paste From a List: </label>
150     <div class="col-sm-8">
151       <div id="list_menu_location_1"></div>
152 <script defer="defer">
153   jQuery(document).ready(function() {
154       pasteListMenu('stock_names', 'list_menu_location_1');
156       $(document).on('change', '#select_barcode_type', function () {
157           var barcode_type = jQuery("#select_barcode_type").val();
158           if (barcode_type == "2D") {
159               jQuery("#2D_fieldbook_option").show();
160           }
161           else if (barcode_type == "1D") {
162             jQuery("#2D_fieldbook_option").hide();
163           }
164       });
165       
166       $(document).on('change', '#select_print_format', function () {
167           var format = jQuery("#select_print_format").val();
168           if (format == "32A4") {
169             var label_row = 10;
170             var label_cols = 4; 
171             var tops_margin = 12;
172             var left_margin = 17;
173             var bottom_margin = 12;
174             var right_margin = 10;            
175           }
176           if (format == "32_unique") {
177             var label_row = 10;
178             var label_cols = 4; 
179             var tops_margin = 12;
180             var left_margin = 17;
181             var bottom_margin = 12;
182             var right_margin = 10;
183           }
184           else if (format == "CASS") {
185           var label_row = 10;
186           var label_cols = 2; 
187           var tops_margin = 10;
188           var left_margin = 112;
189           var bottom_margin = 13;
190           var right_margin = 20;
191           }
192           else if (format == "MUSA") {
193           var label_row = 10;
194           var label_cols = 2; 
195           var tops_margin = 10;
196           var left_margin = 112;
197           var bottom_margin = 13;
198           var right_margin = 20;
199           }
200           else if (format == "NCSU") {
201           var label_row = 10;
202           var label_cols = 3; 
203           var tops_margin = 12;
204           var left_margin = 10;
205           var bottom_margin = 12;
206           var right_margin = 10;
207           var text = 'year,location'; 
208           }
209           else if (format == "20A4") {
210           var label_row = 10;
211           var label_cols = 2; 
212           var tops_margin = 12;
213           var left_margin = 10;
214           var bottom_margin = 12;
215           var right_margin = 10;
216           }
217           else if (format == "IITA-3") {
218           var label_row = 20;
219           var label_cols = 3; 
220           var tops_margin = 13;
221           var left_margin = 130;
222           var bottom_margin = 11;
223           var right_margin = 10;
224           }
225           else if (format == "IITA-2") {
226           var label_row = 20;
227           var label_cols = 2; 
228           var tops_margin = 13;
229           var left_margin = 130;
230           var bottom_margin = 11;
231           var right_margin = 10;
232           }
233           else if (format == "crossing") {
234           var label_row = 1;
235           var label_cols = 1; 
236           var tops_margin = 5;
237           var left_margin = 2;
238           var bottom_margin = 0;
239           var right_margin = 0;
240           }
241           jQuery("#text_margin").empty();
242           jQuery("#text_margin").val(text);
243           jQuery("#label_rows").empty();
244           jQuery("#label_rows").val(label_row);
245           jQuery("#label_cols").empty();
246           jQuery("#label_cols").val(label_cols);
247           jQuery("#select_barcode_type").prop('selectedIndex',1);
248           jQuery("#page_format").prop('selectedIndex',0);
249           jQuery("#tops_margin").empty();
250           jQuery("#tops_margin").val(tops_margin);
251           jQuery("#left_margin").empty();
252           jQuery("#left_margin").val(left_margin);
253           jQuery("#bottom_margin").empty();
254           jQuery("#bottom_margin").val(bottom_margin);
255           jQuery("#right_margin").empty();
256           jQuery("#right_margin").val(right_margin);
257       });
258   });
259 </script>
260     </div>
261   </div>
263   <div class="form-group form-group-sm">
264     <label class="col-sm-4 control-label">Barcode Type: </label>
265     <div class="col-sm-8">
266         <select class="form-control" id="select_barcode_type" name="select_barcode_type">
267           <option value="1D">1D Barcode</option>
268           <option value="2D">2D Barcode</option>
269         </select>
270     </div>
271   </div>
273   <div id="2D_fieldbook_option" style="display: none">
274   <div class="form-group form-group-sm" >
275     <label class="col-sm-4 control-label">Enable 2D Barcode For FieldBook: </label>
276     <div class="col-sm-8">
277       <input type="checkbox" id="enable_fieldbook_2d_barcode" name="enable_fieldbook_2d_barcode" value="enable_fieldbook_2d_barcode" />
278     </div>
279   </div>
280   </div>
282   <div class="form-group form-group-sm">
283     <label class="col-sm-4 control-label">Printing Format (Optional): </label>
284     <div class="col-sm-8">
285         <select class="form-control" id="select_print_format" name="select_print_format">
286           <!--<option selected disabled>select printing format</option>-->
287           <option value="">select printing format</option>
288           <option value="CASS">CASS printing format</option>
289           <option value="MUSA">MUSA printing format</option>
290           <option value="32A4">32 label Size Sticker Paper</option>
291           <option value="32_unique">32 Unique label Size Sticker Paper</option>
292           <option value="20A4">20 label Size Sticker Paper</option>
293           <option value="NCSU">NCSU printing format</option>
294           <option value="IITA-3">IITA-3-barcode</option>
295           <option value="IITA-2">IITA-2-barcode</option>
296           <option value="crossing">CROSS</option>
297         </select>
298     </div>
299   </div>
301   <div class="form-group form-group-sm">
302     <label class="col-sm-4 control-label">Or Upload <font size="3" color="#5bc0de">Tab-delimited Text File</font> With Stock Names: </label>
303     <div class="col-sm-8">
304       <input type="file" name="stock_names_file" />
305     </div>
306   </div>
307   <div class="form-group form-group-sm">
308     <label class="col-sm-4 control-label">Print Duplicate Labels Per Row: </label>
309     <div class="col-sm-8">
310       <input type="checkbox" name="duplicate_labels_per_row" checked="1" disabled="1" />
311     </div>
312     </div>
313     <!--<div class="form-group form-group-sm">
314     <label class="col-sm-4 control-label">Print Field Information For Plots: </label>
315     <div class="col-sm-8">
316       <input type="checkbox" name="plots" value="plots" /> &nbsp; &nbsp; &nbsp; Useful for Printing Field Information of Trials.
317     </div>
318   </div>-->
319   <!--<div class="form-group form-group-sm">
320     <label class="col-sm-4 control-label">Print Parents For Nurseries: </label>
321     <div class="col-sm-8">
322       <input type="checkbox" name="nursery" value="nursery" /> &nbsp; &nbsp; &nbsp; Useful for Printing Pedigree Information for Nurseries.
323     </div>
324   </div>-->
326   <& /barcode/printer_settings.mas &>
328   <button style="float:right" type="submit" class="btn btn-info btn-sm" type="submit" value="Download Barcodes">Download Barcodes</button>
329   <button style="float:right" class="btn btn-default btn-sm" type="reset" >Clear</button>
330 </form>
332 <br/>
334   </div>
335   <div class="col-md-1 col-lg-1">
336   </div>
337 </div>
338 </div>
340 <br/>
342 </&>
344 <!-- phenotyping barcode -->
346 <&| /page/info_section.mas, title=>'Download Plot Phenotyping Barcodes', collapsible=>1, collapsed=>0 &>
348 <div class="well well-sm">
349 <div class="row">
350   <div class="col-md-1 col-lg-1">
351   </div>
352   <div class="col-md-10 col-lg-10">
354 <form class="form-horizontal" role="form" enctype="multipart/form-data" method="post" action="/barcode/stock/download/plot_QRcode" >
355   <div class="form-group form-group-sm">
356     <label class="col-sm-4 control-label">Enter a List of Stock Names: </label>
357     <div class="col-sm-8">
358       <textarea class="form-control" id="stock_names_2" name="stock_names_2" ></textarea>
359     </div>
360   </div>
361   <div class="form-group form-group-sm">
362     <label class="col-sm-4 control-label">Or Paste From a List: </label>
363     <div class="col-sm-8">
364       <div id="list_menu_location_2"></div>
365 <script defer="defer">
366   jQuery(document).ready(function() {
367       pasteListMenu('stock_names_2', 'list_menu_location_2', 'paste', 'plots');
368   });
370 </script>
371     </div>
372   </div>
373   <div class="form-group form-group-sm">
374     <label class="col-sm-4 control-label">Or Upload <font size="3" color="#5bc0de">Tab-delimited Text File</font> With Stock Names: </label>
375     <div class="col-sm-8">
376       <input type="file" name="stock_names_file_2" />
377     </div>
378   </div>
380   <div class="form-group form-group-sm">
381     <label class="col-sm-4 control-label">Add Text to Label, e.g. location: </label>
382     <div class="col-sm-8">
383         <input class="form-control" id="select_barcode_text" name="select_barcode_text"></input>
384     </div>
385   </div>
387 <!--  <div class="form-group form-group-sm">
388     <label class="col-sm-4 control-label">Print Duplicate Labels Per Row: </label>
389     <div class="col-sm-8">
390       <input type="checkbox" name="duplicate_labels_per_row" checked="1" disabled="1" />
391     </div>
392     </div> -->
394 %#  <& /barcode/printer_settings.mas &> #%
396   <button style="float:right" type="submit" class="btn btn-info btn-sm" type="submit" value="Download Barcodes">Download Barcodes</button>
397   <button style="float:right" class="btn btn-default btn-sm" type="reset" >Clear</button>
398 </form>
400 <br/>
402   </div>
403   <div class="col-md-1 col-lg-1">
404   </div>
405 </div>
406 </div>
408 <br/>
410 </&>
412 <!-- Trial barcode -->
414 <&| /page/info_section.mas, title=>'Download Trial Barcodes', collapsible=>1, collapsed=>0 &>
416 <div class="well well-sm">
417 <div class="row">
418   <div class="col-md-1 col-lg-1">
419   </div>
420   <div class="col-md-10 col-lg-10">
422 <form class="form-horizontal" role="form" enctype="multipart/form-data" method="post" action="/barcode/trial/download/trial_QRcode" >
423   <div class="form-group form-group-sm">
424     <label class="col-sm-4 control-label">Enter a List of Trial Names: </label>
425     <div class="col-sm-8">
426       <textarea class="form-control" id="trial_names_2" name="trial_names_2" ></textarea>
427     </div>
428   </div>
429   <div class="form-group form-group-sm">
430     <label class="col-sm-4 control-label">Or Paste From a List: </label>
431     <div class="col-sm-8">
432       <div id="list_menu_location_3"></div>
433 <script defer="defer">
434   jQuery(document).ready(function() {
435       pasteListMenu('trial_names_2', 'list_menu_location_3', 'paste', 'trials');
436   });
438 </script>
439     </div>
440   </div>
441   <div class="form-group form-group-sm">
442     <label class="col-sm-4 control-label">Or Upload <font size="3" color="#5bc0de">Tab-delimited Text File</font> With Trial Names: </label>
443     <div class="col-sm-8">
444       <input type="file" name="trial_names_file_2" />
445     </div>
446   </div>
448   <button style="float:right" type="submit" class="btn btn-info btn-sm" type="submit" value="Download Barcodes">Download Barcodes</button>
449   <button style="float:right" class="btn btn-default btn-sm" type="reset" >Clear</button>
450 </form>
452 <br/>
454   </div>
455   <div class="col-md-1 col-lg-1">
456   </div>
457 </div>
458 </div>
460 <br/>
462 </&>
464 %#<&| /page/info_section.mas, title=>'Generate unique barcodes', collapsible=>1, collapsed=>0 &>
466 %#<form action="/barcode/unique" >
468 %#  Number of label pages to print <input type="text" name="label_pages" /><br /><br />
470 %#  <& /barcode/printer_settings.mas &>
471 %#    <br />
472 %#  <input type="submit" value="Generate barcodes" />
473 %#  </form>
475 %#</& >