from django.views.generic.list_detail import object_detail, object_list
from threadedcomments.models import ThreadedComment
from threadedcomments.forms import ThreadedCommentForm
-from threadedcomments.views import comment
+from threadedcomments.views import free_comment
from xerxes.influences.models import Character
from xerxes.influences.models import Influence
from xerxes.tools.forms import ContextModelForm
os = Influence.objects.filter(character__player=request.user)
return render_to_response('influences/influence_list.html', {'object_list' : os}, RequestContext(request))
+def quote_reply(comment):
+ return "\n".join(["> " + l for l in comment.comment.split("\n")])
+
@login_required
def influence_detail(request, object_id):
- def quote_reply(comment):
- return "\n".join(["> " + l for l in comment.comment.split("\n")])
-
o = Influence.objects.get(pk=object_id)
# Don't show other player's influences
if (o.character.player != request.user):
context = {
'object' : o,
'comments' : comments,
- 'comment_form' : get_influence_comment_form(request.user.is_staff, None)
+ 'comment_form' : get_influence_comment_form(request.user.is_staff, None)()
}
return render_to_response('influences/influence_detail.html', context, RequestContext(request))
reply_to = None
# Find the right form class
kwargs['form_class'] = get_influence_comment_form(request.user.is_staff, reply_to)
- return comment(request, edit_id=edit_id, *args, **kwargs)
+ # Override the model, so we don't get a free comment, but a normal
+ # one. We can't use threadedcomments' comment view for that, since
+ # that hardcodes the form_class.
+ kwargs['model'] = ThreadedComment
+ return free_comment(request, edit_id=edit_id, *args, **kwargs)
# vim: set sts=4 sw=4 expandtab: