Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bulk actions in admin but no checkboxes #76

Open
cdvv7788 opened this issue Jun 1, 2015 · 4 comments
Open

Bulk actions in admin but no checkboxes #76

cdvv7788 opened this issue Jun 1, 2015 · 4 comments

Comments

@cdvv7788
Copy link

cdvv7788 commented Jun 1, 2015

There are 2 actions in admin for the pages: publish and delete...however there is no way to select them currently.

@bashu
Copy link
Member

bashu commented Jun 2, 2015

+1

@vdboor
Copy link
Contributor

vdboor commented Jun 4, 2015

Agreed, and thanks for drawing attention to it.

Ideally, I would like to see django-polymorphic-tree (which provides this part) to support this. It could seriously use a different JavaScript logic for this, so it can also handle partial pages (e.g. pagination, search results) better. This is an area where some help or input would be really welcome!

Right now the checkboxes were removed because it was nearly impossible to get them properly aligned while keeping an tree indent. With other/newer JavaScript tree plugins that would probably be easier to get sorted out.

cc django-polymorphic/django-polymorphic-tree#2 django-polymorphic/django-polymorphic-tree#3 #10

@sunjoomoon
Copy link

Any tip we could get inspiration from feincms' tree ? Gave that a try and seems at least page tree with checkbox seem quite stable and works as expected. Not sure what packages are used though.

@Kurdakov
Copy link

Kurdakov commented Jul 21, 2016

In fact checkboxes could be added to the right the same way as it is done in \polymorphic_tree\admin\parentadmin.py

actions.append(
u''.format(title=_('Select to delete or activate'),
id=node.pk, static=settings.STATIC_URL)
)
now
in change list ( \polymorphic_tree\templates\admin\polymorphic_tree\change_list.html ) I tried to add following code

{% block extrahead %}
{{ block.super }}
{{ media.js }}

<script type="text/javascript"> (function($) { $(document).ready(function($) { $("li input.action-select").actions(); }); })(django.jQuery); </script>

{% endblock %}

see li input.action-select instead of tr input.action-select in standard django change-list

now - there is need to get standard actions.js and change it so that during click does not focus wrong parent element and put this modified actions.js somewhere,
otherwise it works ok
for formatting issues it seems it is better to have 'grayed' world icon - so that checkboxes are aligned on the right

the remaining issue - to add checkbox with action-toggle class to the header ( I looked in templates - headers are rendered in for loop -so adding 'select all' checkbox for the last column is not such convenient ( but I hope possible - maybe if in template? and then render additional checkbox with action-toggle class )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants