add more notes in readme for different versions

master
Benjamin Banduhn 2017-02-01 10:48:39 +01:00
parent 4d01ec19b5
commit b2ea957c4a
No known key found for this signature in database
GPG Key ID: 5199DDC16D3EF286
2 changed files with 56 additions and 1 deletions

View File

@ -485,6 +485,34 @@ with:
<script src="{% static 'adminsortable/js/admin.sortable.tabular.inlines.js' %}"></script>
```
### Notes
From ``django-cms 3.x`` the path of change_form.html has changed. Replace the follwing line:
```html
{% extends "admin/cms/page/plugin_change_form.html" %}
```
with
```html
{% extends "admin/cms/page/plugin/change_form.html" %}
```
From ``django-admin-sortable 2.0.13`` the ``jquery.django-csrf.js`` was removed and you have to include the snippet-template.
Change the following line:
```html
<script type="text/javascript" src="{% static 'adminsortable/js/jquery.django-csrf.js' %}"></script>
```
to
```html
{% include 'adminsortable/csrf/jquery.django-csrf.html' with csrf_cookie_name='csrftoken' %}
```
Please note, if you change the ``CSRF_COOKIE_NAME`` you have to adjust ``csrf_cookie_name='YOUR_CSRF_COOKIE_NAME'``
### Rationale
Other projects have added drag-and-drop ordering to the ChangeList
view, however this introduces a couple of problems...

View File

@ -53,7 +53,7 @@ Download django-admin-sortable from
`source <https://github.com/iambrandontaylor/django-admin-sortable/archive/master.zip>`__
1. Unzip the directory and cd into the uncompressed project directory
2.
2.
- Optional: Enable your virtualenv
@ -597,6 +597,33 @@ with:
<script src="{% static 'adminsortable/js/admin.sortable.tabular.inlines.js' %}"></script>
Notes
~~~~~
From ``django-cms 3.x`` the path of change_form.html has changed. Replace the follwing line:
.. code:: html
{% extends "admin/cms/page/plugin_change_form.html" %}
with
.. code:: html
{% extends "admin/cms/page/plugin/change_form.html" %}
From ``django-admin-sortable 2.0.13`` the ``jquery.django-csrf.js`` was removed and you have to include the snippet-template.
Change the following line:
.. code:: html
<script type="text/javascript" src="{% static 'adminsortable/js/jquery.django-csrf.js' %}"></script>
to
.. code:: html
{% include 'adminsortable/csrf/jquery.django-csrf.html' with csrf_cookie_name='csrftoken' %}
Please note, if you change the ``CSRF_COOKIE_NAME`` you have to adjust ``csrf_cookie_name='YOUR_CSRF_COOKIE_NAME'``
Rationale
~~~~~~~~~