From: jordan Date: Sun, 18 Sep 2011 14:30:20 +0000 (+0000) Subject: use different post controls if moderation module is enabled X-Git-Tag: live~143 X-Git-Url: https://git.openstreetmap.org./osqa.git/commitdiff_plain/d10506f728c084a223fb5b17f73922ab543c7e42 use different post controls if moderation module is enabled git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1174 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/forum/templatetags/node_tags.py b/forum/templatetags/node_tags.py index 4eebaf7..c2091f2 100644 --- a/forum/templatetags/node_tags.py +++ b/forum/templatetags/node_tags.py @@ -7,6 +7,7 @@ from django.utils.translation import ungettext, ugettext as _ from django.utils.html import strip_tags from django.utils.encoding import smart_unicode from django.utils.safestring import mark_safe +from django.conf import settings as django_settings from django.core.urlresolvers import reverse from django import template from forum.actions import * @@ -81,7 +82,13 @@ def post_control(text, url, command=False, withprompt=False, confirm=False, titl (copy and " copy" or " ") return {'text': text, 'url': url, 'classes': classes, 'title': title} -@register.inclusion_tag('node/post_controls.html') + +moderation_enabled = False +for m in django_settings.MODULE_LIST: + if m.__name__.endswith('moderation'): + moderation_enabled = True + +@register.inclusion_tag('node/post_controls.html' if not moderation_enabled else "modules/moderation/node/post_controls.html") def post_controls(post, user): controls = [] menu = []