summaryrefslogtreecommitdiff
path: root/app/builder/views.py
blob: cb9c119845db614e9dfa76c709af8b3cd80d5fd4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from django.shortcuts import render
from django.template import RequestContext
#from builder.base import BuildWriting, BuildWritingFeed, BuildMap, BuildPhotos, BuildProjects, BuildSitemap
#from jrnl.build import archive_builder, detail_builder, home_builder, rss_builder, map_builder
from books.build import builder as book_builder
from pages.build import BuildPages, BuildHome
from posts.build import BuildJrnl, BuildFieldNotes, BuildSrc, BuildGuide
#from lttr.build import lttr_builder

def do_build(request):
    section = request.GET.get('id', '')
    context = {}
    if section == 'builddetails':
        context = {'message': 'Writing Jrnl Permalinks to Disk'}
        p = BuildJrnl("posts", "post")
        p.build_latest()
        p.build_detail_view()
    elif section == 'writingarchives':
        context = {'message': 'Writing Jrnl Archives to Disk'}
        BuildJrnl("posts", "post").build_arc()
    elif section == 'buildrss':
        context = {'message': 'Writing RSS to Disk'}
        BuildJrnl("posts", "post").build_feed("jrnl:feed")
    elif section == 'homepage':
        context = {'message': 'Writing index to Disk'}
        BuildHome("pages", "homepage").build()
    elif section == 'pages':
        context = {'message': 'Writing Pages to Disk'}
        BuildPages("pages", "page", 'luxagraf.net').build()
    elif section == 'lttr_archive':
        context = {'message': 'Writing newsletter archives to Disk'}
        #lttr_builder()
    elif section == 'buildbooks':
        context = {'message': 'Writing Book Pages to Disk'}
        book_builder()
    return render(request, 'admin/message.html', context)