auth.wiki supports load

This commit is contained in:
mdipierro
2012-07-29 16:52:11 -05:00
parent 86986b5ae1
commit 3e10bc7f16
2 changed files with 10 additions and 7 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.00.0 (2012-07-29 16:21:39) dev Version 2.00.0 (2012-07-29 16:52:05) dev
+8 -5
View File
@@ -4453,6 +4453,8 @@ class Wiki(object):
match = self.regex_redirect.match(page.body) match = self.regex_redirect.match(page.body)
if match: redirect(match.group(1)) if match: redirect(match.group(1))
return dict(content=XML(page.html)) return dict(content=XML(page.html))
elif current.request.extension == 'load':
return page.html if page else ''
else: else:
if not page: if not page:
raise HTTP(404) raise HTTP(404)
@@ -4565,17 +4567,16 @@ class Wiki(object):
*fields,**dict(orderby=orderby or ~count, *fields,**dict(orderby=orderby or ~count,
groupby=db.wiki_page.id, groupby=db.wiki_page.id,
limitby=limitby)) limitby=limitby))
if request.extension=='html': if request.extension in ('html','load'):
if not pages: if not pages:
content.append(DIV(T("No results",_class='w2p_wiki_form'))) content.append(DIV(T("No results",_class='w2p_wiki_form')))
def link(t): def link(t):
return A(t,_href=URL(args='_search',vars=dict(tags=t))) return A(t,_href=URL(args='_search',vars=dict(tags=t)))
items = [DIV(H3(A(p.wiki_page.title, items = [DIV(H3(A(p.title,_href=URL(args=p.slug))),
_href=URL(args=p.wiki_page.slug))), MARKMIN(first_paragraph(p.body)) \
MARKMIN(first_paragraph(p.wiki_page.body)) \
if preview else '', if preview else '',
SPAN(*[link(t.strip()) for t in \ SPAN(*[link(t.strip()) for t in \
p.wiki_page.tags.split(',') \ p.tags.split(',') \
if t.strip()]), if t.strip()]),
_class='w2p_wiki_tags') _class='w2p_wiki_tags')
for p in pages] for p in pages]
@@ -4585,6 +4586,8 @@ class Wiki(object):
content = [p.as_dict() for p in pages] content = [p.as_dict() for p in pages]
elif cloud: elif cloud:
content.append(self.cloud()['content']) content.append(self.cloud()['content'])
if request.extension=='load':
return content
return dict(content=content) return dict(content=content)
def cloud(self): def cloud(self):
db = self.auth.db db = self.auth.db