Code

Ticket #5519: 01-support-for-cs.diff

File 01-support-for-cs.diff, 3.9 KB (added by Petr Marhoun <petr.marhoun@…>, 6 years ago)

new version - after autoescape merge (depends only on #5425 now)

Line 
1=== modified file 'django/contrib/admin/options.py'
2--- django/contrib/admin/options.py     2007-11-30 13:00:47 +0000
3+++ django/contrib/admin/options.py     2007-11-30 13:02:14 +0000
4@@ -518,7 +518,7 @@
5             inline_admin_formsets.append(inline_admin_formset)
6 
7         c = template.RequestContext(request, {
8-            'title': _('Add %s') % opts.verbose_name,
9+            'title': capfirst(_('Add %s') % opts.verbose_name),
10             'adminform': adminForm,
11             'is_popup': request.REQUEST.has_key('_popup'),
12             'show_delete': False,
13@@ -592,7 +592,7 @@
14             inline_admin_formsets.append(inline_admin_formset)
15 
16         c = template.RequestContext(request, {
17-            'title': _('Change %s') % opts.verbose_name,
18+            'title': capfirst(_('Change %s') % opts.verbose_name),
19             'adminform': adminForm,
20             'object_id': object_id,
21             'original': obj,
22
23=== modified file 'django/contrib/admin/templates/admin/change_list.html'
24--- django/contrib/admin/templates/admin/change_list.html       2007-11-30 13:00:47 +0000
25+++ django/contrib/admin/templates/admin/change_list.html       2007-11-30 13:02:14 +0000
26@@ -15,7 +15,7 @@
27 <div id="content-main">
28 {% block object-tools %}
29 {% if has_add_permission %}
30-<ul class="object-tools"><li><a href="add/{% if is_popup %}?_popup=1{% endif %}" class="addlink">{% blocktrans with cl.opts.verbose_name|escape as name %}Add {{ name }}{% endblocktrans %}</a></li></ul>
31+<ul class="object-tools"><li><a href="add/{% if is_popup %}?_popup=1{% endif %}" class="addlink">{% filter capfirst %}{% blocktrans with cl.opts.verbose_name|escape as name %}Add {{ name }}{% endblocktrans %}{% endfilter %}</a></li></ul>
32 {% endif %}
33 {% endblock %}
34 <div class="module{% if cl.has_filters %} filtered{% endif %}" id="changelist">
35
36=== modified file 'django/contrib/admin/templates/admin/pagination.html'
37--- django/contrib/admin/templates/admin/pagination.html        2007-11-30 13:01:27 +0000
38+++ django/contrib/admin/templates/admin/pagination.html        2007-11-30 13:02:14 +0000
39@@ -7,9 +7,9 @@
40 {% endfor %}
41 {% endif %}
42 {% ifequal cl.result_count 1 %}
43-       {% blocktrans with cl.result_count as count and cl.opts.verbose_name as verbose_name %}{{ count }} {{ verbose_name }}{% endblocktrans %}
44+       {% filter capfirst %}{% blocktrans with cl.result_count as count and cl.opts.verbose_name as verbose_name %}{{ count }} {{ verbose_name }}{% endblocktrans %}{% endfilter %}
45 {% else %}
46-       {% blocktrans with cl.result_count as count and cl.opts.verbose_name_plural as verbose_name_plural %}{{ count }} {{ verbose_name_plural }}{% endblocktrans %}
47+       {% filter capfirst %}{% blocktrans with cl.result_count as count and cl.opts.verbose_name_plural as verbose_name_plural %}{{ count }} {{ verbose_name_plural }}{% endblocktrans %}{% endfilter %}
48 {% endifequal %}
49 {% if show_all_url %}&nbsp;&nbsp;<a href="{{ show_all_url }}" class="showall">{% trans 'Show all' %}</a>{% endif %}
50 </p>
51
52=== modified file 'django/contrib/admin/views/main.py'
53--- django/contrib/admin/views/main.py  2007-11-30 13:00:47 +0000
54+++ django/contrib/admin/views/main.py  2007-11-30 13:08:21 +0000
55@@ -10,6 +10,7 @@
56 from django.http import Http404
57 from django.utils.encoding import force_unicode, smart_str
58 from django.utils.translation import ugettext
59+from django.utils.text import capfirst
60 import operator
61 
62 try:
63@@ -146,7 +147,7 @@
64         self.query = request.GET.get(SEARCH_VAR, '')
65         self.query_set = self.get_query_set()
66         self.get_results(request)
67-        self.title = (self.is_popup and ugettext('Select %s') % force_unicode(self.opts.verbose_name) or ugettext('Select %s to change') % force_unicode(self.opts.verbose_name))
68+        self.title = capfirst((self.is_popup and ugettext('Select %s') % force_unicode(self.opts.verbose_name) or ugettext('Select %s to change') % force_unicode(self.opts.verbose_name)))
69         self.filter_specs, self.has_filters = self.get_filters(request)
70         self.pk_attname = self.lookup_opts.pk.attname
71 
72