class SWIntegrityForm(ModelForm):

    BOOL_CHOICES = [("Yes", "Yes"), ("No", "No")]

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.fields['q1'].label = False
        self.fields['q2'].label = False
        self.fields['q3'].label = False
        self.fields['q4'].label = False
        self.fields['q5'].label = False
        self.helper.layout = Layout(
            InlineRadios('q1'),
            InlineRadios('q2'),
            InlineRadios('q3'),
            InlineRadios('q4'),
            InlineRadios('q5'),
        )

    q1 = forms.ChoiceField(
        choices=BOOL_CHOICES,
        widget=RadioSelectButtonGroup(),
        label="Software Integrity Question 1",
    )
    q2 = forms.ChoiceField(
        choices=BOOL_CHOICES,
        widget=RadioSelectButtonGroup(),
        label="Software Integrity Question 2",
    )
    q3 = forms.ChoiceField(
        choices=BOOL_CHOICES,
        widget=RadioSelectButtonGroup(),
        label="Software Integrity Question 3",
    )
    q4 = forms.ChoiceField(
        choices=BOOL_CHOICES,
        widget=RadioSelectButtonGroup(),
        label="Software Integrity Question 4",
    )
    q5 = forms.ChoiceField(
        choices=BOOL_CHOICES,
        widget=RadioSelectButtonGroup(),
        label="Software Integrity Question 5",
    )

    class Meta:
        model = SWIntegrity
        fields = "__all__"
        exclude = ["score", "max_score", "eval_score"]
        widgets = {
            "comment":
            forms.Textarea(attrs={
                'class': 'form-control',
                'placeholder': 'Add Comment'
            }),
            "vend_has_perm":
            forms.CheckboxInput(),
        }
class SecMatEvidenceForm(ModelForm):

    BOOL_CHOICES = [("Yes", "Yes"), ("No", "No")]

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.fields['attst_o_comp'].label = False
        self.fields['soc2_reports'].label = False
        self.fields['ann_pen_scan_results'].label = False
        self.fields['ann_wa_vuln_scan'].label = False
        self.helper.layout = Layout(
            InlineRadios('attst_o_comp'),
            InlineRadios('soc2_reports'),
            InlineRadios('ann_pen_scan_results'),
            InlineRadios('ann_wa_vuln_scan'),
        )

    attst_o_comp = forms.ChoiceField(
        choices=BOOL_CHOICES,
        widget=RadioSelectButtonGroup(),
        label="Attestation of Compliance",
    )
    soc2_reports = forms.ChoiceField(
        choices=BOOL_CHOICES,
        widget=RadioSelectButtonGroup(),
        label="Current system’s vendor 3rd party SOC2 Type 2 reports",
    )
    ann_pen_scan_results = forms.ChoiceField(
        choices=BOOL_CHOICES,
        widget=RadioSelectButtonGroup(),
        label=
        "Annual penetration/vulnerability scanning results of all system components",
    )
    ann_wa_vuln_scan = forms.ChoiceField(
        choices=BOOL_CHOICES,
        widget=RadioSelectButtonGroup(),
        label=
        "Annual web application vulnerability scan of all system web applications",
    )

    class Meta:
        model = SecMatEvidence
        fields = "__all__"
        exclude = ["score", "max_score", "eval_score"]
        widgets = {
            "comment":
            forms.Textarea(attrs={
                'class': 'form-control',
                'placeholder': 'Add Comment'
            }),
            "vend_has_perm":
            forms.CheckboxInput(),
        }
