From 3e10bc7f16dc17904a2fd3687a4491bcd2bb22a4 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Sun, 29 Jul 2012 16:52:11 -0500 Subject: [PATCH] auth.wiki supports load --- VERSION | 2 +- gluon/tools.py | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/VERSION b/VERSION index 9f29813a..41a60448 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.00.0 (2012-07-29 16:21:39) dev +Version 2.00.0 (2012-07-29 16:52:05) dev diff --git a/gluon/tools.py b/gluon/tools.py index 54c60486..54cda9cb 100644 --- a/gluon/tools.py +++ b/gluon/tools.py @@ -4453,6 +4453,8 @@ class Wiki(object): match = self.regex_redirect.match(page.body) if match: redirect(match.group(1)) return dict(content=XML(page.html)) + elif current.request.extension == 'load': + return page.html if page else '' else: if not page: raise HTTP(404) @@ -4565,17 +4567,16 @@ class Wiki(object): *fields,**dict(orderby=orderby or ~count, groupby=db.wiki_page.id, limitby=limitby)) - if request.extension=='html': + if request.extension in ('html','load'): if not pages: content.append(DIV(T("No results",_class='w2p_wiki_form'))) def link(t): return A(t,_href=URL(args='_search',vars=dict(tags=t))) - items = [DIV(H3(A(p.wiki_page.title, - _href=URL(args=p.wiki_page.slug))), - MARKMIN(first_paragraph(p.wiki_page.body)) \ + items = [DIV(H3(A(p.title,_href=URL(args=p.slug))), + MARKMIN(first_paragraph(p.body)) \ if preview else '', SPAN(*[link(t.strip()) for t in \ - p.wiki_page.tags.split(',') \ + p.tags.split(',') \ if t.strip()]), _class='w2p_wiki_tags') for p in pages] @@ -4584,7 +4585,9 @@ class Wiki(object): cloud=False content = [p.as_dict() for p in pages] elif cloud: - content.append(self.cloud()['content']) + content.append(self.cloud()['content']) + if request.extension=='load': + return content return dict(content=content) def cloud(self): db = self.auth.db