scribeengine/scribeengine/templates/media/index.mako

57 lines
2.6 KiB
Mako

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>${c.page_title}</title>
% for script in c.scripts:
<script src="/scripts/${script}" type="text/javascript"></script>
% endfor
% if c.jsinit:
<script src="/scripts/${c.jsinit}" type="text/javascript"></script>
% endif
<style type="text/css">
body { margin: 0; padding: 0; font-family: Arial, sans-serif; }
img { border: 0; }
input[type=button] { background: #f0f0f0 url(/images/media-button.png) top left repeat-x; border: 1px solid #ccc; color: #000; height: 24px; }
span.separator { border-left: 1px solid #ccc; height: 24px; margin: 0 5px; overflow: hidden; width: 1px; }
#directory-tree { border-right: 1px solid #999; border-bottom: 1px solid #999; height: 370px; float: left; padding-right: 4px; width: 195px; }
#file-list { border-bottom: 1px solid #999; height: 370px; padding-left: 4px; float: left; width: 396px; }
#button-bar { clear: both; height: 30px; line-height: 30px; }
#file-list ul { list-style: none; margin: 0; padding: 0; }
#file-list ul li { float: left; }
#file-list ul li a.file { border: 1px solid #f0f0f0; display: block; height: 87px; line-height: 87px; list-style: none; margin: 5px; padding: 0; text-align: center; width: 87px; }
#file-list ul li a.caption { color: #666; display: block; font-size: 8pt; text-align: center; text-decoration: none; width: 89px; }
#file-list ul li a.file.selected { border: 1px solid #009; }
#file-list ul li a.caption.selected { color: #009; text-decoration: underline; }
</style>
</head>
<body>
<div id="directory-tree"></div>
<div id="file-list">
<ul>
% for file in c.files:
<li>
<a href="#" class="file"><img src="${file[u'type']}" /></a>
% if len(file[u'name']) > 15:
<a href="#" class="caption" title="${file[u'name']}">${file[u'name'][:12]}...</a>
% else:
<a href="#" class="caption">${file[u'name']}</a>
% endif
</li>
% endfor
</ul>
</div>
<div id="button-bar">
<input type="hidden" id="selected-file" />
<input type="hidden" id="selected-path" />
<input type="button" id="file-select" value="Select"/>
<span class="separator"></span>
<input type="button" id="new-directory" value="New Directory"/>
</div>
<script type="text/javascript">
ScribeEngine.Widgets.tree("#directory-tree", ${c.directories | n}, ScribeEngine.Media.getFiles);
</script>
</body>
</html>