forked from CGM_Public/pretix_original
Update django-bootstrap3 requirement from ==23.1.* to ==23.6 (#3894)
* Update django-bootstrap3 requirement from ==23.1.* to ==23.6 Removing our previous workarounds * Fix import
This commit is contained in:
+1
-1
@@ -37,7 +37,7 @@ dependencies = [
|
|||||||
"defusedcsv>=1.1.0",
|
"defusedcsv>=1.1.0",
|
||||||
"dj-static",
|
"dj-static",
|
||||||
"Django==4.2.*",
|
"Django==4.2.*",
|
||||||
"django-bootstrap3==23.1.*",
|
"django-bootstrap3==23.6.*",
|
||||||
"django-compressor==4.4",
|
"django-compressor==4.4",
|
||||||
"django-countries==7.5.*",
|
"django-countries==7.5.*",
|
||||||
"django-filter==23.5",
|
"django-filter==23.5",
|
||||||
|
|||||||
@@ -1,63 +0,0 @@
|
|||||||
#
|
|
||||||
# This file is part of pretix (Community Edition).
|
|
||||||
#
|
|
||||||
# Copyright (C) 2014-2020 Raphael Michel and contributors
|
|
||||||
# Copyright (C) 2020-2021 rami.io GmbH and contributors
|
|
||||||
#
|
|
||||||
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
|
|
||||||
# Public License as published by the Free Software Foundation in version 3 of the License.
|
|
||||||
#
|
|
||||||
# ADDITIONAL TERMS APPLY: Pursuant to Section 7 of the GNU Affero General Public License, additional terms are
|
|
||||||
# applicable granting you additional permissions and placing additional restrictions on your usage of this software.
|
|
||||||
# Please refer to the pretix LICENSE file to obtain the full terms applicable to this work. If you did not receive
|
|
||||||
# this file, see <https://pretix.eu/about/en/license>.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
|
|
||||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
||||||
# details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU Affero General Public License along with this program. If not, see
|
|
||||||
# <https://www.gnu.org/licenses/>.
|
|
||||||
#
|
|
||||||
from bootstrap3.renderers import (
|
|
||||||
FieldRenderer as BaseFieldRenderer,
|
|
||||||
InlineFieldRenderer as BaseInlineFieldRenderer,
|
|
||||||
)
|
|
||||||
from django.forms import (
|
|
||||||
CheckboxInput, CheckboxSelectMultiple, ClearableFileInput, RadioSelect,
|
|
||||||
SelectDateWidget,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class FieldRenderer(BaseFieldRenderer):
|
|
||||||
# Local application of https://github.com/zostera/django-bootstrap3/pull/859
|
|
||||||
|
|
||||||
def post_widget_render(self, html):
|
|
||||||
if isinstance(self.widget, CheckboxSelectMultiple):
|
|
||||||
html = self.list_to_class(html, "checkbox")
|
|
||||||
elif isinstance(self.widget, RadioSelect):
|
|
||||||
html = self.list_to_class(html, "radio")
|
|
||||||
elif isinstance(self.widget, SelectDateWidget):
|
|
||||||
html = self.fix_date_select_input(html)
|
|
||||||
elif isinstance(self.widget, ClearableFileInput):
|
|
||||||
html = self.fix_clearable_file_input(html)
|
|
||||||
elif isinstance(self.widget, CheckboxInput):
|
|
||||||
html = self.put_inside_label(html)
|
|
||||||
return html
|
|
||||||
|
|
||||||
|
|
||||||
class InlineFieldRenderer(BaseInlineFieldRenderer):
|
|
||||||
# Local application of https://github.com/zostera/django-bootstrap3/pull/859
|
|
||||||
|
|
||||||
def post_widget_render(self, html):
|
|
||||||
if isinstance(self.widget, CheckboxSelectMultiple):
|
|
||||||
html = self.list_to_class(html, "checkbox")
|
|
||||||
elif isinstance(self.widget, RadioSelect):
|
|
||||||
html = self.list_to_class(html, "radio")
|
|
||||||
elif isinstance(self.widget, SelectDateWidget):
|
|
||||||
html = self.fix_date_select_input(html)
|
|
||||||
elif isinstance(self.widget, ClearableFileInput):
|
|
||||||
html = self.fix_clearable_file_input(html)
|
|
||||||
elif isinstance(self.widget, CheckboxInput):
|
|
||||||
html = self.put_inside_label(html)
|
|
||||||
return html
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
{# this is the version from django 3.x, prior to https://github.com/django/django/commit/5942ab5eb165ee2e759174e297148a40dd855920 so that django-bootstrap3 can keep doing its magic #}
|
|
||||||
{% with id=widget.attrs.id %}<ul{% if id %} id="{{ id }}"{% endif %}{% if widget.attrs.class %} class="{{ widget.attrs.class }}"{% endif %}>{% for group, options, index in widget.optgroups %}{% if group %}
|
|
||||||
<li>{{ group }}<ul{% if id %} id="{{ id }}_{{ index }}"{% endif %}>{% endif %}{% for option in options %}
|
|
||||||
<li>{% include option.template_name with widget=option %}</li>{% endfor %}{% if group %}
|
|
||||||
</ul></li>{% endif %}{% endfor %}
|
|
||||||
</ul>{% endwith %}
|
|
||||||
@@ -19,6 +19,7 @@
|
|||||||
# You should have received a copy of the GNU Affero General Public License along with this program. If not, see
|
# You should have received a copy of the GNU Affero General Public License along with this program. If not, see
|
||||||
# <https://www.gnu.org/licenses/>.
|
# <https://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
|
from bootstrap3.renderers import FieldRenderer, InlineFieldRenderer
|
||||||
from bootstrap3.text import text_value
|
from bootstrap3.text import text_value
|
||||||
from django.forms import CheckboxInput, CheckboxSelectMultiple, RadioSelect
|
from django.forms import CheckboxInput, CheckboxSelectMultiple, RadioSelect
|
||||||
from django.forms.utils import flatatt
|
from django.forms.utils import flatatt
|
||||||
@@ -27,8 +28,6 @@ from django.utils.safestring import mark_safe
|
|||||||
from django.utils.translation import pgettext
|
from django.utils.translation import pgettext
|
||||||
from i18nfield.forms import I18nFormField
|
from i18nfield.forms import I18nFormField
|
||||||
|
|
||||||
from pretix.base.forms.renderers import FieldRenderer, InlineFieldRenderer
|
|
||||||
|
|
||||||
|
|
||||||
def render_label(content, label_for=None, label_class=None, label_title='', label_id='', optional=False):
|
def render_label(content, label_for=None, label_class=None, label_title='', label_id='', optional=False):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
# You should have received a copy of the GNU Affero General Public License along with this program. If not, see
|
# You should have received a copy of the GNU Affero General Public License along with this program. If not, see
|
||||||
# <https://www.gnu.org/licenses/>.
|
# <https://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
|
from bootstrap3.renderers import FieldRenderer
|
||||||
from bootstrap3.text import text_value
|
from bootstrap3.text import text_value
|
||||||
from bootstrap3.utils import add_css_class
|
from bootstrap3.utils import add_css_class
|
||||||
from django.forms import CheckboxInput, CheckboxSelectMultiple, RadioSelect
|
from django.forms import CheckboxInput, CheckboxSelectMultiple, RadioSelect
|
||||||
@@ -27,8 +28,6 @@ from django.utils.html import escape, format_html, strip_tags
|
|||||||
from django.utils.safestring import mark_safe
|
from django.utils.safestring import mark_safe
|
||||||
from django.utils.translation import pgettext
|
from django.utils.translation import pgettext
|
||||||
|
|
||||||
from pretix.base.forms.renderers import FieldRenderer
|
|
||||||
|
|
||||||
|
|
||||||
def render_label(content, label_for=None, label_class=None, label_title='', label_id='', optional=False, is_valid=None, attrs=None):
|
def render_label(content, label_for=None, label_class=None, label_title='', label_id='', optional=False, is_valid=None, attrs=None):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -683,8 +683,8 @@ CELERY_TASK_ROUTES = ([
|
|||||||
BOOTSTRAP3 = {
|
BOOTSTRAP3 = {
|
||||||
'success_css_class': '',
|
'success_css_class': '',
|
||||||
'field_renderers': {
|
'field_renderers': {
|
||||||
'default': 'pretix.base.forms.renderers.FieldRenderer',
|
'default': 'bootstrap3.renderers.FieldRenderer',
|
||||||
'inline': 'pretix.base.forms.renderers.InlineFieldRenderer',
|
'inline': 'bootstrap3.renderers.InlineFieldRenderer',
|
||||||
'control': 'pretix.control.forms.renderers.ControlFieldRenderer',
|
'control': 'pretix.control.forms.renderers.ControlFieldRenderer',
|
||||||
'control_with_visibility': 'pretix.control.forms.renderers.ControlFieldWithVisibilityRenderer',
|
'control_with_visibility': 'pretix.control.forms.renderers.ControlFieldWithVisibilityRenderer',
|
||||||
'bulkedit': 'pretix.control.forms.renderers.BulkEditFieldRenderer',
|
'bulkedit': 'pretix.control.forms.renderers.BulkEditFieldRenderer',
|
||||||
|
|||||||
Reference in New Issue
Block a user