html = markdown(msg)
return html
-class Show:
- title = ''
- def GET(self, page):
- self.title = page
- not_found = u'''
+def show(page, buttons=True):
+ not_found = u'''
Page '%s' not exists
--------------------
- '''
- add_button = '<a href="/%s/edit/%s">Add</a>' % (MOD, page)
- edit_button = '<a href="/%s/edit/%s">Edit</a>' % (MOD, page)
- not_found = markdown(not_found % page) + add_button
+ '''
+ add_button = '<a href="/%s/edit/%s">Add</a>' % (MOD, page)
+ edit_button = '<a href="/%s/edit/%s">Edit</a>' % (MOD, page)
+ not_found = markdown(not_found % page) + add_button
+
+ date, msg = get_page(page)
+ if not msg:
+ return not_found
+ last_edited = ' Last edited: %s ' % date.ctime()
+
+ html = get_html(msg)
+
+ if buttons:
+ html += edit_button + last_edited
- date, msg = get_page(page)
- if not msg:
- return not_found
- last_edited = ' Last edited: %s ' % date.ctime()
+ return html
- html = get_html(msg)
+class Show:
+ title = ''
+ def GET(self, page):
+ self.title = page
+ html = show(page)
+ return html
- return html + edit_button + last_edited
+class Nobts:
+ title = ''
+ def GET(self, page):
+ html = show(page, buttons=False)
+ return html
class Edit:
title = ''