-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #626 from ODM2/develop
Release 0.14
- Loading branch information
Showing
54 changed files
with
3,732 additions
and
248 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+130 KB
...taloaderinterface/static/dataloaderinterface/images/WSI_logo_blue_no_circle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+156 KB
...rface/static/dataloaderinterface/images/WSI_logo_white_no_circle_unofficial.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions
43
src/dataloaderinterface/static/dataloaderinterface/js/manage-streamwatch.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
function defaultExperimentsMessage() { | ||
$("tr.no-experiments-row").toggleClass("hidden", !!$("tr.leafpack-form:not(.deleted-row)").length); | ||
} | ||
|
||
$(document).ready(function() { | ||
$(".btn-delete-experiment").click(function () { | ||
var experiment = $(this).parents('tr'); | ||
$('#confirm-delete-experiment').data('to-delete', experiment).modal('show'); | ||
}); | ||
|
||
$("#btn-confirm-delete-experiment").click(function () { | ||
const dialog = $('#confirm-delete-experiment'); | ||
const row = dialog.data('to-delete'); | ||
$("#btn-confirm-delete-experiment").prop("disabled", true).text("DELETING ..."); | ||
|
||
const sampling_feature_code = $('#sampling_feature_code').attr('sampling_feature_code'); | ||
|
||
$.ajax({ | ||
url: `/sites/${sampling_feature_code}/streamwatch/delete/`, | ||
type: 'post', | ||
data: { | ||
csrfmiddlewaretoken: $('fieldset.form-fieldset input[name="csrfmiddlewaretoken"]').val(), | ||
id: row.data('id') | ||
} | ||
}).done(function (data, message, xhr) { | ||
if (xhr.status === 202) { | ||
// Valid | ||
row.remove(); | ||
snackbarMsg('StreamWatch assessment has been deleted!'); | ||
|
||
} else if (xhr.status === 206) { | ||
// Invalid | ||
snackbarMsg('StreamWatch assessment could not be deleted!'); | ||
} | ||
}).fail(function (xhr, error) { | ||
console.log(error); | ||
}).always(function (response, status, xhr) { | ||
$("#btn-confirm-delete-experiment").prop("disabled", false).text("DELETE"); | ||
defaultExperimentsMessage(); | ||
dialog.modal('hide'); | ||
}); | ||
}); | ||
}); |
97 changes: 97 additions & 0 deletions
97
src/dataloaderinterface/static/dataloaderinterface/js/streamwatch-create.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
/** | ||
* Created by HTAO on 6/7/2022. | ||
*/ | ||
$(document).ready(function () { | ||
$('.datepicker').datepicker({ | ||
format: 'yyyy-mm-dd', | ||
startDate: '0d' | ||
}); | ||
|
||
// Validation for placement date | ||
$('#id_placement_date, #id_retrieval_date').change(function () { | ||
var placement = $('#id_placement_date').val(); | ||
var retrieval = $('#id_retrieval_date').val(); | ||
if (placement && retrieval) { | ||
var placementDate = new Date(placement); | ||
var retrievalDate = new Date(retrieval); | ||
if (placementDate > retrievalDate) { | ||
$('#id_placement_date')[0].setCustomValidity('Placement date has to be before the retrieval date.'); | ||
} | ||
else { | ||
$('#id_placement_date')[0].setCustomValidity(''); | ||
$('#id_retrieval_date')[0].setCustomValidity(''); | ||
} | ||
} | ||
else if (!$(this).val()) { | ||
this.setCustomValidity('Please fill out this field.'); | ||
} | ||
}); | ||
|
||
favorite =[]; | ||
//totalForms = $('#id_2_TOTAL_FORMS'); | ||
let totalForms = document.querySelector("#id_para-TOTAL_FORMS") | ||
let sensorForm = document.querySelectorAll(".parameter-form") | ||
let container = document.querySelector("#para-container") | ||
let addButton = document.querySelector("#para-end") | ||
|
||
let formNum = sensorForm.length-1 // Get the number of the last form on the page with zero-based indexing | ||
//alert("My selected types are: " + favorite.join(", ")); | ||
|
||
$("input[name='0-activity_type']").click(function() { | ||
favorite =[]; | ||
$.each($("input[name='0-activity_type']:checked"), function(){ | ||
favorite.push($(this).val()); | ||
}); | ||
//alert("My selected types are: " + favorite.join(", ")); | ||
}); | ||
|
||
$("form").submit(function() { | ||
// favorite =[]; | ||
// $.each($("input[name='0-activity_type']:checked"), function(){ | ||
// favorite.push($(this).val()); | ||
// }); | ||
//alert("My selected types are: " + favorite.join(", ")); | ||
}); | ||
|
||
$("#id_sensor-test_method").change(function() { | ||
//alert("My selected types are: " + $(this).find(":selected").text()); | ||
|
||
if($(this).find(":selected").text()!="Meter") { //3rd radiobutton | ||
$("#id_sensor-calibration_date").attr("disabled", "disabled"); | ||
$("#id_sensor-meter").attr("disabled", "disabled"); | ||
} | ||
else { | ||
$("#id_sensor-calibration_date").removeAttr("disabled"); | ||
$("#id_sensor-meter").removeAttr("disabled"); | ||
} | ||
|
||
}); | ||
|
||
$(".btn-add-parameter").click(function(){ | ||
//alert("Add method clicked!"); | ||
AddSensorParameterForm(); | ||
}); | ||
|
||
|
||
// tutorial for dynamically adding Forms in Django with Formsets and JavaScript | ||
// https://www.brennantymrak.com/articles/django-dynamic-formsets-javascript | ||
|
||
function AddSensorParameterForm() { | ||
//e.preventDefault() | ||
|
||
const newForm = sensorForm[0].cloneNode(true) //Clone the bird form | ||
$(newForm).attr('class','row parameter-form'); | ||
let formRegex = RegExp(`parameter-(\\d){1}-`,'g') //Regex to find all instances of the form number | ||
|
||
formNum++ //Increment the form number | ||
newForm.innerHTML = newForm.innerHTML.replace(formRegex, `para-${formNum}-`) //Update the new form to have the correct form number | ||
|
||
//container.insertBefore(newForm, addButton) //Insert the new form at the end of the list of forms | ||
//$(newForm).insertBefore( "#btn-add-parameter" ); | ||
$(newForm).val(''); | ||
$('.parameter-card').append($(newForm)); | ||
|
||
totalForms.setAttribute('value', `${formNum+1}`) //Increment the number of total forms in the management form | ||
|
||
} | ||
}); |
6 changes: 6 additions & 0 deletions
6
src/dataloaderinterface/static/dataloaderinterface/js/streamwatch-detail.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
$(document).ready(function () { | ||
|
||
$( "#accordion" ).accordion(); | ||
|
||
|
||
}); |
Oops, something went wrong.