File diff c6b329f0cff0 → 530890f6ad9d
www/conservancy/templates/assignment/assignment_form.html
Show inline comments
...
 
@@ -7,14 +7,37 @@
 
    <p>Thank you for considering assigning your copyright to the Software Freedom Conservancy. Your assignment helps us enforce free and open source software licenses.</p>
 

	
 
    <p>By filling in and submitting the below form, you agree to assign your copyrights in the specified projects to Software Freedom Conservancy, which means that Conservancy can enforce the licenses that your code is under in court, without you needing to be involved.  Conservancy agrees to keep your code under a free and open source license.</p>
 

	
 
    <p>If you have any questions about assigning your copyright to Conservancy, please don't hesitate to email us at <a href="mailto:info@sfconservancy.org">info@sfconservancy.org</a>.</p>
 

	
 
    <form action="." method="post" class="mw7">
 
    <form id="assignment-form" action="." method="post" class="mw7">
 
      {% csrf_token %}
 
      {{ form.as_p }}
 

	
 
      <p><button type="submit" class="ph3 pv2">Next</button></p>
 
      <p><button type="submit" class="ph3 pv2">Submit</button></p>
 
    </form>
 
  </div>
 

	
 
  <script>
 
   'use strict';
 

	
 
   // End date field should be shown only when "a specific past date" is selected.
 
   const form = document.querySelector('#assignment-form');
 
   const past_date_label = document.querySelector('label[for=id_period_ends]');
 
   const past_date_field = document.querySelector('#assignment-form > p:nth-child(11)');
 
   form.addEventListener('change', togglePastDate);
 
   togglePastDate();  // Run change handler once to initialise form.
 

	
 
   // Text "(if applicable)" isn't relevant with JS enabled.
 
   past_date_label.innerHTML = past_date_label.innerHTML.replace(' (if applicable)', '');
 

	
 
   function togglePastDate() {
 
       if (form['period_end_type'].value === 'all future contributions') {
 
           past_date_field.style.display = 'none';
 
       }
 
       else {
 
           past_date_field.style.display = '';
 
       }
 
   }
 
  </script>
 
{% endblock %}