added topic view on the left
This commit is contained in:
parent
a13b2c80f5
commit
5bd92689e1
7 changed files with 150 additions and 14 deletions
|
|
@ -31,12 +31,16 @@ def viewblog(request, title) -> HttpResponse:
|
|||
'{% autoescape off %}' +
|
||||
html_form_md +
|
||||
'{% endautoescape %}').render(Context({}))
|
||||
context = {'post': post, 'html': rendered_html}
|
||||
context = {'post': post, 'html': rendered_html, 'roottopics': Topic.objects.all().filter(rootTopic=None),
|
||||
'allposts': Blogpost.objects.all()}
|
||||
|
||||
return render(request, 'blog/viewpost.html', context)
|
||||
|
||||
|
||||
def index(request) -> HttpResponse:
|
||||
return render(request, 'blog/index.html', {"debug": settings.DEBUG})
|
||||
context = {'roottopics': Topic.objects.all().filter(rootTopic=None), 'allposts': Blogpost.objects.all(),
|
||||
'debug': settings.DEBUG}
|
||||
return render(request, 'blog/index.html', context)
|
||||
|
||||
|
||||
@login_required
|
||||
|
|
@ -62,7 +66,9 @@ def order(request) -> HttpResponse:
|
|||
|
||||
@login_required
|
||||
def addpost(request) -> HttpResponse:
|
||||
context = {'alltopics': Topic.objects.all().order_by('name').values(), 'markdown': ''}
|
||||
context = {'alltopics': Topic.objects.all().order_by('name').values(), 'markdown': '',
|
||||
'roottopics': Topic.objects.all().filter(rootTopic=None),
|
||||
'allposts': Blogpost.objects.all()}
|
||||
if request.method == 'POST':
|
||||
title = request.POST['title']
|
||||
markdown = request.POST['markdown']
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue