Prototype copyright assignment form.

This commit is contained in:
Ben Sturmfels 2021-11-30 16:15:59 +11:00
parent 45d2e0782b
commit a2675ee029
Signed by: bsturmfels
GPG key ID: 023C05E2C9C068F0
7 changed files with 62 additions and 0 deletions

View file

@ -0,0 +1,7 @@
from __future__ import unicode_literals
from django.apps import AppConfig
class AssignmentConfig(AppConfig):
name = 'assignment'

View file

@ -0,0 +1,28 @@
from __future__ import unicode_literals
from django.db import models
class Assignment(models.Model):
full_name = models.CharField(max_length=255)
email = models.EmailField()
place_of_residence = models.TextField(
'Country of citizenship or residential address',
blank=True)
repository = models.URLField(
'Code repository',
blank=True,
)
coverage = models.CharField(
verbose_name='Time period to assign',
max_length=50,
choices=[
('up to this year', 'One-off up to and including this year'),
('ongoing', 'All existing and new contributions'),
],
default='up to this year',
)
attestation_of_copyright = models.BooleanField(
'I attest that I own the copyright on these works'
)

View file

@ -0,0 +1,8 @@
from django.conf.urls import url
from .views import AssignmentCreateView
urlpatterns = [
url(r'add/', AssignmentCreateView.as_view(), name='assignement-add'),
]

View file

@ -0,0 +1,18 @@
from django.shortcuts import render
from django.urls import reverse_lazy
from django.views.generic.edit import CreateView, DeleteView, UpdateView
from .models import Assignment
class AssignmentCreateView(CreateView):
model = Assignment
fields = [
'full_name',
'email',
'place_of_residence',
'repository',
'coverage',
'attestation_of_copyright',
]

View file

@ -59,4 +59,5 @@ urlpatterns = [
url(r'^coming-soon.html', static_views.index), url(r'^coming-soon.html', static_views.index),
url(r'^fundraiser_data', fundgoal_views.view), url(r'^fundraiser_data', fundgoal_views.view),
url(r'^ccs-upload/', include('conservancy.apps.ccs_upload.urls', namespace='ccs_upload')), url(r'^ccs-upload/', include('conservancy.apps.ccs_upload.urls', namespace='ccs_upload')),
url(r'^assignment', include('conservancy.apps.assignment.urls')),
] ]