From: Bernie Innocenti Date: Mon, 17 Aug 2009 20:29:53 +0000 (+0200) Subject: Implement page editor ad a wiki page X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=ab69b32156a6a5b814b825762fed199d11632938;p=geekigeeki.git Implement page editor ad a wiki page --- diff --git a/geekigeeki.py b/geekigeeki.py index 4b95368..1dda0ca 100755 --- a/geekigeeki.py +++ b/geekigeeki.py @@ -341,7 +341,7 @@ def send_footer(mod_string=None): cgi.print_arguments() cgi.print_form(form) cgi.print_environ() - link_inline("sys/footer", kvargs= { 'LAST_MODIFIED': mod_string }) + link_inline("sys/footer", kvargs = { 'LAST_MODIFIED': mod_string }) print("") def _macro_ELAPSED_TIME(*args, **kvargs): @@ -745,35 +745,14 @@ class Page: send_guru("Write access denied by ACLs", "error") return - filename = '' - if 'file' in form: - filename = form['file'].value - - print(('

Editing ' + self.page_name - + ' for ' + cgi.escape(remote_user()) - + ' from ' + cgi.escape(get_hostname(remote_host())) - + '

')) - print('
' % relative_url(self.page_name)) - print('') - print('
' % (self.page_name)) - print('' \ - % cgi.escape(preview or self.get_raw_body(default=''))) - print(' ' % filename) - print(""" -
- - - - -
-
- - """) - print("

" + link_tag('EditingTips') + "

") + if preview is None: + preview = self.get_raw_body(default='') + + link_inline("sys/EditPage", kvargs = { + 'EDIT_BODY': cgi.escape(preview), + #'EDIT_PREVIEW': WikiFormatter(preview).print_html(), + }) + if preview: print("
") WikiFormatter(preview).print_html()