if not descr: descr = humanlink(name)
url = relative_url(name)
if video_re.match(name):
- return '<video controls="1" src="%s">Your browser does not support the HTML5 video tag</video>' % url
+ return '<video controls="1" src="%s">Your browser does not support HTML5 video</video>' % url
elif image_re.match(name):
return '<a href="%s"><img border="0" src="%s" alt="%s" /></a>' % (url, url + url_args(kvargs), descr)
elif file_re.match(name) and not ext_re.search(name): # FIXME: this guesses a wiki page
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("</body></html>")
def _macro_ELAPSED_TIME(*args, **kvargs):
for filename in page_list(self._filename(), file_re):
if image_re.match(filename):
- maxwidth = config_get(image_maxwidth)
+ maxwidth = config_get(image_maxwidth, '')
if maxwidth:
- maxwidth_arg = ' | maxwidth=' + str(maxwidth)
- out += '{{' + self.page_name + '/' + filename + ' | ' + humanlink(filename) + maxwidth_arg + ' | class=thumbleft}}\n'
+ maxwidth = ' | maxwidth=' + str(maxwidth)
+ out += '{{' + self.page_name + '/' + filename + ' | ' + humanlink(filename) + maxwidth + ' | class=thumbleft}}\n'
else:
out += ' * [[' + self.page_name + '/' + filename + ']]\n'
return out
send_guru("Write access denied by ACLs", "error")
return
- filename = ''
- if 'file' in form:
- filename = form['file'].value
-
- print(('<p><b>Editing ' + self.page_name
- + ' for ' + cgi.escape(remote_user())
- + ' from ' + cgi.escape(get_hostname(remote_host()))
- + '</b></p>'))
- print('<div class="editor"><form name="editform" method="post" enctype="multipart/form-data" action="%s">' % relative_url(self.page_name))
- print('<input type="hidden" name="a" value="edit" /><input type="hidden" name="q" value="' + self.page_name + '" />')
- print('<input type="input" id="editor" name="changelog" value="Edit page %s" accesskey="c" /><br />' % (self.page_name))
- print('<textarea wrap="off" spellcheck="true" id="editor" name="savetext" rows="17" cols="100" accesskey="e">%s</textarea>' \
- % cgi.escape(preview or self.get_raw_body(default='')))
- print('<label for="file" accesskey="u">Or Upload a file:</label> <input type="file" name="file" value="%s" />' % filename)
- print("""
- <br />
- <input type="submit" name="save" value="Save" accesskey="s">
- <input type="submit" name="preview" value="Preview" accesskey="p" />
- <input type="reset" value="Reset" />
- <input type="submit" name="cancel" value="Cancel" />
- <br />
- </form></div>
- <script language="javascript">
- <!--
- document.editform.savetext.focus()
- //-->
- </script>
- """)
- print("<p>" + link_tag('EditingTips') + "</p>")
+ 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("<div class='preview'>")
WikiFormatter(preview).print_html()