Permalink
Browse files

Fixed django admin inline verbose name (plural/singular). Bug #18549

  • Loading branch information...
harph committed Nov 5, 2012
1 parent 7f75460 commit 36a7bb03a8d00e22c9a518cbe46193c5808a029a
@@ -1,6 +1,14 @@
{% load i18n admin_static %}
<div class="inline-group" id="{{ inline_admin_formset.formset.prefix }}-group">
- <h2>{{ inline_admin_formset.opts.verbose_name_plural|title }}</h2>
+ <h2>
+ {% with formset_opts=inline_admin_formset.opts max_num=inline_admin_formset.formset.max_num %}
+ {% if not max_num or max_num > 1 %}
+ {{ formset_opts.verbose_name_plural|capfirst }}
+ {% else %}
+ {{ formset_opts.verbose_name|capfirst }}
+ {% endif %}
+ {% endwith %}
+ </h2>
{{ inline_admin_formset.formset.management_form }}
{{ inline_admin_formset.formset.non_form_errors }}
@@ -3,7 +3,15 @@
<div class="tabular inline-related {% if forloop.last %}last-related{% endif %}">
{{ inline_admin_formset.formset.management_form }}
<fieldset class="module">
- <h2>{{ inline_admin_formset.opts.verbose_name_plural|capfirst }}</h2>
+ <h2>
+ {% with formset_opts=inline_admin_formset.opts max_num=inline_admin_formset.formset.max_num %}
+ {% if not max_num or max_num > 1 %}
+ {{ formset_opts.verbose_name_plural|capfirst }}
+ {% else %}
+ {{ formset_opts.verbose_name|capfirst }}
+ {% endif %}
+ {% endwith %}
+ </h2>
{{ inline_admin_formset.formset.non_form_errors }}
<table>
<thead><tr>

0 comments on commit 36a7bb0

Please sign in to comment.