class CloudServiceForm(ModelForm):

    BOOL_CHOICES = [("Yes", "Yes"), ("No", "No")]

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.fields['saas_sol'].label = False
        self.fields['iaas_hosted'].label = False
        self.fields['on_prem'].label = False
        self.helper.layout = Layout(
            InlineRadios('saas_sol'),
            InlineRadios('iaas_hosted'),
            InlineRadios('on_prem'),
        )

    saas_sol = forms.ChoiceField(
        choices=BOOL_CHOICES,
        widget=RadioSelectButtonGroup(),
        label="Is this a SaaS solution?",
    )
    iaas_hosted = forms.ChoiceField(
        choices=BOOL_CHOICES,
        widget=RadioSelectButtonGroup(),
        label="Is it hosted in IaaS owned by the Company?",
    )
    on_prem = forms.ChoiceField(
        choices=BOOL_CHOICES,
        widget=RadioSelectButtonGroup(),
        label="Is the solution built on premises in the Company's datacenter?",
    )

    class Meta:
        model = CloudService
        fields = "__all__"
        exclude = ["score", "max_score", "eval_score"]
        widgets = {
            "comment":
            forms.Textarea(attrs={
                'class': 'form-control',
                'placeholder': 'Add Comment'
            }),
            "vend_has_perm":
            forms.CheckboxInput(),
        }
class IntegrationForm(ModelForm):

    BOOL_CHOICES = [("Yes", "Yes"), ("No", "No")]

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.fields['sso'].label = False
        self.fields['mfa'].label = False
        self.fields['adfs'].label = False
        self.helper.layout = Layout(
            InlineRadios('sso'),
            InlineRadios('mfa'),
            InlineRadios('adfs'),
        )

    sso = forms.ChoiceField(
        choices=BOOL_CHOICES,
        widget=RadioSelectButtonGroup(),
        label="Single Sign-on",
    )
    mfa = forms.ChoiceField(
        choices=BOOL_CHOICES,
        widget=RadioSelectButtonGroup(),
        label="Multi-Factor Authentication",
    )
    adfs = forms.ChoiceField(
        choices=BOOL_CHOICES,
        widget=RadioSelectButtonGroup(),
        label="Active Directory Federation Services",
    )

    class Meta:
        model = Integration
        fields = "__all__"
        exclude = ["score", "max_score", "eval_score"]
        widgets = {
            "comment":
            forms.Textarea(attrs={
                'class': 'form-control',
                'placeholder': 'Add Comment'
            }),
            "vend_has_perm":
            forms.CheckboxInput(),
        }
class ComplianceForm(ModelForm):

    BOOL_CHOICES = [("Yes", "Yes"), ("No", "No")]

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.fields['sso'].label = False
        self.fields['audit_req_std_comp'].label = False
        self.fields['auto_patch'].label = False
        self.helper.layout = Layout(
            InlineRadios('sso'),
            InlineRadios('audit_req_std_comp'),
            InlineRadios('auto_patch'),
        )

    sso = forms.ChoiceField(
        choices=BOOL_CHOICES,
        widget=RadioSelectButtonGroup(),
        label="Single Sign-on Systems?",
    )
    audit_req_std_comp = forms.ChoiceField(
        choices=BOOL_CHOICES,
        widget=RadioSelectButtonGroup(),
        label="Company System Audit Requirements Standard Compliant?",
    )
    auto_patch = forms.ChoiceField(
        choices=BOOL_CHOICES,
        widget=RadioSelectButtonGroup(),
        label="Vendor Provides automated patching?",
    )

    class Meta:
        model = Compliance
        fields = "__all__"
        exclude = ["score", "max_score", "eval_score"]
        widgets = {
            "comment":
            forms.Textarea(attrs={
                'class': 'form-control',
                'placeholder': 'Add Comment'
            }),
            "vend_has_perm":
            forms.CheckboxInput(),
        }
