Merge pull request #2754 from solgenomics/topic/fix_homepage_add_accessions_dialog
[sgn.git] / mason / barcode / index.mas
blob626ae39447ab82063bb7f6b9049cacdd16cc3765
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, subtitle=>'<button type="button" class="btn btn-primary" name="custom_barcode_link" id="custom_barcode_link">Design Custom Barcode</button>'&>
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       jQuery('#custom_barcode_link').click(function () {
167           location.href = '/tools/label_designer';
168       });
169       
170       $(document).on('change', '#select_print_format', function () {
171           var format = jQuery("#select_print_format").val();
172           if (format == "32A4") {
173             var label_row = 10;
174             var label_cols = 4; 
175             var tops_margin = 12;
176             var left_margin = 17;
177             var bottom_margin = 12;
178             var right_margin = 10;            
179           }
180           if (format == "32_unique") {
181             var label_row = 10;
182             var label_cols = 4; 
183             var tops_margin = 12;
184             var left_margin = 17;
185             var bottom_margin = 12;
186             var right_margin = 10;
187           }
188           else if (format == "CASS") {
189           var label_row = 10;
190           var label_cols = 2; 
191           var tops_margin = 10;
192           var left_margin = 112;
193           var bottom_margin = 13;
194           var right_margin = 20;
195           }
196           else if (format == "MUSA") {
197           var label_row = 10;
198           var label_cols = 2; 
199           var tops_margin = 10;
200           var left_margin = 112;
201           var bottom_margin = 13;
202           var right_margin = 20;
203           }
204           else if (format == "NCSU") {
205           var label_row = 10;
206           var label_cols = 3; 
207           var tops_margin = 12;
208           var left_margin = 10;
209           var bottom_margin = 12;
210           var right_margin = 10;
211           var text = 'year,location'; 
212           }
213           else if (format == "20A4") {
214           var label_row = 10;
215           var label_cols = 2; 
216           var tops_margin = 12;
217           var left_margin = 10;
218           var bottom_margin = 12;
219           var right_margin = 10;
220           }
221           else if (format == "IITA-3") {
222           var label_row = 20;
223           var label_cols = 3; 
224           var tops_margin = 13;
225           var left_margin = 130;
226           var bottom_margin = 11;
227           var right_margin = 10;
228           }
229           else if (format == "IITA-2") {
230           var label_row = 20;
231           var label_cols = 2; 
232           var tops_margin = 13;
233           var left_margin = 130;
234           var bottom_margin = 11;
235           var right_margin = 10;
236           }
237           else if (format == "crossing") {
238           var label_row = 1;
239           var label_cols = 1; 
240           var tops_margin = 5;
241           var left_margin = 2;
242           var bottom_margin = 0;
243           var right_margin = 0;
244           }
245           jQuery("#text_margin").empty();
246           jQuery("#text_margin").val(text);
247           jQuery("#label_rows").empty();
248           jQuery("#label_rows").val(label_row);
249           jQuery("#label_cols").empty();
250           jQuery("#label_cols").val(label_cols);
251           jQuery("#select_barcode_type").prop('selectedIndex',1);
252           jQuery("#page_format").prop('selectedIndex',0);
253           jQuery("#tops_margin").empty();
254           jQuery("#tops_margin").val(tops_margin);
255           jQuery("#left_margin").empty();
256           jQuery("#left_margin").val(left_margin);
257           jQuery("#bottom_margin").empty();
258           jQuery("#bottom_margin").val(bottom_margin);
259           jQuery("#right_margin").empty();
260           jQuery("#right_margin").val(right_margin);
261       });
262   });
263 </script>
264     </div>
265   </div>
267   <div class="form-group form-group-sm">
268     <label class="col-sm-4 control-label">Barcode Type: </label>
269     <div class="col-sm-8">
270         <select class="form-control" id="select_barcode_type" name="select_barcode_type">
271           <option value="2D">2D Barcode</option>
272           <option value="1D">1D Barcode</option>
273         </select>
274     </div>
275   </div>
277   <div id="2D_fieldbook_option" >
278   <div class="form-group form-group-sm" >
279     <label class="col-sm-4 control-label">Enable 2D Barcode For FieldBook: </label>
280     <div class="col-sm-8">
281       <input type="checkbox" id="enable_fieldbook_2d_barcode" name="enable_fieldbook_2d_barcode" value="enable_fieldbook_2d_barcode" checked/>
282     </div>
283   </div>
284   </div>
286   <div class="form-group form-group-sm">
287     <label class="col-sm-4 control-label">Printing Format (Optional): </label>
288     <div class="col-sm-8">
289         <select class="form-control" id="select_print_format" name="select_print_format">
290           <!--<option selected disabled>select printing format</option>-->
291           <option value="">select printing format</option>
292           <option value="CASS">CASS printing format</option>
293           <option value="MUSA">MUSA printing format</option>
294           <option value="32A4">32 label Size Sticker Paper</option>
295           <option value="32_unique">32 Unique label Size Sticker Paper</option>
296           <option value="20A4">20 label Size Sticker Paper</option>
297           <option value="NCSU">NCSU printing format</option>
298           <option value="IITA-3">IITA-3-barcode</option>
299           <option value="IITA-2">IITA-2-barcode</option>
300           <option value="crossing">CROSS</option>
301         </select>
302     </div>
303   </div>
305   <div class="form-group form-group-sm">
306     <label class="col-sm-4 control-label">Or Upload <font size="3" color="#5bc0de">Tab-delimited Text File</font> With Stock Names: </label>
307     <div class="col-sm-8">
308       <input type="file" name="stock_names_file" />
309     </div>
310   </div>
311   <div class="form-group form-group-sm" style="display: none">
312     <label class="col-sm-4 control-label">Print Duplicate Labels Per Row: </label>
313     <div class="col-sm-8">
314       <input type="checkbox" name="duplicate_labels_per_row" checked="1" disabled="1" />
315     </div>
316   </div> 
317     <!--<div class="form-group form-group-sm">
318     <label class="col-sm-4 control-label">Print Field Information For Plots: </label>
319     <div class="col-sm-8">
320       <input type="checkbox" name="plots" value="plots" /> &nbsp; &nbsp; &nbsp; Useful for Printing Field Information of Trials.
321     </div>
322   </div>-->
323   <!--<div class="form-group form-group-sm">
324     <label class="col-sm-4 control-label">Print Parents For Nurseries: </label>
325     <div class="col-sm-8">
326       <input type="checkbox" name="nursery" value="nursery" /> &nbsp; &nbsp; &nbsp; Useful for Printing Pedigree Information for Nurseries.
327     </div>
328   </div>-->
330   <& /barcode/printer_settings.mas &>
332   <button style="float:right" type="submit" class="btn btn-info btn-sm" type="submit" value="Download Barcodes">Download Barcodes</button>
333   <button style="float:right" class="btn btn-default btn-sm" type="reset" >Clear</button>
334 </form>
336 <br/>
338   </div>
339   <div class="col-md-1 col-lg-1">
340   </div>
341 </div>
342 </div>
344 <br/>
346 </&>
348 <!-- phenotyping barcode -->
350 <&| /page/info_section.mas, title=>'Download Plot Phenotyping Barcodes', collapsible=>1, collapsed=>0 &>
352 <div class="well well-sm">
353 <div class="row">
354   <div class="col-md-1 col-lg-1">
355   </div>
356   <div class="col-md-10 col-lg-10">
358 <form class="form-horizontal" role="form" enctype="multipart/form-data" method="post" action="/barcode/stock/download/plot_QRcode" >
359   <div class="form-group form-group-sm">
360     <label class="col-sm-4 control-label">Enter a List of Stock Names: </label>
361     <div class="col-sm-8">
362       <textarea class="form-control" id="stock_names_2" name="stock_names_2" ></textarea>
363     </div>
364   </div>
365   <div class="form-group form-group-sm">
366     <label class="col-sm-4 control-label">Or Paste From a List: </label>
367     <div class="col-sm-8">
368       <div id="list_menu_location_2"></div>
369 <script defer="defer">
370   jQuery(document).ready(function() {
371       pasteListMenu('stock_names_2', 'list_menu_location_2', 'paste', 'plots');
372   });
374 </script>
375     </div>
376   </div>
377   <div class="form-group form-group-sm">
378     <label class="col-sm-4 control-label">Or Upload <font size="3" color="#5bc0de">Tab-delimited Text File</font> With Stock Names: </label>
379     <div class="col-sm-8">
380       <input type="file" name="stock_names_file_2" />
381     </div>
382   </div>
384   <div class="form-group form-group-sm">
385     <label class="col-sm-4 control-label">Add Text to Label, e.g. location: </label>
386     <div class="col-sm-8">
387         <input class="form-control" id="select_barcode_text" name="select_barcode_text"></input>
388     </div>
389   </div>
391 <!--  <div class="form-group form-group-sm">
392     <label class="col-sm-4 control-label">Print Duplicate Labels Per Row: </label>
393     <div class="col-sm-8">
394       <input type="checkbox" name="duplicate_labels_per_row" checked="1" disabled="1" />
395     </div>
396     </div> -->
398 %#  <& /barcode/printer_settings.mas &> #%
400   <button style="float:right" type="submit" class="btn btn-info btn-sm" type="submit" value="Download Barcodes">Download Barcodes</button>
401   <button style="float:right" class="btn btn-default btn-sm" type="reset" >Clear</button>
402 </form>
404 <br/>
406   </div>
407   <div class="col-md-1 col-lg-1">
408   </div>
409 </div>
410 </div>
412 <br/>
414 </&>
416 <!-- Trial barcode -->
418 <&| /page/info_section.mas, title=>'Download Trial Barcodes', collapsible=>1, collapsed=>0 &>
420 <div class="well well-sm">
421 <div class="row">
422   <div class="col-md-1 col-lg-1">
423   </div>
424   <div class="col-md-10 col-lg-10">
426 <form class="form-horizontal" role="form" enctype="multipart/form-data" method="post" action="/barcode/trial/download/trial_QRcode" >
427   <div class="form-group form-group-sm">
428     <label class="col-sm-4 control-label">Enter a List of Trial Names: </label>
429     <div class="col-sm-8">
430       <textarea class="form-control" id="trial_names_2" name="trial_names_2" ></textarea>
431     </div>
432   </div>
433   <div class="form-group form-group-sm">
434     <label class="col-sm-4 control-label">Or Paste From a List: </label>
435     <div class="col-sm-8">
436       <div id="list_menu_location_3"></div>
437 <script defer="defer">
438   jQuery(document).ready(function() {
439       pasteListMenu('trial_names_2', 'list_menu_location_3', 'paste', 'trials');
440   });
442 </script>
443     </div>
444   </div>
445   <div class="form-group form-group-sm">
446     <label class="col-sm-4 control-label">Or Upload <font size="3" color="#5bc0de">Tab-delimited Text File</font> With Trial Names: </label>
447     <div class="col-sm-8">
448       <input type="file" name="trial_names_file_2" />
449     </div>
450   </div>
452   <button style="float:right" type="submit" class="btn btn-info btn-sm" type="submit" value="Download Barcodes">Download Barcodes</button>
453   <button style="float:right" class="btn btn-default btn-sm" type="reset" >Clear</button>
454 </form>
456 <br/>
458   </div>
459   <div class="col-md-1 col-lg-1">
460   </div>
461 </div>
462 </div>
464 <br/>
466 </&>
468 %#<&| /page/info_section.mas, title=>'Generate unique barcodes', collapsible=>1, collapsed=>0 &>
470 %#<form action="/barcode/unique" >
472 %#  Number of label pages to print <input type="text" name="label_pages" /><br /><br />
474 %#  <& /barcode/printer_settings.mas &>
475 %#    <br />
476 %#  <input type="submit" value="Generate barcodes" />
477 %#  </form>
479 %#</& >