Add contact fields. Closes #30.
This commit is contained in:
@ -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',
|
||||
|
46
apps/map/migrations/0044_auto_20180331.py
Normal file
46
apps/map/migrations/0044_auto_20180331.py
Normal 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'),
|
||||
),
|
||||
]
|
@ -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(
|
||||
|
Reference in New Issue
Block a user