mirror of https://github.com/django/django.git
Reverted [17378] until a public API is available for application labels.
This will allow to solve the i18n of such labels in a more holistic way without the need to introduce temporary, undocumented mechanisms to translate them. Refs #3591, #10436 git-svn-id: http://code.djangoproject.com/svn/django/trunk@17389 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
7beb0db79b
commit
752a43e245
|
@ -358,7 +358,7 @@ class AdminSite(object):
|
||||||
app_dict[app_label]['models'].append(model_dict)
|
app_dict[app_label]['models'].append(model_dict)
|
||||||
else:
|
else:
|
||||||
app_dict[app_label] = {
|
app_dict[app_label] = {
|
||||||
'name': app_label,
|
'name': app_label.title(),
|
||||||
'app_url': reverse('admin:app_list', kwargs={'app_label': app_label}, current_app=self.name),
|
'app_url': reverse('admin:app_list', kwargs={'app_label': app_label}, current_app=self.name),
|
||||||
'has_module_perms': has_module_perms,
|
'has_module_perms': has_module_perms,
|
||||||
'models': [model_dict],
|
'models': [model_dict],
|
||||||
|
@ -415,7 +415,7 @@ class AdminSite(object):
|
||||||
# something to display, add in the necessary meta
|
# something to display, add in the necessary meta
|
||||||
# information.
|
# information.
|
||||||
app_dict = {
|
app_dict = {
|
||||||
'name': app_label,
|
'name': app_label.title(),
|
||||||
'app_url': '',
|
'app_url': '',
|
||||||
'has_module_perms': has_module_perms,
|
'has_module_perms': has_module_perms,
|
||||||
'models': [model_dict],
|
'models': [model_dict],
|
||||||
|
@ -425,7 +425,7 @@ class AdminSite(object):
|
||||||
# Sort the models alphabetically within each app.
|
# Sort the models alphabetically within each app.
|
||||||
app_dict['models'].sort(key=lambda x: x['name'])
|
app_dict['models'].sort(key=lambda x: x['name'])
|
||||||
context = {
|
context = {
|
||||||
'title': _('%(app_label)s administration') % {'app_label': capfirst(_(app_label))},
|
'title': _('%s administration') % capfirst(app_label),
|
||||||
'app_list': [app_dict],
|
'app_list': [app_dict],
|
||||||
}
|
}
|
||||||
context.update(extra_context or {})
|
context.update(extra_context or {})
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
|
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
|
||||||
›
|
›
|
||||||
{% for app in app_list %}
|
{% for app in app_list %}
|
||||||
{% trans app.name|title %}
|
{% blocktrans with app.name as name %}{{ name }}{% endblocktrans %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
{% block breadcrumbs %}
|
{% block breadcrumbs %}
|
||||||
<div class="breadcrumbs">
|
<div class="breadcrumbs">
|
||||||
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
|
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
|
||||||
› <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{% trans opts.app_label|capfirst|escape %}</a>
|
› <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_label|capfirst|escape }}</a>
|
||||||
› <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst|escape }}</a>
|
› <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>
|
||||||
› <a href="{% url opts|admin_urlname:'changelist' %}{{ original.pk }}">{{ original|truncatewords:"18" }}</a>
|
› <a href="{% url opts|admin_urlname:'changelist' %}{{ original.pk }}">{{ original|truncatewords:"18" }}</a>
|
||||||
› {% trans 'Change password' %}
|
› {% trans 'Change password' %}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
{% block breadcrumbs %}
|
{% block breadcrumbs %}
|
||||||
<div class="breadcrumbs">
|
<div class="breadcrumbs">
|
||||||
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
|
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
|
||||||
› <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{% trans app_label|capfirst|escape %}</a>
|
› <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ app_label|capfirst|escape }}</a>
|
||||||
› {% if has_change_permission %}<a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst|escape }}</a>{% else %}{{ opts.verbose_name_plural|capfirst|escape }}{% endif %}
|
› {% if has_change_permission %}<a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>{% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %}
|
||||||
› {% if add %}{% trans 'Add' %} {{ opts.verbose_name }}{% else %}{{ original|truncatewords:"18" }}{% endif %}
|
› {% if add %}{% trans 'Add' %} {{ opts.verbose_name }}{% else %}{{ original|truncatewords:"18" }}{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -41,8 +41,8 @@
|
||||||
{% block breadcrumbs %}
|
{% block breadcrumbs %}
|
||||||
<div class="breadcrumbs">
|
<div class="breadcrumbs">
|
||||||
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
|
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
|
||||||
› <a href="{% url 'admin:app_list' app_label=cl.opts.app_label %}">{% trans app_label|capfirst|escape %}</a>
|
› <a href="{% url 'admin:app_list' app_label=cl.opts.app_label %}">{{ app_label|capfirst|escape }}</a>
|
||||||
› {{ cl.opts.verbose_name_plural|capfirst|escape }}
|
› {{ cl.opts.verbose_name_plural|capfirst }}
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
{% block breadcrumbs %}
|
{% block breadcrumbs %}
|
||||||
<div class="breadcrumbs">
|
<div class="breadcrumbs">
|
||||||
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
|
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
|
||||||
› <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{% trans app_label|capfirst|escape %}</a>
|
› <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ app_label|capfirst }}</a>
|
||||||
› <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst|escape }}</a>
|
› <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst|escape }}</a>
|
||||||
› <a href="{% url opts|admin_urlname:'changelist' %}{{ object.pk }}">{{ object|truncatewords:"18" }}</a>
|
› <a href="{% url opts|admin_urlname:'changelist' %}{{ object.pk }}">{{ object|truncatewords:"18" }}</a>
|
||||||
› {% trans 'Delete' %}
|
› {% trans 'Delete' %}
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
{% block breadcrumbs %}
|
{% block breadcrumbs %}
|
||||||
<div class="breadcrumbs">
|
<div class="breadcrumbs">
|
||||||
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
|
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
|
||||||
› <a href="{% url 'admin:app_list' app_label=app_label %}">{% trans app_label|capfirst|escape %}</a>
|
› <a href="{% url 'admin:app_list' app_label=app_label %}">{{ app_label|capfirst|escape }}</a>
|
||||||
› <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst|escape }}</a>
|
› <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>
|
||||||
› {% trans 'Delete multiple objects' %}
|
› {% trans 'Delete multiple objects' %}
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
{% if app_list %}
|
{% if app_list %}
|
||||||
{% for app in app_list %}
|
{% for app in app_list %}
|
||||||
<div class="module">
|
<div class="module">
|
||||||
<table summary="{% blocktrans with name=app.name|title %}Models available in the {{ name }} application.{% endblocktrans %}">
|
<table summary="{% blocktrans with name=app.name %}Models available in the {{ name }} application.{% endblocktrans %}">
|
||||||
<caption><a href="{{ app.app_url }}" class="section">{% trans app.name|title %}</a></caption>
|
<caption><a href="{{ app.app_url }}" class="section">{% blocktrans with name=app.name %}{{ name }}{% endblocktrans %}</a></caption>
|
||||||
{% for model in app.models %}
|
{% for model in app.models %}
|
||||||
<tr>
|
<tr>
|
||||||
{% if model.admin_url %}
|
{% if model.admin_url %}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
{% block breadcrumbs %}
|
{% block breadcrumbs %}
|
||||||
<div class="breadcrumbs">
|
<div class="breadcrumbs">
|
||||||
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
|
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
|
||||||
› <a href="{% url 'admin:app_list' app_label=app_label %}">{% trans app_label|capfirst|escape %}</a>
|
› <a href="{% url 'admin:app_list' app_label=app_label %}">{{ app_label|capfirst|escape }}</a>
|
||||||
› <a href="{% url opts|admin_urlname:'changelist' %}">{{ module_name }}</a>
|
› <a href="{% url opts|admin_urlname:'changelist' %}">{{ module_name }}</a>
|
||||||
› <a href="{% url opts|admin_urlname:'changelist' %}{{ object.pk }}">{{ object|truncatewords:"18" }}</a>
|
› <a href="{% url opts|admin_urlname:'changelist' %}{{ object.pk }}">{{ object|truncatewords:"18" }}</a>
|
||||||
› {% trans 'History' %}
|
› {% trans 'History' %}
|
||||||
|
|
Loading…
Reference in New Issue