Updated CSS classing of sortable inline and stacked items.
Concatenated classing of sortable inlines into one stylesheet. Updated version to 1.3.3 Updated READMEmaster
parent
484f00d263
commit
866adffd7b
6
README
6
README
|
|
@ -130,10 +130,10 @@ Status
|
||||||
admin-sortable is currently used in production.
|
admin-sortable is currently used in production.
|
||||||
|
|
||||||
|
|
||||||
What's new in 1.3.2
|
What's new in 1.3.3
|
||||||
=============
|
=============
|
||||||
- Fixed an issue that prevented sorting on classes that specified a SortableForeignKey
|
- Fixed an issue where sortable inlines weren't getting the correct CSS class
|
||||||
class, where the SortableForeignKey model itself did not inherit from Sortable.
|
which gave them the appearance of not being sortable.
|
||||||
|
|
||||||
Features
|
Features
|
||||||
=============
|
=============
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
VERSION = (1, 3, 2) # following PEP 386
|
VERSION = (1, 3, 3) # following PEP 386
|
||||||
DEV_N = None
|
DEV_N = None
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,20 +7,19 @@
|
||||||
{% url 'admin:jsi18n' as jsi18nurl %}
|
{% url 'admin:jsi18n' as jsi18nurl %}
|
||||||
|
|
||||||
{% if has_sortable_tabular_inlines or has_sortable_stacked_inlines %}
|
{% if has_sortable_tabular_inlines or has_sortable_stacked_inlines %}
|
||||||
{% include 'adminsortable/shared/javascript_includes.html' %}
|
{% include 'adminsortable/shared/javascript_includes.html' %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if has_sortable_tabular_inlines %}
|
{% if has_sortable_tabular_inlines %}
|
||||||
<script type="text/javascript" src="{{ STATIC_URL }}adminsortable/js/admin.sortable.tabular.inlines.js"></script>
|
<script type="text/javascript" src="{{ STATIC_URL }}adminsortable/js/admin.sortable.tabular.inlines.js"></script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if has_sortable_stacked_inlines %}
|
{% if has_sortable_stacked_inlines %}
|
||||||
<script type="text/javascript" src="{{ STATIC_URL }}adminsortable/js/jquery.effects.core.js"></script>
|
<script type="text/javascript" src="{{ STATIC_URL }}adminsortable/js/jquery.effects.core.js"></script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block extrastyle %}
|
{% block extrastyle %}
|
||||||
{{ block.super }}
|
{{ block.super }}
|
||||||
{% if has_sortable_tabular_inlines %}
|
{% if has_sortable_tabular_inlines or has_sortable_stacked_inlines %}
|
||||||
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}adminsortable/css/admin.sortable.tabular.inline.css" />
|
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}adminsortable/css/admin.sortable.inline.css" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
@ -1,24 +1,26 @@
|
||||||
{% load i18n adminmedia %}
|
{% load i18n adminmedia %}
|
||||||
<div class="inline-group" id="{{ inline_admin_formset.formset.prefix }}-group">
|
<div class="inline-group" id="{{ inline_admin_formset.formset.prefix }}-group">
|
||||||
<h2>{{ inline_admin_formset.opts.verbose_name_plural|title }} {% if inline_admin_formset.opts.is_sortable %} - drag and drop to change order{% endif %}</h2>
|
<h2>{{ inline_admin_formset.opts.verbose_name_plural|title }} {% if inline_admin_formset.opts.is_sortable %} - drag and drop to change order{% endif %}</h2>
|
||||||
{{ inline_admin_formset.formset.management_form }}
|
{{ inline_admin_formset.formset.management_form }}
|
||||||
{{ inline_admin_formset.formset.non_form_errors }}
|
{{ inline_admin_formset.formset.non_form_errors }}
|
||||||
|
|
||||||
{% for inline_admin_form in inline_admin_formset %}<div class="inline-related{% if forloop.last %} empty-form last-related{% endif %}" id="{{ inline_admin_formset.formset.prefix }}-{% if not forloop.last %}{{ forloop.counter0 }}{% else %}empty{% endif %}">
|
{% for inline_admin_form in inline_admin_formset %}
|
||||||
<h3><b>{{ inline_admin_formset.opts.verbose_name|title }}:</b> <span class="inline_label">{% if inline_admin_form.original %}{{ inline_admin_form.original }}{% else %}#{{ forloop.counter }}{% endif %}</span>
|
<div class="inline-related{% if forloop.last %} empty-form last-related{% endif %}" id="{{ inline_admin_formset.formset.prefix }}-{% if not forloop.last %}{{ forloop.counter0 }}{% else %}empty{% endif %}">
|
||||||
{% if inline_admin_form.show_url %}<a href="../../../r/{{ inline_admin_form.original_content_type_id }}/{{ inline_admin_form.original.id }}/">{% trans "View on site" %}</a>{% endif %}
|
<h3><b>{{ inline_admin_formset.opts.verbose_name|title }}:</b> <span class="inline_label">{% if inline_admin_form.original %}{{ inline_admin_form.original }}{% else %}#{{ forloop.counter }}{% endif %}</span>
|
||||||
{% if inline_admin_formset.formset.can_delete and inline_admin_form.original %}<span class="delete">{{ inline_admin_form.deletion_field.field }} {{ inline_admin_form.deletion_field.label_tag }}</span>{% endif %}
|
{% if inline_admin_form.show_url %}<a href="../../../r/{{ inline_admin_form.original_content_type_id }}/{{ inline_admin_form.original.id }}/">{% trans "View on site" %}</a>{% endif %}
|
||||||
</h3>
|
{% if inline_admin_formset.formset.can_delete and inline_admin_form.original %}<span class="delete">{{ inline_admin_form.deletion_field.field }} {{ inline_admin_form.deletion_field.label_tag }}</span>{% endif %}
|
||||||
{% if inline_admin_form.form.non_field_errors %}{{ inline_admin_form.form.non_field_errors }}{% endif %}
|
</h3>
|
||||||
{% for fieldset in inline_admin_form %}
|
{% if inline_admin_form.form.non_field_errors %}{{ inline_admin_form.form.non_field_errors }}{% endif %}
|
||||||
{% include "admin/includes/fieldset.html" %}
|
{% for fieldset in inline_admin_form %}
|
||||||
{% endfor %}
|
{% include "admin/includes/fieldset.html" %}
|
||||||
{% if inline_admin_form.has_auto_field %}{{ inline_admin_form.pk_field.field }}{% endif %}
|
{% endfor %}
|
||||||
{{ inline_admin_form.fk_field.field }}
|
{% if inline_admin_form.has_auto_field %}{{ inline_admin_form.pk_field.field }}{% endif %}
|
||||||
{% if inline_admin_form.original %}
|
{{ inline_admin_form.fk_field.field }}
|
||||||
<input type="hidden" name="admin_sorting_url" value="{% url admin:admin_do_sorting inline_admin_form.original.model_type_id %}" />
|
{% if inline_admin_form.original %}
|
||||||
{% endif %}
|
<input type="hidden" name="admin_sorting_url" value="{% url admin:admin_do_sorting inline_admin_form.original.model_type_id %}" />
|
||||||
</div>{% endfor %}
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -13,6 +13,7 @@ class CreditInline(SortableTabularInline):
|
||||||
|
|
||||||
class NoteInline(SortableStackedInline):
|
class NoteInline(SortableStackedInline):
|
||||||
model = Note
|
model = Note
|
||||||
|
extra = 0
|
||||||
|
|
||||||
|
|
||||||
class ProjectAdmin(SortableAdmin):
|
class ProjectAdmin(SortableAdmin):
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
.sortable
|
||||||
|
{
|
||||||
|
cursor: move;
|
||||||
|
}
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
.tabular .sortable
|
|
||||||
{
|
|
||||||
cursor: move;
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue