diff options
| author | Renato Oliveira <renatooliveira.cin@gmail.com> | 2013-10-23 11:04:02 -0300 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-10-24 14:44:07 -0400 |
| commit | 43569647ab234cd1d2f4d41399b97b4b793d573a (patch) | |
| tree | 4795c3311f190332fa7dca9ec7240aafaeaf9621 | |
| parent | 9bf5610890530ce5db9af7ef89ae5b8612f46a94 (diff) | |
Fixed #21299 - Changed filters from title to capfirst on admin inline formsets.
Previously there was a mixture of the two which resulted in inconsistent
casing.
| -rw-r--r-- | django/contrib/admin/templates/admin/edit_inline/stacked.html | 6 | ||||
| -rw-r--r-- | django/contrib/admin/templates/admin/edit_inline/tabular.html | 2 | ||||
| -rw-r--r-- | tests/admin_inlines/tests.py | 8 | ||||
| -rw-r--r-- | tests/admin_views/tests.py | 4 |
4 files changed, 10 insertions, 10 deletions
diff --git a/django/contrib/admin/templates/admin/edit_inline/stacked.html b/django/contrib/admin/templates/admin/edit_inline/stacked.html index 32917756b3..42f68f3f97 100644 --- a/django/contrib/admin/templates/admin/edit_inline/stacked.html +++ b/django/contrib/admin/templates/admin/edit_inline/stacked.html @@ -1,11 +1,11 @@ {% 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>{{ inline_admin_formset.opts.verbose_name_plural|capfirst }}</h2> {{ 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 %}"> - <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> + <h3><b>{{ inline_admin_formset.opts.verbose_name|capfirst }}:</b> <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="{% url 'admin:view_on_site' inline_admin_form.original_content_type_id inline_admin_form.original.pk %}">{% 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 %} </h3> @@ -24,7 +24,7 @@ prefix: '{{ inline_admin_formset.formset.prefix }}', adminStaticPrefix: '{% static "admin/" %}', deleteText: "{% trans "Remove" %}", - addText: "{% blocktrans with verbose_name=inline_admin_formset.opts.verbose_name|title %}Add another {{ verbose_name }}{% endblocktrans %}" + addText: "{% blocktrans with verbose_name=inline_admin_formset.opts.verbose_name|capfirst %}Add another {{ verbose_name }}{% endblocktrans %}" }); })(django.jQuery); </script> diff --git a/django/contrib/admin/templates/admin/edit_inline/tabular.html b/django/contrib/admin/templates/admin/edit_inline/tabular.html index 0bfa405272..94be6f89b9 100644 --- a/django/contrib/admin/templates/admin/edit_inline/tabular.html +++ b/django/contrib/admin/templates/admin/edit_inline/tabular.html @@ -74,7 +74,7 @@ $("#{{ inline_admin_formset.formset.prefix }}-group .tabular.inline-related tbody tr").tabularFormset({ prefix: "{{ inline_admin_formset.formset.prefix }}", adminStaticPrefix: '{% static "admin/" %}', - addText: "{% blocktrans with inline_admin_formset.opts.verbose_name|title as verbose_name %}Add another {{ verbose_name }}{% endblocktrans %}", + addText: "{% blocktrans with inline_admin_formset.opts.verbose_name|capfirst as verbose_name %}Add another {{ verbose_name }}{% endblocktrans %}", deleteText: "{% trans 'Remove' %}" }); })(django.jQuery); diff --git a/tests/admin_inlines/tests.py b/tests/admin_inlines/tests.py index 8f0765d7a3..2d0a7edd10 100644 --- a/tests/admin_inlines/tests.py +++ b/tests/admin_inlines/tests.py @@ -57,7 +57,7 @@ class TestInline(TestCase): # The heading for the m2m inline block uses the right text self.assertContains(response, '<h2>Author-book relationships</h2>') # The "add another" label is correct - self.assertContains(response, 'Add another Author-Book Relationship') + self.assertContains(response, 'Add another Author-book relationship') # The '+' is dropped from the autogenerated form prefix (Author_books+) self.assertContains(response, 'id="id_Author_books-TOTAL_FORMS"') @@ -449,7 +449,7 @@ class TestInlinePermissions(TestCase): response = self.client.get(self.author_change_url) # We have change perm on books, so we can add/change/delete inlines self.assertContains(response, '<h2>Author-book relationships</h2>') - self.assertContains(response, 'Add another Author-Book Relationship') + self.assertContains(response, 'Add another Author-book relationship') self.assertContains(response, '<input type="hidden" id="id_Author_books-TOTAL_FORMS" ' 'value="4" name="Author_books-TOTAL_FORMS" />', html=True) self.assertContains(response, '<input type="hidden" id="id_Author_books-0-id" ' @@ -554,7 +554,7 @@ class SeleniumFirefoxTests(AdminSeleniumWebDriverTestCase): self.assertEqual(rows_length(), 3) add_button = self.selenium.find_element_by_link_text( - 'Add another Inner4 Stacked') + 'Add another Inner4 stacked') add_button.click() self.assertEqual(rows_length(), 4) @@ -570,7 +570,7 @@ class SeleniumFirefoxTests(AdminSeleniumWebDriverTestCase): self.assertEqual(rows_length(), 3) add_button = self.selenium.find_element_by_link_text( - 'Add another Inner4 Stacked') + 'Add another Inner4 stacked') add_button.click() add_button.click() diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index 684259d9bf..16fea943f9 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -3443,7 +3443,7 @@ class SeleniumAdminViewsFirefoxTests(AdminSeleniumWebDriverTestCase): self.assertEqual(slug2, 'option-one-here-stacked-inline') # Add an inline - self.selenium.find_elements_by_link_text('Add another Related Prepopulated')[0].click() + self.selenium.find_elements_by_link_text('Add another Related prepopulated')[0].click() self.selenium.find_element_by_css_selector('#id_relatedprepopulated_set-1-pubdate').send_keys('1999-01-25') self.get_select_option('#id_relatedprepopulated_set-1-status', 'option two').click() self.selenium.find_element_by_css_selector('#id_relatedprepopulated_set-1-name').send_keys(' now you haVe anöther sŤāÇkeð inline with a very ... loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooog text... ') @@ -3463,7 +3463,7 @@ class SeleniumAdminViewsFirefoxTests(AdminSeleniumWebDriverTestCase): self.assertEqual(slug2, 'option-two-and-now-tabular-inline') # Add an inline - self.selenium.find_elements_by_link_text('Add another Related Prepopulated')[1].click() + self.selenium.find_elements_by_link_text('Add another Related prepopulated')[1].click() self.selenium.find_element_by_css_selector('#id_relatedprepopulated_set-2-1-pubdate').send_keys('1981-08-22') self.get_select_option('#id_relatedprepopulated_set-2-1-status', 'option one').click() self.selenium.find_element_by_css_selector('#id_relatedprepopulated_set-2-1-name').send_keys('a tÃbűlaŘ inline with ignored ;"&*^\%$#@-/`~ characters') |
