# Path: crispy_forms_foundation/layout/base.py
# class HTML(crispy_forms_layout.HTML):
#     pass
# 
# Path: crispy_forms_foundation/layout/fields.py
# class InlineSwitchField(InlineField):
#     """
#     Like ``SwitchField`` it use Foundation form switches with checkbox field
#     but within an ``InlineField``
# 
#     Contrary to ``SwitchField`` this play nice with the label to be able to
#     display it (as Foundation form switches default behavior is to hide the
#     label text)
# 
#     Example:
# 
#     .. sourcecode:: python
# 
#         InlineSwitchField('field_name')
# 
#     Or:
# 
#     .. sourcecode:: python
# 
#         InlineSwitchField('field_name', label_column='large-8',
#                           input_column='large-4', label_class='',
#                           switch_class="inline")
# 
#     ``label_column``, ``input_column``, ``label_class``, ``switch_class`` are
#     optional argument.
#     """
#     template = "%s/inline_switch.html"
# 
#     def __init__(self, field, *args, **kwargs):
#         self.switch_class = ['switch']+kwargs.pop('switch_class', '').split()
#         kwargs['label_column'] = kwargs.pop('label_column', 'large-8')
#         kwargs['input_column'] = kwargs.pop('input_column', 'large-4')
#         kwargs['class'] = (kwargs.pop('class', '') + ' switch-input').strip()
# 
#         super(InlineSwitchField, self).__init__(field, *args, **kwargs)
# 
#     def render(self, form, form_style, context, template_pack=TEMPLATE_PACK):
#         context['switch_class'] = " ".join(self.switch_class)
#         return super(InlineSwitchField, self).render(form, form_style, context,
#                                                      template_pack)
# 
# Path: crispy_forms_foundation/layout/buttons.py
# class Submit(InputSubmit):
#     """
#     This is the old Button object that inherit from ``InputSubmit`` for
#     backward compatibility.
# 
#     If you want to stand for an input button, you are invited to use
#     ``InputSubmit`` instead to avoid problem when ``ButtonSubmit`` will
#     become the new ``Submit`` object.
#     """
#     pass


from copy import deepcopy
from django import forms
from django.forms.fields import FileField, ImageField
from django.utils.translation import gettext_lazy as _
from django.urls import reverse, NoReverseMatch
from crispy_forms.helper import FormHelper
from .layout import Submit, HTML, InlineSwitchField

        if self.title:
            html = HTML(self.title_templatestring.format(self.title))
            self.helper.layout.insert(0, html)

        if self.form_id is not None:
            self.helper.form_id = self.form_id

        self.helper.form_class = self.classes
        self.helper.form_method = self.method
        self.helper.form_error_title = self.error_title
        self.helper.attrs = self.attrs

        if self.switches:
            # Get a list of all fields with their location within the layout
            layout_field_names = self.helper.layout.get_field_names()
            # Transform checkbox fields to switches element
            for pointer in layout_field_names:
                if isinstance(self.fields[pointer[1]].widget,
                              forms.CheckboxInput):
                    field = InlineSwitchField(pointer[1],
                                              switch_class="inline")
                    self.replace_layout_object(pointer[0], field)

        if self.submit:
            if isinstance(self.submit, Submit):
                self.helper.add_input(self.submit)
            elif isinstance(self.submit, str):
                self.helper.add_input(Submit('submit', self.submit))
            else:

# Path: crispy_forms_foundation/layout/base.py
# class HTML(crispy_forms_layout.HTML):
#     pass
# 
# Path: crispy_forms_foundation/layout/fields.py
# class InlineSwitchField(InlineField):
#     """
#     Like ``SwitchField`` it use Foundation form switches with checkbox field
#     but within an ``InlineField``
# 
#     Contrary to ``SwitchField`` this play nice with the label to be able to
#     display it (as Foundation form switches default behavior is to hide the
#     label text)
# 
#     Example:
# 
#     .. sourcecode:: python
# 
#         InlineSwitchField('field_name')
# 
#     Or:
# 
#     .. sourcecode:: python
# 
#         InlineSwitchField('field_name', label_column='large-8',
#                           input_column='large-4', label_class='',
#                           switch_class="inline")
# 
#     ``label_column``, ``input_column``, ``label_class``, ``switch_class`` are
#     optional argument.
#     """
#     template = "%s/inline_switch.html"
# 
#     def __init__(self, field, *args, **kwargs):
#         self.switch_class = ['switch']+kwargs.pop('switch_class', '').split()
#         kwargs['label_column'] = kwargs.pop('label_column', 'large-8')
#         kwargs['input_column'] = kwargs.pop('input_column', 'large-4')
#         kwargs['class'] = (kwargs.pop('class', '') + ' switch-input').strip()
# 
#         super(InlineSwitchField, self).__init__(field, *args, **kwargs)
# 
#     def render(self, form, form_style, context, template_pack=TEMPLATE_PACK):
#         context['switch_class'] = " ".join(self.switch_class)
#         return super(InlineSwitchField, self).render(form, form_style, context,
#                                                      template_pack)
# 
# Path: crispy_forms_foundation/layout/buttons.py
# class Submit(InputSubmit):
#     """
#     This is the old Button object that inherit from ``InputSubmit`` for
#     backward compatibility.
# 
#     If you want to stand for an input button, you are invited to use
#     ``InputSubmit`` instead to avoid problem when ``ButtonSubmit`` will
#     become the new ``Submit`` object.
#     """
#     pass


# Path: crispy_forms_foundation/forms.py
from copy import deepcopy
from django import forms
from django.forms.fields import FileField, ImageField
from django.utils.translation import gettext_lazy as _
from django.urls import reverse, NoReverseMatch
from crispy_forms.helper import FormHelper
from .layout import Submit, HTML, InlineSwitchField


        if self.title:
            html = HTML(self.title_templatestring.format(self.title))
            self.helper.layout.insert(0, html)

        if self.form_id is not None:
            self.helper.form_id = self.form_id

        self.helper.form_class = self.classes
        self.helper.form_method = self.method
        self.helper.form_error_title = self.error_title
        self.helper.attrs = self.attrs

        if self.switches:
            # Get a list of all fields with their location within the layout
            layout_field_names = self.helper.layout.get_field_names()
            # Transform checkbox fields to switches element
            for pointer in layout_field_names:
                if isinstance(self.fields[pointer[1]].widget,
                              forms.CheckboxInput):
                    field = InlineSwitchField(pointer[1],
                                              switch_class="inline")
                    self.replace_layout_object(pointer[0], field)

        if self.submit:
            if isinstance(self.submit, Submit):
                self.helper.add_input(self.submit)
            elif isinstance(self.submit, str):
                self.helper.add_input(Submit('submit', self.submit))
            else:

                self.helper.add_input(Submit('submit', _("Submit")))