Ejemplo n.º 1
0
def sitemap_body(w,h):
    pathheader(w,h)
    w.hr()
    w.push('div',id='main')
    w.insert('h1','SiteMap')

    rev = h.head.last_paths_changed.revno
    lw = ListWriter(w)

    for wp in h.sitemap():
        lw.move(len(wp.path.strip('/').split('/')))
        w.link_wiki(wp.path, href=h.linker.link('wiki_head',path=wp.path))

    w.pop()
Ejemplo n.º 2
0
def navi(w,h):
    w.link_wiki(u'通常の表示モードに戻る',h.linker.link('wiki_head',path=h.wikifile.path))
    w.hr()
    
    w.text(u'他Revisionナビゲーション:')
    
    lw = ListWriter(w)
    lw.move(1)
    w.text('Head')
    lw.move(2)
    rp = h.linker.link('wiki_rev',rev=h.wikifile.revno,path=h.wikifile.path)
    w.link_wiki('%s'%h.wikifile.revno,href=rp)
    w.text(', ')
    w.a('diff',href=rp+'?cmd=diff')

    lm = h.wikifile.lastmodified
    lw.move(1)
    w.text('Old Modified Revision:')
    w.br()
    for i in range(3):
        if not lm:
            break
        lw.move(2)
        rp = h.linker.link('wiki_rev',rev=lm.revno,path=lm.path)
        w.link_wiki('%s'%lm.revno,href=rp)
        w.text(', ')
        w.a('diff',href=rp+'?cmd=diff')
        lm = lm.previous
    
    lw.move(1)
    w.text('Old Revisions:')
    w.br()
    rev = h.wikifile.revno
    lw.move(2)
    w.text(str(h.wikifile.revno))
    for i in range(3):
        r = rev-1-i
        rr = h.wikifile.switch_rev(r)
        if not rr.exist:
            break
        rp = h.linker.link('wiki_rev',rev=rr.revno,path=rr.path)
        lw.move(2)
        w.link_wiki('%s'%r,href=rp)
        w.text(', ')
        w.a('diff',href=rp+'?cmd=diff')

    lw.finish()