Ticket #1390: updated_app_name_link.diff
File updated_app_name_link.diff, 10.3 KB (added by , 16 years ago) |
---|
-
contrib/admin/media/css/global.css
5 5 a:hover { color: #036; } 6 6 a img { border:none; } 7 7 8 a.section:link, a.section:visited { color: white; text-decoration:none; } 9 8 10 /* GLOBAL DEFAULTS */ 9 11 p, ol, ul, dl { margin:.2em 0 .8em 0; } 10 12 p { padding:0; line-height:140%; } -
contrib/admin/options.py
546 546 'inline_admin_formsets': inline_admin_formsets, 547 547 'errors': AdminErrorList(form, inline_formsets), 548 548 'root_path': self.admin_site.root_path, 549 'app_label': app_label, 549 550 } 550 551 context.update(extra_context or {}) 551 552 return self.render_change_form(request, context, add=True) … … 609 610 'inline_admin_formsets': inline_admin_formsets, 610 611 'errors': AdminErrorList(form, inline_formsets), 611 612 'root_path': self.admin_site.root_path, 613 'app_label': app_label, 612 614 } 613 615 context.update(extra_context or {}) 614 616 return self.render_change_form(request, context, change=True, obj=obj) … … 639 641 'cl': cl, 640 642 'has_add_permission': self.has_add_permission(request), 641 643 'root_path': self.admin_site.root_path, 644 'app_label': app_label, 642 645 } 643 646 context.update(extra_context or {}) 644 647 return render_to_response(self.change_list_template or [ … … 685 688 return HttpResponseRedirect("../../") 686 689 687 690 context = { 688 "title": _("Are you sure?"), 689 "object_name": force_unicode(opts.verbose_name), 690 "object": obj, 691 "deleted_objects": deleted_objects, 692 "perms_lacking": perms_needed, 693 "opts": opts, 694 "root_path": self.admin_site.root_path, 691 'title': _('Are you sure?'), 692 'object_name': opts.verbose_name, 693 'object': obj, 694 'deleted_objects': deleted_objects, 695 'perms_lacking': perms_needed, 696 'opts': opts, 697 'root_path': self.admin_site.root_path, 698 'app_label': app_label, 695 699 } 696 700 context.update(extra_context or {}) 697 701 return render_to_response(self.delete_confirmation_template or [ 698 "admin/%s/%s/delete_confirmation.html"% (app_label, opts.object_name.lower()),699 "admin/%s/delete_confirmation.html"% app_label,700 "admin/delete_confirmation.html"702 'admin/%s/%s/delete_confirmation.html' % (app_label, opts.object_name.lower()), 703 'admin/%s/delete_confirmation.html' % app_label, 704 'admin/delete_confirmation.html' 701 705 ], context, context_instance=template.RequestContext(request)) 702 706 703 707 def history_view(self, request, object_id, extra_context=None): … … 720 724 } 721 725 context.update(extra_context or {}) 722 726 return render_to_response(self.object_history_template or [ 723 "admin/%s/%s/object_history.html"% (opts.app_label, opts.object_name.lower()),724 "admin/%s/object_history.html"% opts.app_label,725 "admin/object_history.html"727 'admin/%s/%s/object_history.html' % (opts.app_label, opts.object_name.lower()), 728 'admin/%s/object_history.html' % opts.app_label, 729 'admin/object_history.html' 726 730 ], context, context_instance=template.RequestContext(request)) 727 731 728 732 class InlineModelAdmin(BaseModelAdmin): -
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 -
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 %} -
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> -
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' %} -
contrib/admin/sites.py
154 154 155 155 if '/' in url: 156 156 return self.model_page(request, *url.split('/', 2)) 157 else: 158 return self.app_index(request,url) 157 159 158 160 raise http.Http404('The requested admin page does not exist.') 159 161 … … 305 307 else: 306 308 app_dict[app_label] = { 307 309 'name': app_label.title(), 310 'app_url': app_label, 308 311 'has_module_perms': has_module_perms, 309 312 'models': [model_dict], 310 313 } … … 350 353 return render_to_response(self.login_template or 'admin/login.html', context, 351 354 context_instance=template.RequestContext(request) 352 355 ) 356 357 def app_index(self, request, app_label): 353 358 359 # Displays the application's index page, which lists all of the application's models 354 360 361 user = request.user 362 has_module_perms = user.has_module_perms(app_label) 363 app_dict = {} 364 for model, model_admin in self._registry.items(): 365 if app_label == model._meta.app_label: 366 if has_module_perms: 367 perms = { 368 'add': user.has_perm("%s.%s" % (app_label, model._meta.get_add_permission())), 369 'change': user.has_perm("%s.%s" % (app_label, model._meta.get_change_permission())), 370 'delete': user.has_perm("%s.%s" % (app_label, model._meta.get_delete_permission())), } 371 # Check whether user has any perm for this module. 372 # If so, add the module to the model_list. 373 if True in perms.values(): 374 model_dict = { 375 'name': capfirst(model._meta.verbose_name_plural), 376 'admin_url': '%s/' % model.__name__.lower(), 377 'perms': perms, 378 } 379 if app_dict: 380 app_dict['models'].append(model_dict) 381 else: 382 app_dict = { 383 'name': app_label.title(), 384 'app_url': '', 385 'has_module_perms': has_module_perms, 386 'models': [model_dict],} 387 if not app_dict: 388 raise http.Http404('The requested admin page does not exist.') 389 # Sort the models alphabetically within each app. 390 app_dict['models'].sort(lambda x, y: cmp(x['name'], y['name'])) 391 392 return render_to_response('admin/app_index.html', { 393 'title': _('%s administration' % capfirst(app_label)), 394 'app_list': [app_dict,], 395 }, context_instance=template.RequestContext(request)) 396 355 397 # This global object represents the default admin site, for the common case. 356 398 # You can instantiate AdminSite in your own code to create a custom admin site. 357 399 site = AdminSite() -
contrib/auth/models.py
70 70 71 71 Three basic permissions -- add, change and delete -- are automatically created for each Django model. 72 72 """ 73 name = models.CharField(_('name'), max_length= 50)73 name = models.CharField(_('name'), max_length=100) 74 74 content_type = models.ForeignKey(ContentType) 75 75 codename = models.CharField(_('codename'), max_length=100) 76 76