Задать вопрос

Тел: +7 965 3737 888

436

Просмотров

3

Ответов

Admin actions as buttons instead of a menu

Add this to any admin changelist and your actions drop-down will be replaced with user-friendly buttons.

Why mess around with templates and subclassing admin classes when you can just mangle the page with jQuery! ;-)

It also adds a 'select all' label to explain the mystery top check-box (well it was a mystery to several of my clients).

The line "if ($('div.actions option:gt(0)').length<=8)" checks that there aren't more than 8 actions and falls back to the drop-down if there are.

Requires jQuery to be loaded.

Вопрос полезен? Да0/Нет0
file_3618.js(867.0б)
None

Ответы (3):

Ответhellboy:11.01.2011
Ответ полезен? Да0/Нет0

How can I use it in my projects?

{% extends "admin/change_list.html" %} {% block extrahead %} [HTML_REMOVED][HTML_REMOVED] [HTML_REMOVED][HTML_REMOVED] [HTML_REMOVED] [HTML_REMOVED][HTML_REMOVED] {% endblock %}

and?

how to call fix_actions?

Ответandybak:26.02.2010
Ответ полезен? Да0/Нет0

I could but trying the code would take you less time than it will take me to upload a screenshot ;-)

Ответdavid_bgk:20.02.2010
Ответ полезен? Да0/Нет0

Looks interesting! Can you provide a screenshot of this feature?