Skip to content

Commit

Permalink
Merge pull request #5187 from solgenomics/topic/bulk_download_seedlots
Browse files Browse the repository at this point in the history
Seedlots: Bulk Download from List
  • Loading branch information
lukasmueller authored Nov 14, 2024
2 parents baaa953 + 35beefe commit 8d1a135
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 1 deletion.
2 changes: 1 addition & 1 deletion js/source/legacy/CXGN/BreedersToolbox/HTMLSelect.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

function get_select_box(type, div_id, options) {
function get_select_box(type, div_id, options = {}) {

//alert(JSON.stringify(options));
jQuery.ajax( {
Expand Down
65 changes: 65 additions & 0 deletions mason/breeders_toolbox/download.mas
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,71 @@ $(document).ready(function() {



<!-- start of code for seedlot details download -->

<div class="well well-sm">
<form id="download_seedlot_details" action="/list/download_details" method="POST">
<table class="table" cellpadding="10">
<thead>
<tr><td colspan="2"><h4>Download Seedlot Details </h4><p>Select parameters:</p></tr>
<tr>
<th>Seedlots</th>
<th>Format</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<div id="seedlot_list"></div>
</td>
<td>
<select class="form-control" id="seedlot_file_format" name="file_format">
<option value=".txt">Plain Text</option>
</select>
</td>
<td>
<button class="btn btn-primary" type="button" id="seedlot">Download</button>
<input type="hidden" id="seedlot_list_id" name="list_id" />
<input type="hidden" id="seedlot_download_token" name="list_download_token" />
</td>
</tr>
</tbody>
</table>
</form>
</div>


<script>
$(document).ready(function() {
var lo = new CXGN.List();
$('#seedlot_list').html(lo.listSelect('seedlot_list', [ 'seedlots' ], 'select', undefined, undefined));
$('#seedlot').click(function() {
var seedlot_list_id = $('#seedlot_list_list_select').val();
if (!seedlot_list_id) {
alert("You need to select a seedlot list!");
return;
}
else {
lo.validate(seedlot_list_id, 'seedlots', true).then((r) => {
if (r.missing.length > 0) {
alert("The seedlot list did not pass validation. Please correct the list and try again");
}
else {
jQuery("#seedlot_list_id").val(seedlot_list_id);
jQuery('#download_seedlot_details').submit();
}
});
}
});
});

</script>

<!-- end of code for seedlot download -->



<!-- start of code for download seedlot matinenance events -->

% if ( $seedlot_maintenance_enabled ) {
Expand Down

0 comments on commit 8d1a135

Please sign in to comment.