示例#1
0
def clearance_level_form(application_id, options):
    return Form(
        title=ClearanceLevel.TITLE,
        description=ClearanceLevel.DESCRIPTION,
        questions=[RadioButtons(name="clearance_level", options=options)],
        back_link=back_to_task_list(application_id),
    )
示例#2
0
def told_by_an_official_form(application_id=None):
    return Form(
        title=ExportLicenceQuestions.HaveYouBeenInformedQuestion.TITLE,
        description=ExportLicenceQuestions.HaveYouBeenInformedQuestion.
        DESCRIPTION,
        questions=[
            RadioButtons(
                name="have_you_been_informed",
                options=[
                    Option(
                        key="yes",
                        value=strings.YES,
                        components=[
                            TextInput(
                                title=ExportLicenceQuestions.
                                HaveYouBeenInformedQuestion.
                                WHAT_WAS_THE_REFERENCE_CODE_TITLE,
                                description=ExportLicenceQuestions.
                                HaveYouBeenInformedQuestion.
                                WHAT_WAS_THE_REFERENCE_CODE_DESCRIPTION,
                                name="reference_number_on_information_form",
                                optional=True,
                            ),
                        ],
                    ),
                    Option(key="no", value=strings.NO),
                ],
            ),
        ],
        back_link=back_to_task_list(application_id),
        default_button_name=conditional(application_id,
                                        generic.SAVE_AND_RETURN,
                                        generic.CONTINUE),
    )
示例#3
0
def query_explanation_form(application_id):
    return Form(
        title=strings.Hmrc.QueryExplanation.TITLE,
        questions=[
            TextArea(name="reasoning",
                     optional=True,
                     extras={
                         "max_length": 1000,
                     })
        ],
        default_button_name=strings.Hmrc.QueryExplanation.BUTTON_TEXT,
        back_link=back_to_task_list(application_id),
    )
示例#4
0
def reference_name_form(application_id=None):
    return Form(
        title=applications.InitialApplicationQuestionsForms.
        ReferenceNameQuestion.TITLE,
        description=applications.InitialApplicationQuestionsForms.
        ReferenceNameQuestion.DESCRIPTION,
        questions=[
            TextInput(name="name"),
        ],
        back_link=back_to_task_list(application_id),
        default_button_name=conditional(application_id,
                                        generic.SAVE_AND_RETURN,
                                        generic.CONTINUE),
    )
def f680_details_form(request, application_id):
    return Form(
        title=F680Details.TITLE,
        description=F680Details.DESCRIPTION,
        questions=[
            Checkboxes(
                name="types[]",
                options=[
                    Option(key, value) for key, value in
                    get_f680_clearance_types(request).items()
                ],
            ),
        ],
        default_button_name=F680Details.BUTTON,
        back_link=back_to_task_list(application_id),
    )
def countries_form(request, application_id):
    return Form(
        title=strings.applications.DestinationForm.TITLE,
        description=strings.applications.DestinationForm.DESCRIPTION,
        questions=[
            Filter(),
            Checkboxes(
                name="countries[]",
                options=get_countries(request, True, ["GB"]),
                classes=["govuk-checkboxes--small"],
                show_select_links=True,
                filterable=True,
            ),
        ],
        default_button_name=strings.SAVE_AND_CONTINUE,
        back_link=back_to_task_list(application_id),
    )
示例#7
0
def firearms_form(application_id=None):
    return Form(
        title=applications.GoodsCategories.TITLE,
        description=applications.GoodsCategories.DESCRIPTION,
        questions=[
            RadioButtons(
                name="contains_firearm_goods",
                options=[
                    Option(key="True", value=strings.YES),
                    Option(key="False", value=strings.NO),
                ],
            ),
        ],
        back_link=back_to_task_list(application_id),
        default_button_name=conditional(application_id,
                                        generic.SAVE_AND_RETURN,
                                        generic.CONTINUE),
    )
def which_location_form(application_id, application_type):
    return Form(
        title=goods.GoodsLocationForm.WHERE_ARE_YOUR_GOODS_LOCATED_TITLE,
        description=goods.GoodsLocationForm.
        WHERE_ARE_YOUR_GOODS_LOCATED_DESCRIPTION,
        questions=[
            RadioButtons(
                "choice",
                [
                    Option(
                        key=Locations.ORGANISATION,
                        value=goods.GoodsLocationForm.
                        ONE_OF_MY_REGISTERED_SITES,
                        description=goods.GoodsLocationForm.
                        NOT_AT_MY_REGISTERED_SITES_DESCRIPTION,
                    ),
                    Option(
                        key=Locations.EXTERNAL,
                        value=goods.GoodsLocationForm.
                        NOT_AT_MY_REGISTERED_SITES,
                        description=goods.GoodsLocationForm.
                        NOT_AT_MY_REGISTERED_SITES_DESCRIPTION,
                    ),
                    conditional(
                        application_type == HMRC,
                        Option(
                            key=Locations.DEPARTED,
                            value=goods.GoodsLocationForm.DEPARTED_THE_COUNTRY,
                            description=goods.GoodsLocationForm.
                            DEPARTED_THE_COUNTRY_DESCRIPTION,
                            show_or=True,
                        ),
                    ),
                ],
            )
        ],
        default_button_name=strings.CONTINUE,
        back_link=back_to_task_list(application_id),
    )