Remove MultiItemForm
Remove the HTML based MultiItemForm and use a Bootstrap dropdown menu for the bulk actions list. Add a text message explaining that items must be selected in other to activate the bulk action menu. Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django import forms
|
||||
|
||||
|
||||
class MultiItemForm(forms.Form):
|
||||
def __init__(self, *args, **kwargs):
|
||||
actions = kwargs.pop('actions', [])
|
||||
if actions:
|
||||
actions.insert(0, ['', '---'])
|
||||
|
||||
super(MultiItemForm, self).__init__(*args, **kwargs)
|
||||
|
||||
self.fields['action'].choices = actions
|
||||
|
||||
action = forms.ChoiceField(
|
||||
label='', required=False, widget=forms.widgets.Select(
|
||||
attrs={'class': 'select-auto-submit'}
|
||||
)
|
||||
)
|
||||
@@ -3,7 +3,6 @@ from __future__ import unicode_literals
|
||||
from django.template import Library
|
||||
|
||||
from ..classes import Link, Menu, SourceColumn
|
||||
from ..forms import MultiItemForm
|
||||
|
||||
register = Library()
|
||||
|
||||
@@ -35,18 +34,6 @@ def get_menus_links(context, names, source=None, sort_results=None):
|
||||
return result
|
||||
|
||||
|
||||
@register.simple_tag(takes_context=True)
|
||||
def get_multi_item_links_form(context, object_list):
|
||||
actions = []
|
||||
for link_set in Menu.get(name='multi item').resolve(context=context, source=object_list[0], sort_results=True):
|
||||
for link in link_set:
|
||||
actions.append((link.url, link.text))
|
||||
|
||||
form = MultiItemForm(actions=actions)
|
||||
context.update({'multi_item_form': form, 'multi_item_actions': actions})
|
||||
return ''
|
||||
|
||||
|
||||
@register.simple_tag(takes_context=True)
|
||||
def get_sort_field_querystring(context, column):
|
||||
return column.get_sort_field_querystring(context=context)
|
||||
|
||||
Reference in New Issue
Block a user