X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=influences%2Fadmin.py;h=3b48f930ed86706d21fd55842c666c6f03f2873b;hb=e330eecd9d249ded67a014e2ec5bcac11201c52a;hp=3c380ec27f73822bfb749f8b6855e443065a5bd2;hpb=06863704f30a2025ee82fd89a41716f5ab2cce87;p=matthijs%2Fprojects%2Fxerxes.git diff --git a/influences/admin.py b/influences/admin.py index 3c380ec..3b48f93 100644 --- a/influences/admin.py +++ b/influences/admin.py @@ -6,6 +6,9 @@ from xerxes.influences.models import Character, Influence from django.contrib.contenttypes import generic from threadedcomments.models import ThreadedComment from django.utils.safestring import mark_safe +from django.utils.translation import ugettext as _ +from django.utils.encoding import force_unicode +from forms import get_influence_comment_form class CharacterAdmin(admin.ModelAdmin): list_filter=('status', 'player') @@ -21,6 +24,7 @@ class InfluenceAdmin(admin.ModelAdmin): class Media: js = ('base/js/yahoo-dom-event.js', 'base/js/logger-debug.js') + css = {'all' : ('base/css/admin.css',)} def __call__(self, request, url): if (url and url.endswith('/comments')): @@ -36,11 +40,13 @@ class InfluenceAdmin(admin.ModelAdmin): comments = obj.get_comments(private=True) context = { + 'title' : _('Commentaar: %s') % force_unicode(obj), 'root_path' : self.admin_site.root_path, 'app_label' : self.model._meta.app_label, 'object' : obj, 'opts' : opts, 'comments' : comments, + 'comment_form' : get_influence_comment_form(request.user.is_staff, None)(), 'media' : mark_safe(self.media), } return render_to_response('admin/influences/influence/comments.html', context, RequestContext(request))