from forum import settings
from forum.views.decorators import login_required
from forum.forms import FeedbackForm
from forum.modules import decorate
from forum.forms import get_next_url
from forum.models import Badge, Award, User, Page
from forum import settings
from forum.views.decorators import login_required
from forum.forms import FeedbackForm
from forum.modules import decorate
from forum.forms import get_next_url
from forum.models import Badge, Award, User, Page
from forum.http_responses import HttpResponseNotFound, HttpResponseIntServerError
from forum.utils.mail import send_template_email
from forum.templatetags.extra_filters import or_preview
from forum.http_responses import HttpResponseNotFound, HttpResponseIntServerError
from forum.utils.mail import send_template_email
from forum.templatetags.extra_filters import or_preview
def static(request, title, content):
return render_to_response('static.html', {'content' : content, 'title': title},
def static(request, title, content):
return render_to_response('static.html', {'content' : content, 'title': title},
def media(request, skin, path):
response = serve(request, "%s/media/%s" % (skin, path),
document_root=os.path.join(os.path.dirname(os.path.dirname(__file__)), 'skins').replace('\\', '/'))
def media(request, skin, path):
response = serve(request, "%s/media/%s" % (skin, path),
document_root=os.path.join(os.path.dirname(os.path.dirname(__file__)), 'skins').replace('\\', '/'))
if ('charset=' not in content_type):
if (content_type.startswith('text') or content_type=='application/x-javascript'):
content_type += '; charset=utf-8'
if ('charset=' not in content_type):
if (content_type.startswith('text') or content_type=='application/x-javascript'):
content_type += '; charset=utf-8'
send_template_email(recipients, "notifications/feedback.html", context)
msg = _('Thanks for the feedback!')
send_template_email(recipients, "notifications/feedback.html", context)
msg = _('Thanks for the feedback!')
return HttpResponseRedirect(get_next_url(request))
else:
form = FeedbackForm(request.user, initial={'next':get_next_url(request)})
return HttpResponseRedirect(get_next_url(request))
else:
form = FeedbackForm(request.user, initial={'next':get_next_url(request)})
@decorators.render('badges.html', 'badges', _('badges'), weight=300)
def badges(request):
@decorators.render('badges.html', 'badges', _('badges'), weight=300)
def badges(request):
badges = sorted([Badge.objects.get(id=id) for id in BadgesMeta.by_id.keys()], lambda b1, b2: cmp(b1.name, b2.name))
if request.user.is_authenticated():
badges = sorted([Badge.objects.get(id=id) for id in BadgesMeta.by_id.keys()], lambda b1, b2: cmp(b1.name, b2.name))
if request.user.is_authenticated():