Ticket #18549: 18549.diff

File 18549.diff, 1.9 KB (added by harph, 11 years ago)

Fixed adding two conditions to the stacked.html and tabular.html templates.

  • django/contrib/admin/templates/admin/edit_inline/stacked.html

    diff --git a/django/contrib/admin/templates/admin/edit_inline/stacked.html b/django/contrib/admin/templates/admin/edit_inline/stacked.html
    index 2025dd8..8f6fce6 100644
    a b  
    11{% load i18n admin_static %}
    22<div class="inline-group" id="{{ inline_admin_formset.formset.prefix }}-group">
    3   <h2>{{ inline_admin_formset.opts.verbose_name_plural|title }}</h2>
     3  <h2>
     4    {% with formset_opts=inline_admin_formset.opts max_num=inline_admin_formset.formset.max_num %}
     5      {% if not max_num or max_num > 1 %}
     6        {{ formset_opts.verbose_name_plural|capfirst }}
     7      {% else %}
     8        {{ formset_opts.verbose_name|capfirst }}
     9      {% endif %}
     10    {% endwith %}
     11  </h2>
    412{{ inline_admin_formset.formset.management_form }}
    513{{ inline_admin_formset.formset.non_form_errors }}
    614
  • django/contrib/admin/templates/admin/edit_inline/tabular.html

    diff --git a/django/contrib/admin/templates/admin/edit_inline/tabular.html b/django/contrib/admin/templates/admin/edit_inline/tabular.html
    index f2757ed..ecaf541 100644
    a b  
    33  <div class="tabular inline-related {% if forloop.last %}last-related{% endif %}">
    44{{ inline_admin_formset.formset.management_form }}
    55<fieldset class="module">
    6    <h2>{{ inline_admin_formset.opts.verbose_name_plural|capfirst }}</h2>
     6   <h2>
     7     {% with formset_opts=inline_admin_formset.opts max_num=inline_admin_formset.formset.max_num %}
     8       {% if not max_num or max_num > 1 %}
     9         {{ formset_opts.verbose_name_plural|capfirst }}
     10       {% else %}
     11         {{ formset_opts.verbose_name|capfirst }}
     12       {% endif %}
     13     {% endwith %}
     14   </h2>
    715   {{ inline_admin_formset.formset.non_form_errors }}
    816   <table>
    917     <thead><tr>
Back to Top