diff -u -r -x '*.pyc' -x '*.patch' /home/seva/django.orig/lib/python2.6/site-packages/django/contrib/admin/actions.py ./contrib/admin/actions.py
old
|
new
|
|
12 | 12 | from django.utils.safestring import mark_safe |
13 | 13 | from django.utils.text import capfirst |
14 | 14 | from django.utils.translation import ugettext_lazy, ugettext as _ |
| 15 | from django.conf import settings |
15 | 16 | |
16 | 17 | def delete_selected(modeladmin, request, queryset): |
17 | 18 | """ |
… |
… |
|
25 | 26 | """ |
26 | 27 | opts = modeladmin.model._meta |
27 | 28 | app_label = opts.app_label |
| 29 | app_name = app_label.title() |
| 30 | try: |
| 31 | app_name = settings.APP_NAMES[app_label] |
| 32 | except: |
| 33 | pass |
28 | 34 | |
29 | 35 | # Check that the user has delete permission for the actual model |
30 | 36 | if not modeladmin.has_delete_permission(request): |
… |
… |
|
60 | 66 | "opts": opts, |
61 | 67 | "root_path": modeladmin.admin_site.root_path, |
62 | 68 | "app_label": app_label, |
| 69 | "app_name": app_name, |
63 | 70 | 'action_checkbox_name': helpers.ACTION_CHECKBOX_NAME, |
64 | 71 | } |
65 | 72 | |
diff -u -r -x '*.pyc' -x '*.patch' /home/seva/django.orig/lib/python2.6/site-packages/django/contrib/admin/options.py ./contrib/admin/options.py
old
|
new
|
|
23 | 23 | from django.utils.translation import ugettext as _ |
24 | 24 | from django.utils.translation import ungettext, ugettext_lazy |
25 | 25 | from django.utils.encoding import force_unicode |
| 26 | from django.conf import settings |
26 | 27 | |
27 | 28 | HORIZONTAL, VERTICAL = 1, 2 |
28 | 29 | # returns the <ul> class for a given radio_admin field |
… |
… |
|
265 | 266 | urls = property(urls) |
266 | 267 | |
267 | 268 | def _media(self): |
268 | | from django.conf import settings |
269 | | |
270 | 269 | js = ['js/core.js', 'js/admin/RelatedObjectLookups.js', |
271 | 270 | 'js/jquery.min.js', 'js/jquery.init.js'] |
272 | 271 | if self.actions is not None: |
… |
… |
|
605 | 604 | def render_change_form(self, request, context, add=False, change=False, form_url='', obj=None): |
606 | 605 | opts = self.model._meta |
607 | 606 | app_label = opts.app_label |
| 607 | app_name = app_label.title() |
| 608 | try: |
| 609 | app_name = settings.APP_NAMES[app_label] |
| 610 | except: |
| 611 | pass |
608 | 612 | ordered_objects = opts.get_ordered_objects() |
609 | 613 | context.update({ |
610 | 614 | 'add': add, |
… |
… |
|
617 | 621 | 'ordered_objects': ordered_objects, |
618 | 622 | 'form_url': mark_safe(form_url), |
619 | 623 | 'opts': opts, |
| 624 | 'app_name': app_name, |
620 | 625 | 'content_type_id': ContentType.objects.get_for_model(self.model).id, |
621 | 626 | 'save_as': self.save_as, |
622 | 627 | 'save_on_top': self.save_on_top, |
… |
… |
|
836 | 841 | inline_admin_formsets.append(inline_admin_formset) |
837 | 842 | media = media + inline_admin_formset.media |
838 | 843 | |
| 844 | app_name = opts.app_label.title() |
| 845 | try: |
| 846 | app_name = settings.APP_NAMES[app_label] |
| 847 | except: |
| 848 | pass |
| 849 | |
839 | 850 | context = { |
840 | 851 | 'title': _('Add %s') % force_unicode(opts.verbose_name), |
841 | 852 | 'adminform': adminForm, |
… |
… |
|
846 | 857 | 'errors': helpers.AdminErrorList(form, formsets), |
847 | 858 | 'root_path': self.admin_site.root_path, |
848 | 859 | 'app_label': opts.app_label, |
| 860 | 'app_name': app_name, |
849 | 861 | } |
850 | 862 | context.update(extra_context or {}) |
851 | 863 | return self.render_change_form(request, context, form_url=form_url, add=True) |
… |
… |
|
927 | 939 | inline_admin_formsets.append(inline_admin_formset) |
928 | 940 | media = media + inline_admin_formset.media |
929 | 941 | |
| 942 | app_name = opts.app_label.title() |
| 943 | try: |
| 944 | app_name = settings.APP_NAMES[app_label] |
| 945 | except: |
| 946 | pass |
| 947 | |
930 | 948 | context = { |
931 | 949 | 'title': _('Change %s') % force_unicode(opts.verbose_name), |
932 | 950 | 'adminform': adminForm, |
… |
… |
|
938 | 956 | 'errors': helpers.AdminErrorList(form, formsets), |
939 | 957 | 'root_path': self.admin_site.root_path, |
940 | 958 | 'app_label': opts.app_label, |
| 959 | 'app_name': app_name, |
941 | 960 | } |
942 | 961 | context.update(extra_context or {}) |
943 | 962 | return self.render_change_form(request, context, change=True, obj=obj) |
… |
… |
|
948 | 967 | from django.contrib.admin.views.main import ERROR_FLAG |
949 | 968 | opts = self.model._meta |
950 | 969 | app_label = opts.app_label |
| 970 | |
| 971 | app_name = opts.app_label.title() |
| 972 | try: |
| 973 | app_name = settings.APP_NAMES[app_label] |
| 974 | except: |
| 975 | pass |
| 976 | |
951 | 977 | if not self.has_change_permission(request, None): |
952 | 978 | raise PermissionDenied |
953 | 979 | |
… |
… |
|
1077 | 1103 | 'has_add_permission': self.has_add_permission(request), |
1078 | 1104 | 'root_path': self.admin_site.root_path, |
1079 | 1105 | 'app_label': app_label, |
| 1106 | 'app_name': app_name, |
1080 | 1107 | 'action_form': action_form, |
1081 | 1108 | 'actions_on_top': self.actions_on_top, |
1082 | 1109 | 'actions_on_bottom': self.actions_on_bottom, |
… |
… |
|
1095 | 1122 | "The 'delete' admin view for this model." |
1096 | 1123 | opts = self.model._meta |
1097 | 1124 | app_label = opts.app_label |
| 1125 | app_name = opts.app_label.title() |
| 1126 | try: |
| 1127 | app_name = settings.APP_NAMES[app_label] |
| 1128 | except: |
| 1129 | pass |
1098 | 1130 | |
1099 | 1131 | obj = self.get_object(request, unquote(object_id)) |
1100 | 1132 | |
… |
… |
|
1130 | 1162 | "opts": opts, |
1131 | 1163 | "root_path": self.admin_site.root_path, |
1132 | 1164 | "app_label": app_label, |
| 1165 | "app_name": app_name, |
1133 | 1166 | } |
1134 | 1167 | context.update(extra_context or {}) |
1135 | 1168 | context_instance = template.RequestContext(request, current_app=self.admin_site.name) |
… |
… |
|
1145 | 1178 | model = self.model |
1146 | 1179 | opts = model._meta |
1147 | 1180 | app_label = opts.app_label |
| 1181 | app_name = opts.app_label.title() |
| 1182 | try: |
| 1183 | app_name = settings.APP_NAMES[app_label] |
| 1184 | except: |
| 1185 | pass |
1148 | 1186 | action_list = LogEntry.objects.filter( |
1149 | 1187 | object_id = object_id, |
1150 | 1188 | content_type__id__exact = ContentType.objects.get_for_model(model).id |
… |
… |
|
1158 | 1196 | 'object': obj, |
1159 | 1197 | 'root_path': self.admin_site.root_path, |
1160 | 1198 | 'app_label': app_label, |
| 1199 | 'app_name': app_name, |
1161 | 1200 | } |
1162 | 1201 | context.update(extra_context or {}) |
1163 | 1202 | context_instance = template.RequestContext(request, current_app=self.admin_site.name) |
… |
… |
|
1224 | 1263 | self.verbose_name_plural = self.model._meta.verbose_name_plural |
1225 | 1264 | |
1226 | 1265 | def _media(self): |
1227 | | from django.conf import settings |
1228 | 1266 | js = ['js/jquery.min.js', 'js/jquery.init.js', 'js/inlines.min.js'] |
1229 | 1267 | if self.prepopulated_fields: |
1230 | 1268 | js.append('js/urlify.js') |
diff -u -r -x '*.pyc' -x '*.patch' /home/seva/django.orig/lib/python2.6/site-packages/django/contrib/admin/sites.py ./contrib/admin/sites.py
old
|
new
|
|
370 | 370 | if app_label in app_dict: |
371 | 371 | app_dict[app_label]['models'].append(model_dict) |
372 | 372 | else: |
| 373 | app_name = app_label.title() |
| 374 | try: |
| 375 | app_name = settings.APP_NAMES[app_label] |
| 376 | except: |
| 377 | pass |
373 | 378 | app_dict[app_label] = { |
374 | | 'name': app_label.title(), |
| 379 | 'name': app_name, |
375 | 380 | 'app_url': app_label + '/', |
376 | 381 | 'has_module_perms': has_module_perms, |
377 | 382 | 'models': [model_dict], |
… |
… |
|
415 | 420 | user = request.user |
416 | 421 | has_module_perms = user.has_module_perms(app_label) |
417 | 422 | app_dict = {} |
| 423 | app_name = capfirst(app_label) |
| 424 | try: |
| 425 | app_name = settings.APP_NAMES[app_label] |
| 426 | except: |
| 427 | pass |
418 | 428 | for model, model_admin in self._registry.items(): |
419 | 429 | if app_label == model._meta.app_label: |
420 | 430 | if has_module_perms: |
… |
… |
|
435 | 445 | # something to display, add in the necessary meta |
436 | 446 | # information. |
437 | 447 | app_dict = { |
438 | | 'name': app_label.title(), |
| 448 | 'name': app_name, |
439 | 449 | 'app_url': '', |
440 | 450 | 'has_module_perms': has_module_perms, |
441 | 451 | 'models': [model_dict], |
… |
… |
|
445 | 455 | # Sort the models alphabetically within each app. |
446 | 456 | app_dict['models'].sort(lambda x, y: cmp(x['name'], y['name'])) |
447 | 457 | context = { |
448 | | 'title': _('%s administration') % capfirst(app_label), |
| 458 | 'title': _('%s administration') % app_name, |
449 | 459 | 'app_list': [app_dict], |
450 | 460 | 'root_path': self.root_path, |
451 | 461 | } |
diff -u -r -x '*.pyc' -x '*.patch' /home/seva/django.orig/lib/python2.6/site-packages/django/contrib/admin/templates/admin/change_form.html ./contrib/admin/templates/admin/change_form.html
old
|
new
|
|
11 | 11 | |
12 | 12 | {% block coltype %}{% if ordered_objects %}colMS{% else %}colM{% endif %}{% endblock %} |
13 | 13 | |
14 | | {% block bodyclass %}{{ opts.app_label }}-{{ opts.object_name.lower }} change-form{% endblock %} |
| 14 | {% block bodyclass %}{{ app_name }}-{{ opts.object_name.lower }} change-form{% endblock %} |
15 | 15 | |
16 | 16 | {% block breadcrumbs %}{% if not is_popup %} |
17 | 17 | <div class="breadcrumbs"> |
18 | 18 | <a href="../../../">{% trans "Home" %}</a> › |
19 | | <a href="../../">{{ app_label|capfirst|escape }}</a> › |
| 19 | <a href="../../">{{ app_name|escape }}</a> › |
20 | 20 | {% if has_change_permission %}<a href="../">{{ opts.verbose_name_plural|capfirst }}</a>{% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %} › |
21 | 21 | {% if add %}{% trans "Add" %} {{ opts.verbose_name }}{% else %}{{ original|truncatewords:"18" }}{% endif %} |
22 | 22 | </div> |
diff -u -r -x '*.pyc' -x '*.patch' /home/seva/django.orig/lib/python2.6/site-packages/django/contrib/admin/templates/admin/change_list.html ./contrib/admin/templates/admin/change_list.html
old
|
new
|
|
43 | 43 | </a> |
44 | 44 | › |
45 | 45 | <a href="../"> |
46 | | {{ app_label|capfirst }} |
| 46 | {{ app_name }} |
47 | 47 | </a> |
48 | 48 | › |
49 | 49 | {{ cl.opts.verbose_name_plural|capfirst }} |
diff -u -r -x '*.pyc' -x '*.patch' /home/seva/django.orig/lib/python2.6/site-packages/django/contrib/admin/templates/admin/delete_confirmation.html ./contrib/admin/templates/admin/delete_confirmation.html
old
|
new
|
|
4 | 4 | {% block breadcrumbs %} |
5 | 5 | <div class="breadcrumbs"> |
6 | 6 | <a href="../../../../">{% trans "Home" %}</a> › |
7 | | <a href="../../../">{{ app_label|capfirst }}</a> › |
| 7 | <a href="../../../">{{ app_name }}</a> › |
8 | 8 | <a href="../../">{{ opts.verbose_name_plural|capfirst }}</a> › |
9 | 9 | <a href="../">{{ object|truncatewords:"18" }}</a> › |
10 | 10 | {% trans 'Delete' %} |
diff -u -r -x '*.pyc' -x '*.patch' /home/seva/django.orig/lib/python2.6/site-packages/django/contrib/admin/templates/admin/delete_selected_confirmation.html ./contrib/admin/templates/admin/delete_selected_confirmation.html
old
|
new
|
|
4 | 4 | {% block breadcrumbs %} |
5 | 5 | <div class="breadcrumbs"> |
6 | 6 | <a href="../../">{% trans "Home" %}</a> › |
7 | | <a href="../">{{ app_label|capfirst }}</a> › |
| 7 | <a href="../">{{ app_name }}</a> › |
8 | 8 | <a href="./">{{ opts.verbose_name_plural|capfirst }}</a> › |
9 | 9 | {% trans 'Delete multiple objects' %} |
10 | 10 | </div> |
diff -u -r -x '*.pyc' -x '*.patch' /home/seva/django.orig/lib/python2.6/site-packages/django/contrib/admin/templates/admin/object_history.html ./contrib/admin/templates/admin/object_history.html
old
|
new
|
|
4 | 4 | {% block breadcrumbs %} |
5 | 5 | <div class="breadcrumbs"> |
6 | 6 | <a href="../../../../">{% trans 'Home' %}</a> › |
7 | | <a href="../../../">{{ app_label|capfirst }}</a> › |
| 7 | <a href="../../../">{{ app_name }}</a> › |
8 | 8 | <a href="../../">{{ module_name }}</a> › |
9 | 9 | <a href="../">{{ object|truncatewords:"18" }}</a> › |
10 | 10 | {% trans 'History' %} |