##// END OF EJS Templates
Moved signatures block to the model block. All the signed content is in the 'content' block now. Removed edit time, previous and next posts links from the XML sync output because they can be computed from the post itself and can be changed locally for foreign posts (which breaks the signature)
Moved signatures block to the model block. All the signed content is in the 'content' block now. Removed edit time, previous and next posts links from the XML sync output because they can be computed from the post itself and can be changed locally for foreign posts (which breaks the signature)

File last commit:

r825:1a672b2c default
r838:2b96b9e7 decentral
Show More
preview.py
35 lines | 860 B | text/x-python | PythonLexer
from django.shortcuts import render
from django.template import RequestContext
from django.views.generic import View
from boards.mdx_neboard import bbcode_extended
FORM_QUERY = 'query'
CONTEXT_RESULT = 'result'
CONTEXT_QUERY = 'query'
__author__ = 'neko259'
TEMPLATE = 'boards/preview.html'
class PostPreviewView(View):
def get(self, request):
context = RequestContext(request)
return render(request, TEMPLATE, context)
def post(self, request):
context = RequestContext(request)
if FORM_QUERY in request.POST:
raw_text = request.POST[FORM_QUERY]
if len(raw_text) >= 0:
rendered_text = bbcode_extended(raw_text)
context[CONTEXT_RESULT] = rendered_text
context[CONTEXT_QUERY] = raw_text
return render(request, TEMPLATE, context)