Prototype copyright assignment form.
This commit is contained in:
parent
45d2e0782b
commit
a2675ee029
7 changed files with 62 additions and 0 deletions
0
www/conservancy/apps/assignment/__init__.py
Normal file
0
www/conservancy/apps/assignment/__init__.py
Normal file
7
www/conservancy/apps/assignment/apps.py
Normal file
7
www/conservancy/apps/assignment/apps.py
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
|
class AssignmentConfig(AppConfig):
|
||||||
|
name = 'assignment'
|
0
www/conservancy/apps/assignment/migrations/__init__.py
Normal file
0
www/conservancy/apps/assignment/migrations/__init__.py
Normal file
28
www/conservancy/apps/assignment/models.py
Normal file
28
www/conservancy/apps/assignment/models.py
Normal 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'
|
||||||
|
)
|
8
www/conservancy/apps/assignment/urls.py
Normal file
8
www/conservancy/apps/assignment/urls.py
Normal 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'),
|
||||||
|
]
|
18
www/conservancy/apps/assignment/views.py
Normal file
18
www/conservancy/apps/assignment/views.py
Normal 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',
|
||||||
|
]
|
|
@ -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')),
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue