Improve access grant and remove action form
Sort content type list of the access grant and remove action. Use select2 for the content type filed of the access grant and remove action. Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -290,6 +290,9 @@
|
||||
* Sort events list in the transition trigger view.
|
||||
* Add support for form media to DynamicFormMixin.
|
||||
* Fix tag attach and remove action form media.
|
||||
* Sort content type list of the access grant and remove action.
|
||||
* Use select2 for the content type filed of the access
|
||||
grant and remove action.
|
||||
|
||||
3.1.11 (2019-04-XX)
|
||||
===================
|
||||
|
||||
@@ -719,7 +719,9 @@ Other changes
|
||||
- Sort events list in the transition trigger view.
|
||||
- Add support for form media to DynamicFormMixin.
|
||||
- Fix tag attach and remove action form media.
|
||||
|
||||
- Sort content type list of the access grant and remove action.
|
||||
- Use select2 for the content type filed of the access
|
||||
grant and remove action.
|
||||
|
||||
Removals
|
||||
--------
|
||||
|
||||
@@ -58,6 +58,11 @@ class GrantAccessAction(WorkflowAction):
|
||||
field_order = ('content_type', 'object_id', 'roles', 'permissions')
|
||||
label = _('Grant access')
|
||||
widgets = {
|
||||
'content_type': {
|
||||
'class': 'django.forms.widgets.Select', 'kwargs': {
|
||||
'attrs': {'class': 'select2'},
|
||||
}
|
||||
},
|
||||
'roles': {
|
||||
'class': 'django.forms.widgets.SelectMultiple', 'kwargs': {
|
||||
'attrs': {'class': 'select2'},
|
||||
@@ -97,7 +102,9 @@ class GrantAccessAction(WorkflowAction):
|
||||
return form_data
|
||||
|
||||
def get_form_schema(self, *args, **kwargs):
|
||||
self.fields['content_type']['kwargs']['queryset'] = ModelPermission.get_classes(as_content_type=True)
|
||||
self.fields['content_type']['kwargs']['queryset'] = ModelPermission.get_classes(
|
||||
as_content_type=True
|
||||
).order_by('model')
|
||||
self.fields['permissions']['kwargs']['choices'] = Permission.all(
|
||||
as_choices=True
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user