Updated CSS classing of sortable inline and stacked items.

Concatenated classing of sortable inlines into one stylesheet.
Updated version to 1.3.3
Updated README
master
Brandon Taylor 2012-07-09 11:05:59 -04:00
parent 484f00d263
commit 866adffd7b
8 changed files with 36 additions and 34 deletions

6
README
View File

@ -130,10 +130,10 @@ Status
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
class, where the SortableForeignKey model itself did not inherit from Sortable.
- Fixed an issue where sortable inlines weren't getting the correct CSS class
which gave them the appearance of not being sortable.
Features
=============

View File

@ -1,4 +1,4 @@
VERSION = (1, 3, 2) # following PEP 386
VERSION = (1, 3, 3) # following PEP 386
DEV_N = None

View File

@ -19,8 +19,7 @@
{% block extrastyle %}
{{ block.super }}
{% if has_sortable_tabular_inlines %}
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}adminsortable/css/admin.sortable.tabular.inline.css" />
{% if has_sortable_tabular_inlines or has_sortable_stacked_inlines %}
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}adminsortable/css/admin.sortable.inline.css" />
{% endif %}
{% endblock %}

View File

@ -1,10 +1,11 @@
{% load i18n adminmedia %}
<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>
{{ inline_admin_formset.formset.management_form }}
{{ inline_admin_formset.formset.non_form_errors }}
{{ inline_admin_formset.formset.management_form }}
{{ 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 %}
<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 %}">
<h3><b>{{ inline_admin_formset.opts.verbose_name|title }}:</b>&nbsp;<span class="inline_label">{% if inline_admin_form.original %}{{ inline_admin_form.original }}{% else %}#{{ forloop.counter }}{% endif %}</span>
{% 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 %}
{% 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 %}
@ -18,7 +19,8 @@
{% if inline_admin_form.original %}
<input type="hidden" name="admin_sorting_url" value="{% url admin:admin_do_sorting inline_admin_form.original.model_type_id %}" />
{% endif %}
</div>{% endfor %}
</div>
{% endfor %}
</div>
<script type="text/javascript">

Binary file not shown.

View File

@ -13,6 +13,7 @@ class CreditInline(SortableTabularInline):
class NoteInline(SortableStackedInline):
model = Note
extra = 0
class ProjectAdmin(SortableAdmin):

View File

@ -0,0 +1,4 @@
.sortable
{
cursor: move;
}

View File

@ -1,4 +0,0 @@
.tabular .sortable
{
cursor: move;
}