@@ -0,0 +1,1476 @@
+from django import forms%0Afrom django.utils.translation import ugettext_noop as _%0A%0Afrom crispy_forms import layout as crispy%0Afrom crispy_forms.bootstrap import FormActions%0Afrom crispy_forms.helper import FormHelper%0A%0Afrom corehq.apps.app_manager.models import get_apps_in_domain%0A%0A%0Aclass CreateNewReportBuilderForm(forms.Form):%0A    report_type = forms.ChoiceField(%0A        choices=%5B%0A            ('bar_chart', _(%22Bar Chart%22)),%0A            ('pie_chart', _(%22Pie Chart%22)),%0A            ('table', _(%22Table%22)),%0A        %5D,%0A    )%0A%0A    report_source = forms.ChoiceField()%0A%0A    def __init__(self, domain, *args, **kwargs):%0A        super(CreateNewReportBuilderForm, self).__init__(*args, **kwargs)%0A%0A        apps = get_apps_in_domain(domain, full=True, include_remote=False)%0A        self.fields%5B'report_source'%5D.choices = %5B%0A            (c, c) for c in%0A            set(%5Bcase_type for app in apps for case_type in app.get_case_types() if case_type%5D)%0A        %5D%0A%0A        self.helper = FormHelper()%0A        self.helper.form_class = %22form-horizontal%22%0A        self.helper.layout = crispy.Layout(%0A            crispy.Fieldset(%0A                _('Create New Report'),%0A                'report_type',%0A                'report_source',%0A            ),%0A            FormActions(%0A                crispy.ButtonHolder(%0A                    crispy.Submit(%0A                        'create_new_report_builder_btn',%0A                        _('Next'),%0A                    )%0A                ),%0A            ),%0A        )%0A

add create new report form class