Changeset - 530890f6ad9d
[Not reviewed]
0 6 0
Ben Sturmfels (bsturmfels) - 6 months ago 2021-12-10 00:33:37
ben@sturm.com.au
assignment: Apply Denver's requested changes.
6 files changed with 48 insertions and 18 deletions:
0 comments (0 inline, 0 general)
www/conservancy/apps/assignment/forms.py
Show inline comments
...
 
@@ -13,18 +13,20 @@ def validate_in_past(value):
 

	
 
class AssignmentForm(forms.ModelForm):
 
    period_begins = forms.DateField(
 
        label='Start of period to assign',
 
        label='Assign the copyright in my above contributions starting on',
 
        help_text='You can use the day you first started contributing (or, equivalently, your date of birth), or any later date.',
 
        required=True,
 
        widget=forms.DateInput(attrs={'type': 'date'}),
 
        validators=[validate_in_past],
 
    )
 
    period_end_type = forms.ChoiceField(
 
        label='End of period to assign',
 
        label='and ending on',
 
        choices=[
 
            ('all future contributions', 'all future contributions'),
 
            ('all future contributions', 'all future contributions (no end date)'),
 
            ('a specific past date', 'a specific past date (specify below)'),
 
        ],
 
        widget=forms.RadioSelect(),
 
        initial='all future contributions',
 
    )
 
    period_ends = forms.DateField(
 
        label='Specific past date (if applicable)',
...
 
@@ -38,6 +40,10 @@ class AssignmentForm(forms.ModelForm):
 
        help_text='Please be aware that some employment agreements explicitly transfer copyright ownership to the employer. We recommend you review your recent employment agreements for such clauses.',
 
    )
 

	
 
    def __init__(self, *args, **kwargs):
 
        super().__init__(*args, **kwargs)
 
        self.fields['attestation_of_copyright'].required = True
 

	
 
    class Meta:
 
        model = Assignment
 
        fields = [
www/conservancy/apps/assignment/models.py
Show inline comments
...
 
@@ -31,12 +31,12 @@ class Assignment(models.Model):
 
    email = models.EmailField('Email address (to contact you if we have questions)')
 
    country_of_residence = CountryField()
 
    repositories = models.TextField(
 
        'Code repositories contributed to that you\'d like to assign',
 
        'Code repositories containing contributions of yours whose copyright you\'d like to assign',
 
        help_text='List of URLs, one per line',
 
        validators=[validate_mutiple_urls],
 
    )
 
    all_emails = models.TextField(
 
        'All email addresses and/or names used by you to contribute to the above',
 
        'All email addresses used by you to contribute to the above (i.e. in the commit logs)',
 
    )
 
    period_begins = models.DateField(
 
        'Assignment period begins',
www/conservancy/apps/assignment/terms.py
Show inline comments
...
 
@@ -94,8 +94,8 @@ TERMS = textwrap.dedent("""\
 
    asserted by or paid to any party on account of a breach or alleged breach
 
    of the foregoing warranty.  Assignor makes no other express or implied
 
    warranty (including without limitation, in this disclaimer of warranty,
 
    any warranty of <em>merchantability</em> or <em>fitness for a particular
 
    purpose</em>).
 
    any warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 
    PURPOSE).
 

	
 

	
 
    Exhibit A
...
 
@@ -112,10 +112,10 @@ TERMS = textwrap.dedent("""\
 
    The above copyright notice and this permission notice shall be included in
 
    all copies or substantial portions of the Software.
 

	
 
    <em>The software is provided ``as is'', without warranty of any kind, express or
 
    implied, including but not limited to the warranties of merchantability,
 
    fitness for a particular purpose and noninfringement.  In no event shall
 
    the authors or copyright holders be liable for any claim, damages or other
 
    liability, whether in an action of contract, tort or otherwise, arising
 
    from, out of or in connection with the software or the use or other
 
    dealings in the software.</em>""")
 
    THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 
    THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 
    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 
    DEALINGS IN THE SOFTWARE.""")
www/conservancy/templates/assignment/assignment_form.html
Show inline comments
...
 
@@ -10,11 +10,34 @@
 

	
 
    <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 %}
www/conservancy/templates/assignment/base_assignment.html
Show inline comments
...
 
@@ -26,7 +26,7 @@
 
   }
 
   textarea {
 
     width: 100%;
 
     max-width: 35rem;
 
     max-width: 45rem;
 
     height: 8rem;
 
     padding: 0.25rem;
 
   }
www/conservancy/templates/assignment/thanks.html
Show inline comments
...
 
@@ -6,7 +6,8 @@
 

	
 
  <div class="mw7 mb5">
 
    <p>Thank you for assigning your copyright to Software Freedom Conservancy! We have recorded the below information regarding the assignment and the works.</p>
 
    <p>If you would like to make any changes, you must let us know within 7 days by emailing <a href="mailto:info@sfconservancy.org">info@sfconservancy.org</a>. Thanks for helping us enforce free and open source software licenses!</p>
 
    <p>We will be sending out verification emails to the email addresses you used to contribute, as specified below, in the coming weeks.  Please follow the instructions there to complete the verification at that time.</p>
 
    <p>If you would like to make any changes, you must let us know within 7 days by emailing <a href="mailto:info@sfconservancy.org">info@sfconservancy.org</a>, which is also where you can reach us if you have any questions.</p>
 
    <form>
 
      {{ form.as_p }}
 
    </form>
0 comments (0 inline, 0 general)