Bumped version to 1.5.5.
Fixed namespacing of so sorting urls. Changed namespacing of sortable() calls. Removed unit test to check for javascript include template, which has been eliminated.master
parent
1bf917da61
commit
8f64f6ea76
15
README.md
15
README.md
|
|
@ -4,9 +4,6 @@ This project makes it easy to add drag-and-drop ordering to any model in
|
||||||
Django admin. Inlines for a sortable model may also be made sortable,
|
Django admin. Inlines for a sortable model may also be made sortable,
|
||||||
enabling individual items or groups of items to be sortable.
|
enabling individual items or groups of items to be sortable.
|
||||||
|
|
||||||
## Requirements
|
|
||||||
jQuery
|
|
||||||
|
|
||||||
## Supported Django Versions
|
## Supported Django Versions
|
||||||
If you're using Django 1.4.x, use django-admin-sortable 1.4.9 or below.
|
If you're using Django 1.4.x, use django-admin-sortable 1.4.9 or below.
|
||||||
For Django 1.5.x, use the latest version of django-admin-sortable.
|
For Django 1.5.x, use the latest version of django-admin-sortable.
|
||||||
|
|
@ -231,18 +228,14 @@ ordering on top of that just seemed a little much in my opinion.
|
||||||
django-admin-sortable is currently used in production.
|
django-admin-sortable is currently used in production.
|
||||||
|
|
||||||
|
|
||||||
### What's new in 1.5.4?
|
### What's new in 1.5.5?
|
||||||
- Eliminated loading jQuery and jQueryUI from external CDNs.
|
- Improved url resolution to sorting urls
|
||||||
- All jQuery-based JavaScript code now leverages the django.jQuery namespace and version of jQuery included in Django Admin.
|
- Fixed a potential issue with JavaScript namespace on sortable() calls that could prevent sortable from working in environments where jQuery is already included, such as Django-CMS
|
||||||
- Eliminated needing to include jQueryUI effects core to do highlighting on drag complete.
|
|
||||||
- Added CSRF protection to sort views (thanks @dokterbob)
|
|
||||||
- Static includes now leverage {% static %} template tag.
|
|
||||||
|
|
||||||
|
|
||||||
### Future
|
### Future
|
||||||
- Support for foreign keys that are self referential
|
- Support for foreign keys that are self referential
|
||||||
- More unit tests
|
- Move unit tests out of sample project (I could really use some help with this one)
|
||||||
- Move unit tests out of sample project
|
|
||||||
- Travis CI integration
|
- Travis CI integration
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
VERSION = (1, 5, 4) # following PEP 386
|
VERSION = (1, 5, 5) # following PEP 386
|
||||||
DEV_N = None
|
DEV_N = None
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
(function($){
|
(function($){
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
$('.sortable').sortable({
|
jQuery('.sortable').sortable({
|
||||||
axis : 'y',
|
axis : 'y',
|
||||||
containment : 'parent',
|
containment : 'parent',
|
||||||
tolerance : 'pointer',
|
tolerance : 'pointer',
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
var sortable_inline_rows = $('.inline-group .inline-related');
|
var sortable_inline_rows = $('.inline-group .inline-related');
|
||||||
sortable_inline_rows.addClass('sortable');
|
sortable_inline_rows.addClass('sortable');
|
||||||
|
|
||||||
$('.inline-group').sortable({
|
jQuery('.inline-group').sortable({
|
||||||
axis : 'y',
|
axis : 'y',
|
||||||
containment : 'parent',
|
containment : 'parent',
|
||||||
create: function(event, ui) {
|
create: function(event, ui) {
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
{
|
{
|
||||||
var tabular_inline_rows = $('.tabular table tbody tr');
|
var tabular_inline_rows = $('.tabular table tbody tr');
|
||||||
tabular_inline_rows.addClass('sortable');
|
tabular_inline_rows.addClass('sortable');
|
||||||
$('.tabular.inline-related').sortable({
|
jQuery('.tabular.inline-related').sortable({
|
||||||
axis : 'y',
|
axis : 'y',
|
||||||
containment : 'parent',
|
containment : 'parent',
|
||||||
create: function(event, ui)
|
create: function(event, ui)
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
{% if inline_admin_form.has_auto_field %}{{ inline_admin_form.pk_field.field }}{% endif %}
|
{% if inline_admin_form.has_auto_field %}{{ inline_admin_form.pk_field.field }}{% endif %}
|
||||||
{{ inline_admin_form.fk_field.field }}
|
{{ inline_admin_form.fk_field.field }}
|
||||||
{% if inline_admin_form.original %}
|
{% if inline_admin_form.original %}
|
||||||
<input type="hidden" name="admin_sorting_url" value="../sorting/do-sorting/{{ inline_admin_form.original.model_type_id }}/" />
|
<input type="hidden" name="admin_sorting_url" value="{% url 'admin:admin_do_sorting' inline_admin_form.original.model_type_id %}" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>{% endfor %}
|
</div>{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endspaceless %}
|
{% endspaceless %}
|
||||||
{% if inline_admin_form.original %}
|
{% if inline_admin_form.original %}
|
||||||
<input type="hidden" name="admin_sorting_url" value="../sorting/do-sorting/{{ inline_admin_form.original.model_type_id }}/" />
|
<input type="hidden" name="admin_sorting_url" value="{% url 'admin:admin_do_sorting' inline_admin_form.original.model_type_id %}" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
{% for fieldset in inline_admin_form %}
|
{% for fieldset in inline_admin_form %}
|
||||||
|
|
|
||||||
|
|
@ -3,4 +3,4 @@
|
||||||
<form>
|
<form>
|
||||||
<input name="pk" type="hidden" value="{{ object.pk }}" />
|
<input name="pk" type="hidden" value="{{ object.pk }}" />
|
||||||
</form>
|
</form>
|
||||||
<a href="../sorting/do-sorting/{{ object.model_type_id }}/" class="admin_sorting_url">{{ object }}</a>
|
<a href="{% url 'admin:admin_do_sorting' object.model_type_id %}" class="admin_sorting_url">{{ object }}</a>
|
||||||
|
|
|
||||||
|
|
@ -102,10 +102,6 @@ class SortableTestCase(TestCase):
|
||||||
template_names = [t.name for t in response.templates]
|
template_names = [t.name for t in response.templates]
|
||||||
self.assertTrue('adminsortable/change_list.html' in template_names,
|
self.assertTrue('adminsortable/change_list.html' in template_names,
|
||||||
'adminsortable/change_list.html was not rendered')
|
'adminsortable/change_list.html was not rendered')
|
||||||
self.assertTrue('adminsortable/shared/javascript_includes.html'
|
|
||||||
in template_names,
|
|
||||||
'JavaScript includes for adminsortable change list '
|
|
||||||
'were not rendered')
|
|
||||||
|
|
||||||
def test_adminsortable_change_list_sorting_fails_if_not_ajax(self):
|
def test_adminsortable_change_list_sorting_fails_if_not_ajax(self):
|
||||||
logged_in = self.client.login(username=self.user.username,
|
logged_in = self.client.login(username=self.user.username,
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Reference in New Issue