Ticket #1390: updated_app_name_link2.diff
File updated_app_name_link2.diff, 8.7 KB (added by , 16 years ago) |
---|
-
django/contrib/admin/media/css/global.css
4 4 a:link, a:visited { color: #5b80b2; text-decoration:none; } 5 5 a:hover { color: #036; } 6 6 a img { border:none; } 7 a.section:link, a.section:visited { color: white; text-decoration:none; } 7 8 8 9 /* GLOBAL DEFAULTS */ 9 10 p, ol, ul, dl { margin:.2em 0 .8em 0; } -
django/contrib/admin/options.py
519 519 'inline_admin_formsets': inline_admin_formsets, 520 520 'errors': helpers.AdminErrorList(form, formsets), 521 521 'root_path': self.admin_site.root_path, 522 'app_label': app_label, 522 523 } 523 524 context.update(extra_context or {}) 524 525 return self.render_change_form(request, context, add=True) … … 597 598 'inline_admin_formsets': inline_admin_formsets, 598 599 'errors': helpers.AdminErrorList(form, formsets), 599 600 'root_path': self.admin_site.root_path, 601 'app_label': app_label, 600 602 } 601 603 context.update(extra_context or {}) 602 604 return self.render_change_form(request, context, change=True, obj=obj) … … 628 630 'cl': cl, 629 631 'has_add_permission': self.has_add_permission(request), 630 632 'root_path': self.admin_site.root_path, 633 'app_label': app_label, 631 634 } 632 635 context.update(extra_context or {}) 633 636 return render_to_response(self.change_list_template or [ … … 682 685 "perms_lacking": perms_needed, 683 686 "opts": opts, 684 687 "root_path": self.admin_site.root_path, 688 "app_label": app_label, 685 689 } 686 690 context.update(extra_context or {}) 687 691 return render_to_response(self.delete_confirmation_template or [ -
django/contrib/admin/templates/admin/change_list.html
5 5 6 6 {% block bodyclass %}change-list{% endblock %} 7 7 8 {% if not is_popup %}{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">{% trans "Home" %}</a> › {{ cl.opts.verbose_name_plural|capfirst|escape }}</div>{% endblock %}{% endif %}8 {% if not is_popup %}{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">{% trans "Home" %}</a> › <a href="../">{{ app_label|capfirst|escape }}</a> › {{ cl.opts.verbose_name_plural|capfirst|escape }}</div>{% endblock %}{% endif %} 9 9 10 10 {% block coltype %}flex{% endblock %} 11 11 -
django/contrib/admin/templates/admin/index.html
16 16 {% for app in app_list %} 17 17 <div class="module"> 18 18 <table summary="{% blocktrans with app.name as name %}Models available in the {{ name }} application.{% endblocktrans %}"> 19 <caption> {% blocktrans with app.name as name %}{{ name }}{% endblocktrans %}</caption>19 <caption><a href="{{ app.app_url }}" class="section">{% blocktrans with app.name as name %}{{ name }}{% endblocktrans %}</a></caption> 20 20 {% for model in app.models %} 21 21 <tr> 22 22 {% if model.perms.change %} -
django/contrib/admin/templates/admin/app_index.html
1 {% extends "admin/index.html" %} 2 {% load i18n %} 3 4 {% if not is_popup %} 5 6 {% block breadcrumbs %} 7 <div class="breadcrumbs"><a href="../"> 8 {% trans "Home" %}</a> › 9 {% for app in app_list %} 10 {% blocktrans with app.name as name %}{{ name }}{% endblocktrans %} 11 {% endfor %}</div>{% endblock %} 12 13 {% endif %} 14 15 {% block sidebar %}{% endblock %} 16 No newline at end of file -
django/contrib/admin/templates/admin/change_form.html
15 15 {% block breadcrumbs %}{% if not is_popup %} 16 16 <div class="breadcrumbs"> 17 17 <a href="../../../">{% trans "Home" %}</a> › 18 <a href="../../">{{ app_label|capfirst|escape }}</a> › 18 19 <a href="../">{{ opts.verbose_name_plural|capfirst }}</a> › 19 20 {% if add %}{% trans "Add" %} {{ opts.verbose_name }}{% else %}{{ original|truncatewords:"18" }}{% endif %} 20 21 </div> -
django/contrib/admin/templates/admin/delete_confirmation.html
4 4 {% block breadcrumbs %} 5 5 <div class="breadcrumbs"> 6 6 <a href="../../../../">{% trans "Home" %}</a> › 7 <a href="../../../">{{ app_label|capfirst|escape }}</a> › 7 8 <a href="../../">{{ opts.verbose_name_plural|capfirst }}</a> › 8 9 <a href="../">{{ object|escape|truncatewords:"18" }}</a> › 9 10 {% trans 'Delete' %} -
django/contrib/admin/sites.py
170 170 else: 171 171 if '/' in url: 172 172 return self.model_page(request, *url.split('/', 2)) 173 else: 174 return self.app_index(request,url) 173 175 174 176 raise http.Http404('The requested admin page does not exist.') 175 177 … … 314 316 else: 315 317 app_dict[app_label] = { 316 318 'name': app_label.title(), 319 'app_url': app_label, 317 320 'has_module_perms': has_module_perms, 318 321 'models': [model_dict], 319 322 } … … 359 362 return render_to_response(self.login_template or 'admin/login.html', context, 360 363 context_instance=template.RequestContext(request) 361 364 ) 365 366 def app_index(self, request, app_label): 362 367 368 user = request.user 369 has_module_perms = user.has_module_perms(app_label) 370 app_dict = {} 371 for model, model_admin in self._registry.items(): 372 if app_label == model._meta.app_label: 373 if has_module_perms: 374 perms = { 375 'add': user.has_perm("%s.%s" % (app_label, model._meta.get_add_permission())), 376 'change': user.has_perm("%s.%s" % (app_label, model._meta.get_change_permission())), 377 'delete': user.has_perm("%s.%s" % (app_label, model._meta.get_delete_permission())), } 378 # Check whether user has any perm for this module. 379 # If so, add the module to the model_list. 380 if True in perms.values(): 381 model_dict = { 382 'name': capfirst(model._meta.verbose_name_plural), 383 'admin_url': '%s/' % model.__name__.lower(), 384 'perms': perms,} 385 if app_dict: 386 app_dict['models'].append(model_dict), 387 else: 388 app_dict = { 389 'name': app_label.title(), 390 'app_url': '', 391 'has_module_perms': has_module_perms, 392 'models': [model_dict],} 393 if not app_dict: 394 raise http.Http404('The requested admin page does not exist.') 395 # Sort the models alphabetically within each app. 396 app_dict['models'].sort(lambda x, y: cmp(x['name'], y['name'])) 397 return render_to_response('admin/app_index.html', { 398 'title': _('%s administration' % capfirst(app_label)), 399 'app_list': [app_dict,],} 400 , context_instance=template.RequestContext(request)) 363 401 364 402 # This global object represents the default admin site, for the common case. 365 403 # You can instantiate AdminSite in your own code to create a custom admin site.