Changes from track-org
This MR makes various fixes and improvements to the MicroscopyData
app which where implemented for track-org but also apply here. See inline comments for details
Edited by Jeremy Pike (Former Member of Staff)
Merge request reports
Activity
assigned to @pikeja
added 1 commit
- 2bb44212 - clear share_with when uploading private data
requested review from @wingfiec
removed review request for @wingfiec
48 48 fields.forEach(field => toggleFieldRequired(field, isVisible, isRequired)); 49 49 } 50 50 51 // If private upload is selected then disable share_with option. 52 var privateUpload = document.getElementById("id_private_upload"); 53 var shareWith = document.getElementById("id_share_with"); 54 privateUpload.addEventListener("change", (event) => { 55 if (event.currentTarget.checked) { 51 function form_handling() { 49 49 } 50 50 51 // If private upload is selected then disable share_with option. 52 var privateUpload = document.getElementById("id_private_upload"); 53 var shareWith = document.getElementById("id_share_with"); 54 privateUpload.addEventListener("change", (event) => { 55 if (event.currentTarget.checked) { 51 function form_handling() { 52 // If private upload is selected then disable share_with option. 53 var privateUpload = document.getElementById("id_private_upload"); 54 var shareWith = document.getElementById("id_share_with"); 55 56 // Initial check to set the disabled state based on the checkbox's current status 57 if (privateUpload.checked) { 56 58 $(shareWith).prop("disabled", true); 59 shareWith.value = null; 141 progressBar.innerHTML = `<div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" style="width: ${percent}%" aria-valuenow="${percent}" aria-valuemin="0" aria-valuemax="100">Uploading: ${percentRounded}%</div>`; 142 } 143 }); 144 return xhr 145 }, 146 success: function(data){ 147 progressBar.classList.add("invisible"); 148 if (!(data["success"])) { 149 $(uploadForm).replaceWith(data["form_html"]); 150 form_handling(); 151 // Scroll to the top of the page 152 window.scrollTo({ 153 top: 0, 154 behavior: 'smooth' // Optional: smooth scrolling 155 }); 156 submitForm(); 22 22 <br> 23 23 <div class="container invisible progress" id="progress-bar">Progress</div> 24 24 25 <!-- Dynamic upload form fields --> 25 <!-- Dynamic upload form fields with progress bar--> 26 26 <script src="{% static 'js/upload_form_handling.js' %}"></script> 27 <!-- Submit form with progress bar --> 28 <script src="{% static 'js/progress_bar.js' %}"></script> 13 13 <br> 14 14 <div class="container invisible progress" id="progress-bar">Progress</div> 15 15 16 <!-- Dynamic upload form fields --> 16 <!-- Dynamic upload form fields with progress bar--> 17 17 <script src="{% static 'js/upload_form_handling.js' %}"></script> 18 <!-- Submit form with progress bar --> 19 <script src="{% static 'js/progress_bar.js' %}"></script> 14 14 {% if data.doi %} 15 15 <td> 16 16 <a href="https://doi.org/{{ data.doi }}"> 17 <img src="https://img.shields.io/badge/DOI-{{ data.doi }}-yellow" alt="DOI {{ data.doi }}"> 17 <img src="https://img.shields.io/badge/DOI-{{ doi_shields }}-yellow" alt="DOI {{ data.doi }}">
Please register or sign in to reply