Commit 50c08a32 by Bridger Maxwell

Added setting for disabling SelectWidgetBootstrap.

parent 3576a2dc
...@@ -81,6 +81,7 @@ else: ...@@ -81,6 +81,7 @@ else:
# children and for instance that an article can be safely deleted. # children and for instance that an article can be safely deleted.
SHOW_MAX_CHILDREN = getattr(django_settings, 'WIKI_SHOW_MAX_CHILDREN', 20) SHOW_MAX_CHILDREN = getattr(django_settings, 'WIKI_SHOW_MAX_CHILDREN', 20)
USE_BOOTSTRAP_SELECT_WIDGET = getattr(django_settings, 'WIKI_USE_BOOTSTRAP_SELECT_WIDGET', True)
#################### ####################
# PLANNED SETTINGS # # PLANNED SETTINGS #
......
...@@ -260,8 +260,10 @@ class PermissionsForm(PluginSettingsFormMixin, forms.ModelForm): ...@@ -260,8 +260,10 @@ class PermissionsForm(PluginSettingsFormMixin, forms.ModelForm):
owner_username = forms.CharField(required=False, label=_(u'Owner'), owner_username = forms.CharField(required=False, label=_(u'Owner'),
help_text=_(u'Enter the username of the owner.')) help_text=_(u'Enter the username of the owner.'))
group = forms.ModelChoiceField(models.Group.objects.all(), widget=SelectWidgetBootstrap(), group = forms.ModelChoiceField(models.Group.objects.all(), empty_label=_(u'(none)'),
empty_label=_(u'(none)'), required=False) required=False)
if settings.USE_BOOTSTRAP_SELECT_WIDGET:
group.widget= SelectWidgetBootstrap()
recursive = forms.BooleanField(label=_(u'Inherit permissions'), help_text=_(u'Check here to apply the above permissions recursively to articles under this one.'), recursive = forms.BooleanField(label=_(u'Inherit permissions'), help_text=_(u'Check here to apply the above permissions recursively to articles under this one.'),
required=False) required=False)
...@@ -283,6 +285,7 @@ class PermissionsForm(PluginSettingsFormMixin, forms.ModelForm): ...@@ -283,6 +285,7 @@ class PermissionsForm(PluginSettingsFormMixin, forms.ModelForm):
self.can_change_groups = False self.can_change_groups = False
self.can_assign = False self.can_assign = False
print "checking can_assing", permissions.can_assign(article, request.user), request.user.is_staff
if permissions.can_assign(article, request.user): if permissions.can_assign(article, request.user):
self.can_assign = True self.can_assign = True
self.fields['group'].queryset = models.Group.objects.all() self.fields['group'].queryset = models.Group.objects.all()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment