Add contact fields. Closes #30.

This commit is contained in:
Anna Sidwell 2018-03-31 16:29:25 +11:00
parent 5bf1855974
commit 4147dc7d32
4 changed files with 90 additions and 4 deletions

View File

@ -177,8 +177,7 @@ class LongCaseStudyForm(BaseCaseStudyForm):
'wants_conversation_with_ojuso',
css_id="negative_case_questions"
),
Fieldset(
_("Common Questions"),
Div(
'key_actors_involved',
css_id="common_questions"
),
@ -187,6 +186,19 @@ class LongCaseStudyForm(BaseCaseStudyForm):
HTML("<a class='btn btn-primary btnNext pull-right'>"+_("Next")+"</a>")
)
),
Tab(
_("Contact details"),
'contact_email',
'contact_phone',
'contact_website',
PrependedText('contact_twitter', '@', placeholder='username'),
'contact_facebook',
'contact_other',
FormActions(
HTML("<a class='btn btn-primary btnPrevious'>"+_("Previous")+"</a>"),
HTML("<a class='btn btn-primary btnNext pull-right'>"+_("Next")+"</a>")
)
),
Tab(
_("Uploads"),
'official_project_documents',

View File

@ -0,0 +1,46 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2018-03-31 04:59
from __future__ import unicode_literals
from django.db import migrations, models
import phonenumber_field.modelfields
class Migration(migrations.Migration):
dependencies = [
('map', '0043_auto_20180329_1044'),
]
operations = [
migrations.AddField(
model_name='casestudy',
name='contact_email',
field=models.EmailField(blank=True, max_length=254, verbose_name='Email address'),
),
migrations.AddField(
model_name='casestudy',
name='contact_facebook',
field=models.URLField(blank=True, verbose_name='Facebook page'),
),
migrations.AddField(
model_name='casestudy',
name='contact_other',
field=models.TextField(blank=True, verbose_name='Other contact details'),
),
migrations.AddField(
model_name='casestudy',
name='contact_phone',
field=phonenumber_field.modelfields.PhoneNumberField(blank=True, max_length=128, verbose_name='Phone number'),
),
migrations.AddField(
model_name='casestudy',
name='contact_twitter',
field=models.CharField(blank=True, max_length=50, verbose_name='Twitter username'),
),
migrations.AddField(
model_name='casestudy',
name='contact_website',
field=models.URLField(blank=True, verbose_name='Website'),
),
]

View File

@ -7,6 +7,8 @@ from django_countries.fields import CountryField
from django.utils.translation import ugettext as _
from django.template.defaultfilters import slugify
from multiselectfield import MultiSelectField
from phonenumber_field.modelfields import PhoneNumberField
from . import validators
@ -815,16 +817,42 @@ class CaseStudy(models.Model):
)
# 3.1.7.1 + 3.2.8.1
contact_email = models.EmailField(
verbose_name=_('Email address'),
blank=True
)
# 3.1.7.2 + 3.2.8.1
contact_phone = PhoneNumberField(
verbose_name=_('Phone number'),
help_text=_('Please include the international prefix, beginning with "+".'),
blank=True
)
# 3.1.7.3 + 3.2.8.1
contact_website = models.URLField(
verbose_name=_('Website'),
blank=True
)
# 3.1.7.4 + 3.2.8.1
contact_twitter = models.CharField(
verbose_name=_('Twitter username'),
max_length=50,
blank=True
)
# 3.1.7.5 + 3.2.8.1
contact_facebook = models.URLField(
verbose_name=_('Facebook page'),
blank=True
)
# 3.1.7.6 + 3.2.8.1
contact_other = models.TextField(
verbose_name=_('Other contact details'),
blank=True
)
# 3.2.1
negative_case_reasons = MultiSelectField(

View File

@ -14,10 +14,10 @@ django-crispy-forms==1.6.1
django-envelope==1.3
django-extensions==1.7.9
django-geojson==2.10.0
#django-leaflet==0.22.0
-e git://github.com/makinacorpus/django-leaflet.git@a43acc5fed6674b413a6fab0feeb7c44e67c2ca8#egg=django-leaflet
django-leaflet==0.23.0
django-multiselectfield==0.1.8
django-multiupload==0.5.2
django-phonenumber-field==2.0.0
django-registration-redux==1.6
django-storages==1.6.5
djangorestframework==3.6.3