auth.wiki supports load
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 2.00.0 (2012-07-29 16:21:39) dev
|
Version 2.00.0 (2012-07-29 16:52:05) dev
|
||||||
|
|||||||
+9
-6
@@ -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]
|
||||||
@@ -4584,7 +4585,9 @@ class Wiki(object):
|
|||||||
cloud=False
|
cloud=False
|
||||||
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
|
||||||
|
|||||||
Reference in New Issue
Block a user