Skip to content

Commit

Permalink
chore: interim commit on survey
Browse files Browse the repository at this point in the history
  • Loading branch information
erictheise committed Mar 25, 2020
1 parent afd80d9 commit 404cb9b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
14 changes: 9 additions & 5 deletions surveys/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,20 @@ class Meta:
'middle_name',
'last_name',
'email',
'role'
]


class RoleForm(ModelForm):
class Meta:
model = User
fields = [
'role',
]
labels = {
'role': _('Are you a…'),
}
widgets = {
'role': RadioSelect()
'role': RadioSelect(attrs={ 'class': 'radio' })
}


Expand Down Expand Up @@ -51,6 +58,3 @@ class Meta:
'url': TextInput(attrs={'placeholder': 'e.g., https://example.coop/'}),
'founded': DateTimeInput(format="%d/%m/%Y", attrs={'placeholder':"DD/MM/YY"})
}



8 changes: 8 additions & 0 deletions surveys/templates/surveys/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ <h3>Do you need funding for your cooperative digital project?</h3>
<p>Please provide the contact information for the best person to reach out to should we have follow-up questions about the answers you have provided to the short form of our survey. This contact information will not be part of the index. It will not be published online.</p>
<div class="spacer"></div>
{{ user_form }}
<ul class="input-group">
{% for radio in role_form.role %}
<li>{{ radio.tag }}
<label for="{{ radio.id_for_label }}">{{ radio.choice_label }}</label>
</li>
{% endfor %}
</ul>

</fieldset>

<div class="spacer"></div>
Expand Down
4 changes: 3 additions & 1 deletion surveys/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from django.template import loader
from django.shortcuts import get_object_or_404, render

from .forms import UserForm, OrganizationForm
from .forms import UserForm, RoleForm, OrganizationForm

from accounts.models import User
from mdi.models import Organization, Category, Sector, Type
Expand All @@ -16,9 +16,11 @@ def index(request):

else:
user_form = UserForm()
role_form = RoleForm()
organization_form = OrganizationForm()

return render(request, 'surveys/index.html', {
'user_form': user_form,
'role_form': role_form,
'organization_form': organization_form,
})

0 comments on commit 404cb9b

Please sign in to comment.