示例#1
0
def export_licence_questions(request,
                             application_type,
                             goodstype_category=None):
    forms = [export_type_form()]

    if application_type == CaseTypes.OIEL:
        forms.append(goodstype_category_form())

    if application_type != CaseTypes.OGEL and goodstype_category not in [
            "media", "cryptographic"
    ]:
        forms.append(export_permanency_form(application_type))

    if application_type != CaseTypes.OGEL:
        forms.append(reference_name_form())

    if application_type == CaseTypes.SIEL:
        forms.append(told_by_an_official_form())

    if goodstype_category in [
            GoodsTypeCategory.MILITARY, GoodsTypeCategory.UK_CONTINENTAL_SHELF
    ]:
        forms.append(firearms_form())

    return FormGroup(forms)
示例#2
0
 def init(self, request, **kwargs):
     self.object_pk = kwargs["pk"]
     self.data = get_application(request, self.object_pk)
     self.form = reference_name_form(self.object_pk)
     self.action = put_application
     self.success_url = reverse_lazy("applications:task_list",
                                     kwargs={"pk": self.object_pk})
示例#3
0
def trade_control_licence_questions(request):
    return FormGroup([
        application_type_form(),
        *conditional(
            request.POST.get("application_type") != CaseTypes.OGTCL,
            [
                reference_name_form(),
                activity_form(request),
                product_category_form(request)
            ],
            [],
        ),
    ])
示例#4
0
def MOD_questions(application_type=None):
    return FormGroup([
        Form(
            title=MODQuestions.WhatAreYouApplyingFor.TITLE,
            description=MODQuestions.WhatAreYouApplyingFor.DESCRIPTION,
            questions=[
                RadioButtons(
                    name="application_type",
                    options=[
                        Option(
                            key=CaseTypes.F680,
                            value=MODQuestions.WhatAreYouApplyingFor.
                            PERMISSION_TITLE,
                            description=MODQuestions.WhatAreYouApplyingFor.
                            PERMISSION_DESCRIPTION,
                        ),
                        Option(
                            key=CaseTypes.EXHC,
                            value=MODQuestions.WhatAreYouApplyingFor.
                            EXHIBITION_CLEARANCE_TITLE,
                            description=MODQuestions.WhatAreYouApplyingFor.
                            EXHIBITION_CLEARANCE_DESCRIPTION,
                        ),
                        Option(
                            key=CaseTypes.GIFT,
                            value=MODQuestions.WhatAreYouApplyingFor.
                            GIFTING_CLEARANCE_TITLE,
                            description=MODQuestions.WhatAreYouApplyingFor.
                            GIFTING_CLEARANCE_DESCRIPTION,
                        ),
                    ],
                ),
            ],
            default_button_name=generic.CONTINUE,
            back_link=BackLink(MODQuestions.WhatAreYouApplyingFor.BACK,
                               reverse("apply_for_a_licence:start")),
        ),
        conditional(
            application_type == CaseTypes.F680,
            Form(
                title=MODQuestions.ConfirmationStatement.TITLE,
                questions=[
                    Label(paragraph) for paragraph in
                    MODQuestions.ConfirmationStatement.DESCRIPTION.split("\n")
                ],
                default_button_name=generic.CONFIRM_AND_CONTINUE,
            ),
        ),
        reference_name_form(),
    ])
示例#5
0
def transhipment_questions(request):
    return FormGroup([
        Form(
            title=TranshipmentQuestions.TranshipmentLicenceQuestion.TITLE,
            description=TranshipmentQuestions.TranshipmentLicenceQuestion.
            DESCRIPTION,
            questions=[
                RadioButtons(
                    name="application_type",
                    options=[
                        Option(
                            key=CaseTypes.OGTL,
                            value=TranshipmentQuestions.
                            TranshipmentLicenceQuestion.
                            OPEN_GENERAL_TRANSHIPMENT_LICENCE,
                            description=TranshipmentQuestions.
                            TranshipmentLicenceQuestion.
                            OPEN_GENERAL_TRANSHIPMENT_LICENCE_DESCRIPTION,
                        ),
                        Option(
                            key=CaseTypes.SITL,
                            value=TranshipmentQuestions.
                            TranshipmentLicenceQuestion.STANDARD_LICENCE,
                            description=TranshipmentQuestions.
                            TranshipmentLicenceQuestion.
                            STANDARD_LICENCE_DESCRIPTION,
                        ),
                    ],
                ),
            ],
            default_button_name=generic.CONTINUE,
            back_link=BackLink(
                TranshipmentQuestions.TranshipmentLicenceQuestion.BACK,
                reverse("apply_for_a_licence:start")),
        ),
        *conditional(
            request.POST.get("application_type") != CaseTypes.OGTL,
            [reference_name_form(),
             told_by_an_official_form()],
            [],
        ),
    ])
示例#6
0
def application_copy_form(application_type=None):
    return FormGroup(forms=[
        reference_name_form(),
        conditional((
            application_type == STANDARD), told_by_an_official_form()),
    ])