class SellingOnlineOverseasBusinessDetails(forms.Form): TURNOVER_OPTIONS = ( ('Under 100k', 'Under £100,000'), ('100k-500k', '£100,000 to £500,000'), ('500k-2m', '£500,001 and £2million'), ('2m+', 'More than £2million'), ) turnover = fields.ChoiceField( label='Turnover last year', help_text=( 'You may use 12 months rolling or last year\'s annual turnover.'), choices=TURNOVER_OPTIONS, widget=widgets.RadioSelect(), ) sku_count = IntegerField( label='How many stock keeping units (SKUs) do you have?', help_text=( 'A stock keeping unit is an individual item, such as a product ' 'or a service that is offered for sale.')) trademarked = TypedChoiceField( label='Are your products trademarked in your target countries?', help_text=( 'Some marketplaces will only sell products that are trademarked.'), label_suffix='', coerce=lambda x: x == 'True', choices=[(True, 'Yes'), (False, 'No')], widget=widgets.RadioSelect(), required=False, )
class RadioForm(PrefixIdMixin, forms.Form): radio = fields.ChoiceField(label='Q1: Radio select', label_suffix='', help_text='Some help text.', widget=widgets.RadioSelect( use_nice_ids=True, attrs={'id': 'radio-one'}), choices=( (True, 'Yes'), (False, 'No'), )) radio_group = fields.ChoiceField( label='Q2: Radio select with option groups', label_suffix='', help_text='Some help text.', widget=widgets.RadioSelect(use_nice_ids=True, attrs={'id': 'radio-two'}), choices=( ('Colours', ( ('red', 'Red'), ('green', 'Green'), ('blue', 'Blue'), )), ('Numbers', ( ('4', 'Four'), ('5', 'Five'), ('6', 'Six'), )), ))
class BaseShortForm(forms.Form): comment = fields.CharField( label='Please give us as much detail as you can', widget=Textarea, validators=anti_phising_validators) given_name = fields.CharField( label='First name', validators=anti_phising_validators, ) family_name = fields.CharField(label='Last name', validators=anti_phising_validators) email = fields.EmailField() company_type = fields.ChoiceField( label_suffix='', widget=widgets.RadioSelect(), choices=COMPANY_TYPE_CHOICES, ) company_type_other = fields.ChoiceField( label='Type of organisation', label_suffix='', choices=(('', 'Please select'), ) + COMPANY_TYPE_OTHER_CHOICES, required=False, ) organisation_name = fields.CharField(validators=anti_phising_validators) postcode = fields.CharField(validators=anti_phising_validators) captcha = ReCaptchaField( label='', label_suffix='', ) terms_agreed = fields.BooleanField(label=TERMS_LABEL)
class InternationalContactForm(SerializeDataMixin, GovNotifyActionMixin, forms.Form): ORGANISATION_TYPE_CHOICES = ( ('COMPANY', 'Company'), ('OTHER', 'Other type of organisation'), ) given_name = fields.CharField(validators=anti_phising_validators) family_name = fields.CharField(validators=anti_phising_validators) email = fields.EmailField(label='Email address') organisation_type = fields.ChoiceField(label_suffix='', widget=widgets.RadioSelect(), choices=ORGANISATION_TYPE_CHOICES) organisation_name = fields.CharField( label='Your organisation name', validators=anti_phising_validators, ) country_name = fields.ChoiceField(choices=[('', 'Please select')] + choices.COUNTRY_CHOICES, ) city = fields.CharField(label='City', validators=anti_phising_validators) comment = fields.CharField(label='Tell us how we can help', widget=Textarea, validators=anti_phising_validators) captcha = ReCaptchaField( label='', label_suffix='', ) terms_agreed = fields.BooleanField(label=TERMS_LABEL)
class LocationRoutingForm(forms.Form): CHOICES = ( (constants.DOMESTIC, 'The UK'), (constants.INTERNATIONAL, 'Outside the UK'), ) choice = fields.ChoiceField( label='', widget=widgets.RadioSelect(), choices=CHOICES, )
class InternationalRoutingForm(EuExitOptionFeatureFlagMixin, forms.Form): CHOICES = ( (constants.INVESTING, 'Investing in the UK'), (constants.BUYING, 'Find a UK business partner'), (constants.EUEXIT, 'EU exit enquiries'), # possibly removed by mixin (constants.OTHER, 'Other'), ) choice = fields.ChoiceField( label='', widget=widgets.RadioSelect(), choices=CHOICES, # possibly updated by mixin )
class ExportOpportunitiesRoutingForm(forms.Form): CHOICES = ( (constants.NO_RESPONSE, 'I haven\'t had a response from the opportunity I applied for'), (constants.ALERTS, 'My daily alerts are not relevant to me'), (constants.OTHER, 'Other'), ) choice = fields.ChoiceField( label='', widget=widgets.RadioSelect(), choices=CHOICES, )
class GreatServicesRoutingForm(forms.Form): CHOICES = ( (constants.EXPORT_OPPORTUNITIES, 'Export opportunities service'), (constants.GREAT_ACCOUNT, 'Your account on great.gov.uk'), (constants.OTHER, 'Other'), ) choice = fields.ChoiceField( label='', widget=widgets.RadioSelect(), choices=CHOICES, )
class AboutForm(forms.Form): error_css_class = 'input-field-container has-error' CATEGORY_CHOICES = ('I’m an exporter or I want to export', 'I work for a trade association', 'Other') firstname = fields.CharField( label='First name', error_messages={'required': 'Enter your first name'}) lastname = fields.CharField( label='Last name', error_messages={'required': 'Enter your last name'}) jobtitle = fields.CharField( label='Job title', error_messages={'required': 'Enter your job title'}) categories = fields.ChoiceField( label='Business type', widget=widgets.RadioSelect( attrs={'id': 'checkbox-single'}, use_nice_ids=True, ), choices=((choice, choice) for choice in CATEGORY_CHOICES), error_messages={'required': 'Tell us your business type'}) organisation_description = fields.CharField( label='Tell us about your organisation', widget=TextInput(attrs={'class': 'js-field-other'}), required=False) company_name = fields.CharField( label='Business or organisation name', error_messages={ 'required': 'Enter your business or organisation name' }) email = fields.EmailField( label='Email address', error_messages={'required': 'Enter your email address'}) phone = fields.CharField( label='Telephone number', error_messages={'required': 'Enter your telephone number'}) def clean(self): data = self.cleaned_data description = data.get('organisation_description') categories = data.get('categories') if categories == 'Other' and not description: self.add_error('organisation_description', 'Enter your organisation') else: return data
class BusinessDetailsForm(forms.Form): TURNOVER_OPTIONS = (('', 'Please select'), ('0-25k', 'under £25,000'), ('25k-100k', '£25,000 - £100,000'), ('100k-1m', '£100,000 - £1,000,000'), ('1m-5m', '£1,000,000 - £5,000,000'), ('5m-25m', '£5,000,000 - £25,000,000'), ('25m-50m', '£25,000,000 - £50,000,000'), ('50m+', '£50,000,000+')) company_type = fields.ChoiceField( label_suffix='', widget=widgets.RadioSelect(), choices=COMPANY_TYPE_CHOICES, ) companies_house_number = fields.CharField( label='Companies House number', required=False, ) company_type_other = fields.ChoiceField( label_suffix='', choices=(('', 'Please select'), ) + COMPANY_TYPE_OTHER_CHOICES, required=False, ) organisation_name = fields.CharField(validators=anti_phising_validators) postcode = fields.CharField(validators=anti_phising_validators) industry = fields.ChoiceField(choices=INDUSTRY_CHOICES, ) industry_other = fields.CharField( label='Type in your industry', widget=TextInput(attrs={'class': 'js-field-other'}), required=False, ) turnover = fields.ChoiceField( label='Annual turnover (optional)', choices=TURNOVER_OPTIONS, required=False, ) employees = fields.ChoiceField( label='Number of employees (optional)', choices=(('', 'Please select'), ) + choices.EMPLOYEES, required=False, ) captcha = ReCaptchaField( label='', label_suffix='', ) terms_agreed = fields.BooleanField(label=TERMS_LABEL)
class DomesticContactForm(FieldsMutationMixin, SerializeMixin, ZendeskActionMixin, forms.Form): first_name = fields.CharField() last_name = fields.CharField() email = fields.EmailField() organisation_type = fields.ChoiceField(label_suffix='', widget=widgets.RadioSelect(), choices=COMPANY_CHOICES) company_name = fields.CharField() comment = fields.CharField(widget=Textarea, validators=[no_html, not_contains_url_or_email]) captcha = ReCaptchaField( label='', label_suffix='', ) terms_agreed = fields.BooleanField(label=TERMS_LABEL)
class DomesticRoutingForm(EuExitOptionFeatureFlagMixin, forms.Form): CHOICES = ( (constants.TRADE_OFFICE, 'Find your local trade office'), (constants.EXPORT_ADVICE, 'Advice to export from the UK'), (constants.GREAT_SERVICES, 'great.gov.uk account and services support'), (constants.FINANCE, 'UK Export Finance (UKEF)'), (constants.EUEXIT, 'EU exit enquiries'), # possibly removed by mixin (constants.EVENTS, 'Events'), (constants.DSO, 'Defence and Security Organisation (DSO)'), (constants.OTHER, 'Other'), ) choice = fields.ChoiceField( label='', widget=widgets.RadioSelect(), choices=CHOICES, # possibly update by mixin )
class CurrentStatusForm(forms.Form): error_css_class = 'input-field-container has-error' STATUS_CHOICES = ( (1, 'My perishable goods or livestock are blocked in transit'), (2, 'I’m at immediate risk of missing a commercial opportunity'), (3, 'I’m at immediate risk of not fulfilling a contract'), (4, 'I need resolution quickly, but I’m not at immediate risk of loss'), ) status = fields.ChoiceField( label='Select which option best applies to you', widget=widgets.RadioSelect(use_nice_ids=True, attrs={'id': 'radio-one'}), choices=STATUS_CHOICES, error_messages={ 'required': 'Choose the option that best describes your situation' })
class BusinessType(forms.Form): CHOICES = ( (constants.COMPANIES_HOUSE_COMPANY, ('My business is registered with Companies House. ' 'For example, a limited company (Ltd), a public limited ' 'company (PLC) or a Royal Charter company')), (constants.SOLE_TRADER, ('I\'m a sole trader or I represent another type of UK ' 'business not registered with Companies House')), (constants.NOT_COMPANY, ('I\'m a UK taxpayer but do not represent a business')), (constants.OVERSEAS_COMPANY, ('My business or organisation is not registered in the UK')), ) choice = fields.ChoiceField( label='', widget=widgets.RadioSelect(), choices=CHOICES, )
class SellingOnlineOverseasExperience(forms.Form): EXPERIENCE_OPTIONS = (('Not yet', 'Not yet'), ('Yes, sometimes', 'Yes, sometimes'), ('Yes, regularly', 'Yes, regularly')) experience = fields.ChoiceField( label='Have you sold products online to customers outside the UK?', choices=EXPERIENCE_OPTIONS, widget=widgets.RadioSelect(), ) description = fields.CharField( label='Pitch your business to this marketplace', help_text=( 'Your pitch is important and the information you provide may be ' 'used to introduce you to the marketplace. You could describe ' 'your business, including your products, your customers and ' 'how you market your products in a few paragraphs.'), widget=Textarea, validators=anti_phising_validators)
class GreatAccountRoutingForm(NewUserRegOptionFeatureFlagMixin, forms.Form): CHOICES = ( (constants.NO_VERIFICATION_EMAIL, 'I have not received my email confirmation'), (constants.PASSWORD_RESET, 'I need to reset my password'), ( constants.COMPANY_NOT_FOUND, # possibly update by mixin 'I cannot find my company'), (constants.COMPANIES_HOUSE_LOGIN, 'My Companies House login is not working'), (constants.VERIFICATION_CODE, 'I do not know where to enter my verification code'), (constants.NO_VERIFICATION_LETTER, 'I have not received my letter containing the verification code'), (constants.OTHER, 'Other'), ) choice = fields.ChoiceField( label='', widget=widgets.RadioSelect(), choices=CHOICES, )
class InternationalContactForm(FieldsMutationMixin, SerializeMixin, ZendeskActionMixin, forms.Form): first_name = fields.CharField() last_name = fields.CharField() email = fields.EmailField() organisation_type = fields.ChoiceField( label_suffix='', widget=widgets.RadioSelect(), choices=COMPANY_CHOICES, ) company_name = fields.CharField() country = fields.ChoiceField( choices=[('', 'Please select')] + choices.COUNTRY_CHOICES, widget=Select(attrs={'id': 'js-country-select'}), ) city = fields.CharField() comment = fields.CharField(widget=Textarea, validators=[no_html, not_contains_url_or_email]) captcha = ReCaptchaField( label='', label_suffix='', ) terms_agreed = fields.BooleanField(label=TERMS_LABEL)
class DemoFormErrors(PrefixIdMixin, forms.Form): text_field1 = fields.CharField(label='Simple text field', help_text='Some help text', required=True) checkbox1 = fields.BooleanField( label='Label text', required=True, help_text=('Some help text.'), widget=widgets.CheckboxWithInlineLabel(attrs={'id': 'checkbox-one'})) multiple_choice = fields.MultipleChoiceField( label='Multiple choice checkboxes', required=True, help_text='Some help text.', widget=widgets.CheckboxSelectInlineLabelMultiple( attrs={'id': 'checkbox-multiple'}, use_nice_ids=True, ), choices=( ('red', 'Red'), ('green', 'Green'), ('blue', 'Blue'), ), ) radio = fields.ChoiceField(label='Radio select', required=True, label_suffix='', help_text='Some help text.', widget=widgets.RadioSelect( use_nice_ids=True, attrs={'id': 'radio-one'}), choices=( (True, 'Yes'), (False, 'No'), ))
class ProblemDetailsForm(forms.Form): # Country choices is a list of tuples that follow the structure # (country_code, country_name). We don't want this # structure because the choice needs to always be human # readable for the summary and zendesk. This creates a new # tuple that makes tuples with the same value. def change_country_tuples(country_list): return [(country_name, country_name) for country_code, country_name in country_list] error_css_class = 'input-field-container has-error' product_service = fields.CharField( label='What goods or services do you want to export?', help_text='Or tell us about an investment you want to make', error_messages={ 'required': 'Tell us what you’re \ trying to export or invest in' }) country = fields.ChoiceField( label='Which country do you want to export to?', choices=[('', 'Select a country')] + change_country_tuples(choices.COUNTRY_CHOICES), widget=Select(attrs={'id': 'js-country-select'}), error_messages={ 'required': 'Select the country you’re trying to export to' }) problem_summary = fields.CharField( label=mark_safe('<p>Tell us about your problem, including: </p> \ <ul class="list list-bullet"> \ <li>what’s affecting your export or investment</li> \ <li>when you became aware of the problem</li> \ <li>how you became aware of the problem</li> \ <li>if it’s a one off</li> \ <li> \ any information you’ve been given or \ correspondence you’ve had \ </li> \ <li> \ the HS (Harmonized System) code for your goods, \ if you know it \ </li> \ </ul>'), widget=Textarea, error_messages={'required': 'Tell us about the barrier you’re facing'}) impact = fields.CharField( label='How has the problem affected your business?', widget=Textarea, error_messages={ 'required': 'Tell us how your business is being affected by the \ barrier' }) resolve_summary = fields.CharField( label=mark_safe('<p>Tell us about any steps you’ve taken \ to resolve the problem, including: </p> \ <ul class="list list-bullet"> \ <li>people you’ve contacted</li> \ <li>when you contacted them</li> \ <li>what happened</li> \ </ul>'), widget=Textarea, error_messages={ 'required': 'Tell us what you’ve done to resolve your \ problem, even if this is your first step' }) eu_exit_related = fields.ChoiceField( label='Is your problem caused by or related to EU Exit?', widget=widgets.RadioSelect(use_nice_ids=True, attrs={'id': 'radio-one'}), choices=(('Yes', 'Yes'), ('No', 'No')), error_messages={ 'required': 'Tell us if your problem is related to EU Exit' })
class ContactCompanyForm(GovNotifyActionMixin, forms.Form): TERMS_CONDITIONS_LABEL = ( '<p>I agree to the great.gov.uk terms and conditions and I ' 'understand that:</p>' '<ul class="list list-bullet">' '<li>the Department for International Trade (DIT) has reasonably ' 'tried to ensure that businesses listed in the UK Investment Support ' 'Directory are appropriately qualified and that the information in ' 'this directory is accurate and up to date</li>' '<li>DIT is not endorsing the character, ability, goods or services ' 'of members of the directory</li>' '<li>there is no legal relationship between DIT and directory ' 'members</li>' '<li>DIT is not liable for any direct or indirect loss or damage that ' 'might happen after a directory member provides a good or service</li>' '<li>directory members will give 1 hour’s free consultation to ' 'businesses that contact them through this service</li>' '</ul>') TERMS_CONDITIONS_MESSAGE = ( 'Tick the box to confirm you agree to the terms and conditions.') given_name = fields.CharField( label='Given name', max_length=255, validators=[not_contains_url_or_email], ) family_name = fields.CharField( label='Family name', max_length=255, validators=[not_contains_url_or_email], ) company_name = fields.CharField( label='Your organisation name', max_length=255, validators=[not_contains_url_or_email], ) email_address = fields.EmailField(label='Email address', ) sector = fields.ChoiceField( label='Industry', choices=([['', 'Please select your industry']] + list(choices.INDUSTRIES)), ) subject = fields.CharField( label='Enter a subject line for your message', max_length=200, validators=[not_contains_url_or_email], ) body = fields.CharField( label='Enter your message to the UK company', help_text='Maximum 1000 characters.', max_length=1000, widget=Textarea, validators=[not_contains_url_or_email], ) has_contact = fields.ChoiceField(label=( 'Do you currently have a contact at Department of international ' 'trade'), widget=widgets.RadioSelect( use_nice_ids=True, attrs={'id': 'radio-one'}), choices=( (True, 'Yes'), (False, 'No'), )) terms = fields.BooleanField( label=mark_safe(TERMS_CONDITIONS_LABEL), error_messages={'required': TERMS_CONDITIONS_MESSAGE}, ) captcha = ReCaptchaField(label='')