+# -*- coding: utf-8 -*-
+
import datetime
import logging
-from forum import settings
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
from django.utils import simplejson
from django.utils.encoding import smart_unicode
from django.utils.translation import ungettext, ugettext as _
-from django.http import HttpResponse, HttpResponseRedirect, Http404
+from django.http import HttpResponse, Http404
from django.shortcuts import get_object_or_404, render_to_response
-from django.template import RequestContext
-from django.template.loader import render_to_string
from forum.models import *
-from forum.models.node import NodeMetaClass
-from forum.utils.decorators import ajax_method, ajax_login_required
+from forum.utils.decorators import ajax_login_required
from forum.actions import *
from forum.modules import decorate
from forum import settings
}
}
-@decorate.withfn(command)
-def canned_comments(request, post_id):
- user = request.user
-
- # Check whether the user has the required permissions to use the tool.
- if not user.can_use_canned_comments:
- raise CommandException(_("You cannot use the canned comments tool."))
-
- if not request.POST:
- canned_comments = []
- for comment in settings.CANNED_COMMENTS:
- canned_comments.append(smart_unicode(comment))
-
- return render_to_response('node/canned_comments.html', {
- 'canned_comments' : canned_comments,
- }, RequestContext(request))
-
- comment = request.POST.get('comment', '')
-
- return {
- 'commands' : {
- 'canned_comment' : [post_id, comment],
- }
- }
-
#internally grouped views - used by the tagging system
@ajax_login_required
def mark_tag(request, tag=None, **kwargs):#tagging system