forked from ScoDoc/ScoDoc
Update opolka/ScoDoc from ScoDoc/ScoDoc #2
@ -367,6 +367,9 @@ def evaluation_create_form(
|
||||
+ "\n".join(H)
|
||||
+ "\n"
|
||||
+ tf[1]
|
||||
+ render_template(
|
||||
"scodoc/forms/evaluation_edit.j2",
|
||||
)
|
||||
+ render_template(
|
||||
"scodoc/help/evaluations.j2", is_apc=is_apc, modimpl=modimpl
|
||||
)
|
||||
|
22
app/templates/scodoc/forms/evaluation_edit.j2
Normal file
22
app/templates/scodoc/forms/evaluation_edit.j2
Normal file
@ -0,0 +1,22 @@
|
||||
{# Interdit de définir des évaluations non normales "immédiates" #}
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var evaluationTypeSelect = document.getElementById('tf_evaluation_type');
|
||||
var publishIncompleteCheckbox = document.querySelector('input[type="checkbox"][name="publish_incomplete:list"]');
|
||||
|
||||
function updateCheckboxState() {
|
||||
if (evaluationTypeSelect.value !== '0') {
|
||||
publishIncompleteCheckbox.disabled = true;
|
||||
publishIncompleteCheckbox.checked = false; // Ensure the checkbox is not checked
|
||||
} else {
|
||||
publishIncompleteCheckbox.disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Add event listener to select element
|
||||
evaluationTypeSelect.addEventListener('change', updateCheckboxState);
|
||||
|
||||
// Initial call to set the correct state when the page loads
|
||||
updateCheckboxState();
|
||||
});
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user