~widelands-dev/widelands-website/trunk

« back to all changes in this revision

Viewing changes to pybb/views.py

  • Committer: Holger Rapp
  • Date: 2010-01-01 21:35:23 UTC
  • mto: (173.3.2 widelands)
  • mto: This revision was merged to the branch mainline in revision 176.
  • Revision ID: rapp@mrt.uka.de-20100101213523-53rcapbemm69ep6u
Made the site compatible to django 1.1 and all the various packages

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
import math
2
 
from mainpage.templatetags.wl_markdown import do_wl_markdown
 
2
from mainpage.templatetags.wl_markdown import do_wl_markdown as Markdown
3
3
from pybb.markups import mypostmarkup 
4
4
 
5
5
from django.shortcuts import get_object_or_404
18
18
from pybb import settings as pybb_settings
19
19
from pybb.orm import load_related
20
20
 
21
 
try:
22
 
    from notification import models as notification
23
 
except ImportError:
24
 
    notification = None
25
 
 
26
21
def index_ctx(request):
27
22
    quick = {'posts': Post.objects.count(),
28
23
             'topics': Topic.objects.count(),
170
165
 
171
166
    if form.is_valid():
172
167
        post = form.save();
173
 
        if not topic:
174
 
            post.topic.subscribers.add(request.user)
175
168
        return HttpResponseRedirect(post.get_absolute_url())
176
169
 
177
170
    if topic:
359
352
    if markup == 'bbcode':
360
353
        html = mypostmarkup.markup(content, auto_urls=False)
361
354
    elif markup == 'markdown':
362
 
        html = unicode(do_wl_markdown(content, safe_mode='escape', wikiwords=False))
 
355
        html = unicode(Markdown(content, safe_mode='escape'))
363
356
 
364
357
 
365
358
    html = urlize(html)