class EncryptionForm(ModelForm):

    BOOL_CHOICES = [("Yes", "Yes"), ("No", "No")]

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.fields['p1q1'].label = False
        self.fields['p1q2'].label = False
        self.fields['p1q3'].label = False
        self.fields['p1q4'].label = False
        self.fields['p1q5'].label = False
        self.fields['p1q6'].label = False
        self.fields['p1q7'].label = False
        self.fields['p1q8'].label = False
        self.fields['p1q9'].label = False
        self.fields['p2q1'].label = False
        self.fields['p2q2'].label = False
        self.fields['p2q3'].label = False
        self.fields['p2q4'].label = False
        self.fields['p2q5'].label = False
        self.fields['p2q6'].label = False
        self.fields['p2q7'].label = False
        self.helper.layout = Layout(
            InlineRadios('p1q1'),
            InlineRadios('p1q2'),
            InlineRadios('p1q3'),
            InlineRadios('p1q4'),
            InlineRadios('p1q5'),
            InlineRadios('p1q6'),
            InlineRadios('p1q7'),
            InlineRadios('p1q8'),
            InlineRadios('p1q9'),
            InlineRadios('p2q1'),
            InlineRadios('p2q2'),
            InlineRadios('p2q3'),
            InlineRadios('p2q4'),
            InlineRadios('p2q5'),
            InlineRadios('p2q6'),
            InlineRadios('p2q7'),
        )

    p1q1 = forms.ChoiceField(
        choices=BOOL_CHOICES,
        widget=RadioSelectButtonGroup(),
        label="Encryption Part 1 - Question 1",
    )
    p1q2 = forms.ChoiceField(
        choices=BOOL_CHOICES,
        widget=RadioSelectButtonGroup(),
        label="Encryption Part 1 - Question 2",
    )
    p1q3 = forms.ChoiceField(
        choices=BOOL_CHOICES,
        widget=RadioSelectButtonGroup(),
        label="Encryption Part 1 - Question 3",
    )
    p1q4 = forms.ChoiceField(
        choices=BOOL_CHOICES,
        widget=RadioSelectButtonGroup(),
        label="Encryption Part 1 - Question 4",
    )
    p1q5 = forms.ChoiceField(
        choices=BOOL_CHOICES,
        widget=RadioSelectButtonGroup(),
        label="Encryption Part 1 - Question 5",
    )
    p1q6 = forms.ChoiceField(
        choices=BOOL_CHOICES,
        widget=RadioSelectButtonGroup(),
        label="Encryption Part 1 - Question 6",
    )
    p1q7 = forms.ChoiceField(
        choices=BOOL_CHOICES,
        widget=RadioSelectButtonGroup(),
        label="Encryption Part 1 - Question 7",
    )
    p1q8 = forms.ChoiceField(
        choices=BOOL_CHOICES,
        widget=RadioSelectButtonGroup(),
        label="Encryption Part 1 - Question 8",
    )
    p1q9 = forms.ChoiceField(
        choices=BOOL_CHOICES,
        widget=RadioSelectButtonGroup(),
        label="Encryption Part 1 - Question 9",
    )
    p2q1 = forms.ChoiceField(
        choices=BOOL_CHOICES,
        widget=RadioSelectButtonGroup(),
        label="Encryption Part 2 - Question 1",
    )
    p2q2 = forms.ChoiceField(
        choices=BOOL_CHOICES,
        widget=RadioSelectButtonGroup(),
        label="Encryption Part 2 - Question 2",
    )
    p2q3 = forms.ChoiceField(
        choices=BOOL_CHOICES,
        widget=RadioSelectButtonGroup(),
        label="Encryption Part 2 - Question 3",
    )
    p2q4 = forms.ChoiceField(
        choices=BOOL_CHOICES,
        widget=RadioSelectButtonGroup(),
        label="Encryption Part 2 - Question 4",
    )
    p2q5 = forms.ChoiceField(
        choices=BOOL_CHOICES,
        widget=RadioSelectButtonGroup(),
        label="Encryption Part 2 - Question 5",
    )
    p2q6 = forms.ChoiceField(
        choices=BOOL_CHOICES,
        widget=RadioSelectButtonGroup(),
        label="Encryption Part 2 - Question 6",
    )
    p2q7 = forms.ChoiceField(
        choices=BOOL_CHOICES,
        widget=RadioSelectButtonGroup(),
        label="Encryption Part 2 - Question 7",
    )

    class Meta:
        model = Encryption
        fields = "__all__"
        exclude = ["score", "max_score", "eval_score"]
        widgets = {
            "comment":
            forms.Textarea(attrs={
                'class': 'form-control',
                'placeholder': 'Add Comment'
            }),
            "vend_has_perm":
            forms.CheckboxInput(),
        }