summaryrefslogtreecommitdiff
path: root/examples/filebrowser/templates/directory.pt
diff options
context:
space:
mode:
authorianb <devnull@localhost>2005-06-13 06:18:19 +0000
committerianb <devnull@localhost>2005-06-13 06:18:19 +0000
commitfc569bdee88033eaf043cf8cd4fea38e8c96ff9a (patch)
tree83a29689bab45f88121fb0057db5fb00c6dfc539 /examples/filebrowser/templates/directory.pt
parent844ff4d0aba028053971139f33b2b8908836da98 (diff)
downloadpaste-fc569bdee88033eaf043cf8cd4fea38e8c96ff9a.tar.gz
Added new example application (not completely finished), a file browsing application, with lots of Ajax
Diffstat (limited to 'examples/filebrowser/templates/directory.pt')
-rw-r--r--examples/filebrowser/templates/directory.pt42
1 files changed, 42 insertions, 0 deletions
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