diff --git a/django/contrib/admin/media/css/forms.css b/django/contrib/admin/media/css/forms.css index 72e57501e9..2a1a0995a0 100644 --- a/django/contrib/admin/media/css/forms.css +++ b/django/contrib/admin/media/css/forms.css @@ -58,3 +58,24 @@ fieldset.monospace textarea { font-family:"Bitstream Vera Sans Mono",Monaco,"Cou .vLargeTextField, .vXMLLargeTextField { width:48em; } .flatpages-flatpage #id_content { height:40.2em; } .module table .vPositiveSmallIntegerField { width:2.2em; } + +/* x unsorted */ +.inline-group {padding:10px; padding-bottom:5px; background:#eee; margin:10px 0;} +.inline-group h3.header {margin:-5px -10px 5px -10px; background:#bbb; color:#fff; padding:2px 5px 3px 5px; font-size:11px} +.inline-related {margin-bottom:15px; position:relative;} +.last-related {margin-bottom:0px;} +.inline-related h2 { margin:0; padding:2px 5px 3px 5px; font-size:11px; text-align:left; font-weight:bold; color:#888; } +.inline-related h2 b {font-weight:normal; color:#aaa;} +.inline-related h2 span.delete {padding-left:20px; position:absolute; top:0px; right:5px;} +.inline-related h2 span.delete label {margin-left:2px; padding-top:1px;} +.inline-related fieldset {background:#fbfbfb;} +.inline-related fieldset.module h2 { margin:0; padding:2px 5px 3px 5px; font-size:11px; text-align:left; font-weight:bold; background:#bcd; color:#fff; } +.inline-related.tabular fieldset.module table {width:100%;} + +.inline-group .tabular tr.has_original td {padding-top:2em;} +.inline-group .tabular tr td.original { padding:2px 0 0 0; width:0; _position:relative; } +.inline-group .tabular th.original {width:0px; padding:0;} +.inline-group .tabular td.original p {position:absolute; left:0; height:1.1em; padding:2px 7px; overflow:hidden; font-size:9px; font-weight:bold; color:#666; _width:700px; } +.inline-group ul.tools {padding:0; margin: 0; list-style:none;} +.inline-group ul.tools li {display:inline; padding:0 5px;} +.inline-group ul.tools a.add {background:url(../img/admin/icon_addlink.gif) 0 50% no-repeat; padding-left:14px;} \ No newline at end of file diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py index c4476c66dc..86e3e1d3d0 100644 --- a/django/contrib/admin/options.py +++ b/django/contrib/admin/options.py @@ -729,10 +729,10 @@ class InlineModelAdmin(BaseModelAdmin): return [(None, {'fields': form.base_fields.keys()})] class StackedInline(InlineModelAdmin): - template = 'admin/edit_inline_stacked.html' + template = 'admin/edit_inline/stacked.html' class TabularInline(InlineModelAdmin): - template = 'admin/edit_inline_tabular.html' + template = 'admin/edit_inline/tabular.html' class InlineAdminFormSet(object): """ diff --git a/django/contrib/admin/templates/admin/change_form.html b/django/contrib/admin/templates/admin/change_form.html index a9963cdd9b..fab4d816e9 100644 --- a/django/contrib/admin/templates/admin/change_form.html +++ b/django/contrib/admin/templates/admin/change_form.html @@ -41,23 +41,7 @@ {% endif %} {% for fieldset in adminform %} -
- {% if fieldset.name %}

{{ fieldset.name }}

{% endif %} - {% if fieldset.description %}
{{ fieldset.description }}
{% endif %} - {% for line in fieldset %} -
- {{ line.errors }} - {% for field in line %} - {% if field.is_checkbox %} - {{ field.field }}{{ field.label_tag }} - {% else %} - {{ field.label_tag }}{{ field.field }} - {% endif %} - {% if field.field.field.help_text %}

{{ field.field.field.help_text }}

{% endif %} - {% endfor %} -
- {% endfor %} -
+ {% include "admin/includes/fieldset.html" %} {% endfor %} {% block after_field_sets %}{% endblock %} diff --git a/django/contrib/admin/templates/admin/edit_inline/stacked.html b/django/contrib/admin/templates/admin/edit_inline/stacked.html new file mode 100644 index 0000000000..3cd0a436d1 --- /dev/null +++ b/django/contrib/admin/templates/admin/edit_inline/stacked.html @@ -0,0 +1,25 @@ +{% load i18n %} +
+{{ inline_admin_formset.formset.management_form }} +{#

{{ inline_admin_formset.opts.verbose_name_plural|title }}

#} + +{% for inline_admin_form in inline_admin_formset %} + +{% endfor %} + +{# #} +
\ No newline at end of file diff --git a/django/contrib/admin/templates/admin/edit_inline/tabular.html b/django/contrib/admin/templates/admin/edit_inline/tabular.html new file mode 100644 index 0000000000..16bb14d002 --- /dev/null +++ b/django/contrib/admin/templates/admin/edit_inline/tabular.html @@ -0,0 +1,63 @@ +{% load i18n %} +
+ + + {# #} + +
diff --git a/django/contrib/admin/templates/admin/edit_inline_stacked.html b/django/contrib/admin/templates/admin/edit_inline_stacked.html deleted file mode 100644 index 0001ae40cb..0000000000 --- a/django/contrib/admin/templates/admin/edit_inline_stacked.html +++ /dev/null @@ -1,49 +0,0 @@ -{{ inline_admin_formset.formset.management_form }} -{% for inline_admin_form in inline_admin_formset %} -
-

{{ inline_admin_formset.opts.verbose_name|title }} #{{ forloop.counter }}

- {% for bfset in inline_admin_form %} - - - - - {% for line in bfset %} -
- {{ line.errors }} - {% for field in line %} - {% if field.is_checkbox %} - {{ field.field }}{{ field.label_tag }} - {% else %} - {{ field.label_tag }}{{ field.field }} - {% endif %} - {% if field.field.field.help_text %}

{{ field.field.field.help_text }}

{% endif %} - {% endfor %} -
- {% endfor %} - - {% endfor %} - {{ inline_admin_form.pk_field.field }} - {% if inline_admin_formset.formset.deletable %}
{{ inline_admin_form.deletion_field.field }} {{ inline_admin_form.deletion_field.label_tag }}
{% endif %} -
-{% endfor %} - -{% comment %} - - -{% load admin_modify %} -
- {% for fcw in bound_related_object.form_field_collection_wrappers %} -

{{ bound_related_object.relation.opts.verbose_name|capfirst|escape }} #{{ forloop.counter }}

- {% if bound_related_object.show_url %}{% if fcw.obj.original %} -

View on site

- {% endif %}{% endif %} - {% for bound_field in fcw.bound_fields %} - {% if bound_field.hidden %} - {% field_widget bound_field %} - {% else %} - {% admin_field_line bound_field %} - {% endif %} - {% endfor %} - {% endfor %} -
-{% endcomment %} \ No newline at end of file diff --git a/django/contrib/admin/templates/admin/edit_inline_tabular.html b/django/contrib/admin/templates/admin/edit_inline_tabular.html deleted file mode 100644 index 4d16a6ac43..0000000000 --- a/django/contrib/admin/templates/admin/edit_inline_tabular.html +++ /dev/null @@ -1,94 +0,0 @@ -{% load i18n %} -{{ inline_admin_formset.formset.management_form }} -
-

{{ inline_admin_formset.opts.verbose_name_plural|capfirst|escape }}

- - - {% if inline_admin_formset.formset.deletable %}{% endif %} - {% for field in inline_admin_formset.fields %} - {% if not field.is_hidden %} - - {% endif %} - {% endfor %} - - - {% for inline_admin_form in inline_admin_formset %} - - - - {% if inline_admin_form.form.errors %} - - {% endif %} - - - {{ inline_admin_form.pk_field.field }} - {% if inline_admin_formset.formset.deletable %}{% endif %} - {% for fieldset in inline_admin_form %} - {% for line in fieldset %} - {% for field in line %} - - {% endfor %} - {% endfor %} - {% endfor %} - - - - - {% endfor %} - -
{% trans "Delete" %}?{{ field.label|capfirst|escape }}
- {{ inline_admin_form.form.errors }} -
{{ inline_admin_form.deletion_field.field }}{{ field.field }}
- - - -
- -{% comment %} - - -{% load admin_modify %} -
-

{{ bound_related_object.relation.opts.verbose_name_plural|capfirst|escape }}

- - {% for fw in bound_related_object.field_wrapper_list %} - {% if fw.needs_header %} - {{ fw.field.verbose_name|capfirst|escape }} - {% endif %} - {% endfor %} - - {% for fcw in bound_related_object.form_field_collection_wrappers %} - {% if change %}{% if original_row_needed %} - {% if fcw.obj.original %} - - {% endif %} - {% endif %}{% endif %} - {% if fcw.obj.errors %} - - {% endif %} - - {% for bound_field in fcw.bound_fields %} - {% if not bound_field.hidden %} - - {% endif %} - {% endfor %} - {% if bound_related_object.show_url %}{% endif %} - - - {% endfor %}
{{ fcw.obj.original }}
- {{ fcw.obj.html_combined_error_list }} -
- {% field_widget bound_field %} - - {% if fcw.obj.original %}View on site{% endif %} -
- - {% for fcw in bound_related_object.form_field_collection_wrappers %} - {% for bound_field in fcw.bound_fields %} - {% if bound_field.hidden %} - {% field_widget bound_field %} - {% endif %} - {% endfor %} - {% endfor %} -
-{% endcomment %} diff --git a/django/contrib/admin/templates/admin/includes/fieldset.html b/django/contrib/admin/templates/admin/includes/fieldset.html new file mode 100644 index 0000000000..4a6769438c --- /dev/null +++ b/django/contrib/admin/templates/admin/includes/fieldset.html @@ -0,0 +1,17 @@ +
+ {% if fieldset.name %}

{{ fieldset.name }}

{% endif %} + {% if fieldset.description %}
{{ fieldset.description }}
{% endif %} + {% for line in fieldset %} +
+ {{ line.errors }} + {% for field in line %} + {% if field.is_checkbox %} + {{ field.field }}{{ field.label_tag }} + {% else %} + {{ field.label_tag }}{{ field.field }} + {% endif %} + {% if field.field.field.help_text %}

{{ field.field.field.help_text }}

{% endif %} + {% endfor %} +
+ {% endfor %} +
\ No newline at end of file