diff options
Diffstat (limited to 'examples/filebrowser/templates')
| -rw-r--r-- | examples/filebrowser/templates/copybin.pt | 28 | ||||
| -rw-r--r-- | examples/filebrowser/templates/directory.pt | 42 | ||||
| -rw-r--r-- | examples/filebrowser/templates/generic_error.pt | 7 | ||||
| -rw-r--r-- | examples/filebrowser/templates/standard_template.pt | 55 | ||||
| -rw-r--r-- | examples/filebrowser/templates/view_file.pt | 26 |
5 files changed, 158 insertions, 0 deletions
diff --git a/examples/filebrowser/templates/copybin.pt b/examples/filebrowser/templates/copybin.pt new file mode 100644 index 0000000..a2d011c --- /dev/null +++ b/examples/filebrowser/templates/copybin.pt @@ -0,0 +1,28 @@ +<metal:tpl define-macro="copybin"> + +<tal:if condition="options/copyfiles"> + +<tal:for repeat="f options/copyfiles"> + <div tal:attributes="class python: 'item %s' % test(repeat['f'].odd(), + 'odd', 'even'); + id f/id"> + <div class="controls"> + <span tal:replace="structure python: servlet.globalurl('copybin', + remove=f['filename']).remote('copybin').link(servlet.icons( + 'remove.png', title='Remove from clipboard'))"/> + </div> + <a tal:attributes="href f/url" + tal:content="f/filename" /> + <tal:if condition="f/cut">(cut)</tal:if> + </div> +</tal:for> + +<span style="float: right" + tal:content="structure python: servlet.globalurl('copybin', clear='t').remote('copybin').link('clear')"/> +</tal:if> + +<tal:if condition="not: options/copyfiles"> +the bin is empty +</tal:if> + +</metal:tpl> diff --git a/examples/filebrowser/templates/directory.pt b/examples/filebrowser/templates/directory.pt new file mode 100644 index 0000000..6215086 --- /dev/null +++ b/examples/filebrowser/templates/directory.pt @@ -0,0 +1,42 @@ +<html metal:use-macro="here/standard_template.pt/macros/page"> +<metal:body fill-slot="body"> + +<div class="header"> + <div class="controls"> + <span tal:replace="structure python: + servlet.pastebutton(servlet.path)"/> + </div> + <tal:if condition="python: not servlet.fragment and options.get('parent')"> + Parent: <a tal:attributes="href options/parent/url" + tal:content="options/parent/name"/><br> + </tal:if> + Files: <span tal:replace="python: len(options['files'])"/> +</div> + +<tal:for repeat="f options/files"> + <div tal:attributes="class python: 'item %s' % test(repeat['f'].odd(), + 'odd', 'even')" + tal:define="toggle f/url/toggle"> + <div class="controls"> + <span tal:condition="python: f['path'].check(dir=1)" + tal:replace="structure python: servlet.pastebutton(f['path'])"/> + <span tal:replace="structure python: servlet.copybutton(f['path'], 'cut')"/> + <span tal:replace="structure python: servlet.copybutton(f['path'], + 'copy')"/> + </div> + <span tal:replace="structure python: toggle.link( + servlet.icons('1downarrow.png', alt='display'), + shownhtml=servlet.icons('1uparrow.png', alt='hide'))"/> + <a tal:attributes="href f/url" + tal:content="f/name" /> + <blockquote tal:attributes="id toggle/id" + style="display: none" class="subdisplay">...</blockquote> + </div> +</tal:for> + +<p tal:condition="not: options/files"> +There are no files in this directory +</p> + +</metal:body> +</html>
\ No newline at end of file diff --git a/examples/filebrowser/templates/generic_error.pt b/examples/filebrowser/templates/generic_error.pt new file mode 100644 index 0000000..7b32820 --- /dev/null +++ b/examples/filebrowser/templates/generic_error.pt @@ -0,0 +1,7 @@ +<html metal:use-macro="here/standard_template.pt/macros/page"> +<metal:body fill-slot="body"> + +<tal:block replace="structure options/error_message" /> + +</metal:body> +</html>
\ No newline at end of file diff --git a/examples/filebrowser/templates/standard_template.pt b/examples/filebrowser/templates/standard_template.pt new file mode 100644 index 0000000..9cf589a --- /dev/null +++ b/examples/filebrowser/templates/standard_template.pt @@ -0,0 +1,55 @@ +<metal:tpl define-macro="page"> +<tal:if condition="not: servlet/fragment"> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" + "http://www.w3.org/TR/REC-html40/loose.dtd"> +<html lang="en-US"> +<head> +<title tal:content="servlet/title">title</title> +<link rel="stylesheet" type="text/css" + tal:attributes="href python: servlet.app_static_url + '/stylesheet.css'"> +<script type="text/javascript" + tal:attributes="src string: ${servlet/app_url}/_js-lib/prototype-1.2.0.js"> +</script> +<script type="text/javascript" + tal:attributes="src string: ${servlet/app_url}/_js-lib/common.js"> +</script> + +<metal:slot define-slot="extra_head"></metal:slot> + +</head> +<body> + +<fieldset id="copybinframe"> +<legend>clipboard <a onclick="toggle('copybin', {link: this})" + tal:attributes="hiddenhtml + servlet/icons/1uparrow.png/alt=show/title=show+clipboard/html" + tal:content="structure servlet/icons/1downarrow.png/alt=hide/title=hide+clipboard/html"/></legend> +<div id="copybin"> +<metal:tpl use-macro="here/copybin.pt/macros/copybin"> +</metal:tpl> +</div> +</fieldset> + +<h1><tal:mark replace="servlet/html_title"/></h1> + +<div class="notifyMessage" + tal:condition="servlet/message" + tal:content="structure servlet/message/html"> + [This is where the notification messages go] +</div> + +<div id="content"> +<metal:tpl define-slot="body"> +[This page has not customized its "body" slot] +</metal:tpl> +</div> + +</body> +</html> +</tal:if> +<tal:if condition="servlet/fragment"> +<metal:tpl define-slot="body"> +[This page has not customized its "body" slot] +</metal:tpl> +</tal:if> +</metal:tpl> diff --git a/examples/filebrowser/templates/view_file.pt b/examples/filebrowser/templates/view_file.pt new file mode 100644 index 0000000..f0904df --- /dev/null +++ b/examples/filebrowser/templates/view_file.pt @@ -0,0 +1,26 @@ +<html metal:use-macro="here/standard_template.pt/macros/page"> +<metal:body fill-slot="body"> + +<p> +<tal:if condition="not: servlet/fragment"> +<tal:if condition="options/parent | nothing"> +Parent: <a tal:attributes="href options/parent/url" + tal:content="options/parent/name">name</a><br> +</tal:if> +</tal:if> +Mimetype: <span tal:replace="options/mimetype"/><br> +<a tal:attributes="href servlet/pathurl/action=download">download</a> +</p> + +<pre tal:condition="python: options['content'] and not options['use_iframe']" + tal:content="options/content">content</pre> + +<img tal:condition="options/is_image" + tal:attributes="src servlet/pathurl/action=download"> + +<iframe tal:condition="options/use_iframe" + tal:attributes="src servlet/pathurl/action=download/html=clean" + width="100%" height="200" name="test"></iframe> + +</metal:body> +</html>
\ No newline at end of file |
