Skip to content
Snippets Groups Projects

Changes from track-org

Merged Jeremy Pike (Former Member of Staff) requested to merge track-org-changes into master

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

Merge request reports

Pipeline #64672 passed

Pipeline passed for 850733fa on track-org-changes

Merged by Jeremy Pike (Former Member of Staff)Jeremy Pike (Former Member of Staff) 9 months ago (Oct 28, 2024 1:17pm UTC)

Loading

Pipeline #64678 passed

Pipeline passed for c1b7761e on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
144 144 height: 300px;
145 145 padding: 12px 20px;
146 146 }
147
148 .clear-all-btn {
149 margin-top: .5rem;
150 }
  • 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;
  • 61
    62 privateUpload.addEventListener("change", (event) => {
    63 if (event.currentTarget.checked) {
    64 $(shareWith).prop("disabled", true);
    65 // Deselect all options in the 'share_with' select element
    66 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 }}">
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading