Commit ae7808a3 authored by Michael Murtaugh's avatar Michael Murtaugh
Browse files

new self contained Sconstruct + template to use with just scons

parent a4b82914
This diff is collapsed.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Index of {{filename|default("/", True)}}</title>
{%- for stylesheet in stylesheets %}
<link rel="stylesheet" type="text/css" href="{{stylesheet}}">
{%- endfor %}
{%- for script in scripts %}
<script src="{{script}}"></script>
{%- endfor %}
</head>
<body vocab="http://activearchives.org/terms/" typeof="mediafolder">
<h1 class="breadcrumbs">{% for b in breadcrumbs %}
{%- if not loop.last -%}
<a href="{{b.relpath}}">
{%- else -%}
<b class="active" property="dcterms:title" content="{% if title %}{{title}}{%else%}{{b.name|filename2title}}{%endif%}">
{%- endif -%}
{%- if b.name == "/" -%}&blacktriangle;{%- else -%}{{b.name|filename2title}}{%endif%}
{%- if not loop.last -%}</a> /{%- else -%} </b>{%endif%}
{% endfor %}
</h1>
<div class="description" property="dcterms:description">{% if description %}{{description|markdown|add_attribute_to_links("property", "hasTag")}}{% endif %}</div>
<!-- <h1>{{filename|default("/", True)}}</h1> -->
{% set colcount = 5 %}
{% with items=contents %}
<table>
<thead>
<tr>
<th valign="top">&nbsp;</th>
<th>Name</th>
<th>Last modified</th>
<th>Size</th>
{% if 'pages' in allkeys %}<th>Pages</th>{% set colcount=colcount+1 %}{% endif %}
{# {% if 'title' in allkeys %}<th>Title</th>{% set colcount=colcount+1 %}{% endif %} #}
{# {% if 'author' in allkeys %}<th>Author</th>{% set colcount=colcount+1 %}{% endif %} #}
{% if 'duration' in allkeys %}<th>Duration</th>{% set colcount=colcount+1 %}{% endif %}
<th>Description</th>
</tr>
<tr><td colspan="{{ colcount }}"><hr></td></tr>
</thead>
<tbody class="files">
{% for i in items %}
{% if i.type != 'file' %}
<!-- DIRECTORY -->
{% set d = i %}
<tr class="folder" property="dcterms:hasPart" resource="{{d.id}}" typeof="mediafolder">
<td class="icon" valign="top">📁</td>
<td class="name"><a href="{{d.id}}">{{d.filename}}/</a></td>
<td class="lastmod" align="right">{% if d.last_modification %}{{d.last_modification|strftime}}{%else%}&mdash;{%endif%}</td>
<td class="size" align="right" content="{{d.total_bytes}}">{{d.total_bytes|filesizeformat}}</td>
{% if 'pages' in allkeys %}<td class="pages">&mdash;</td>{% endif %}
{# {% if 'title' in allkeys %}<td class="title">&mdash;</td>{% endif %} #}
{# {% if 'author' in allkeys %}<td class="author">&mdash;</td>{% endif %} #}
{% if 'duration' in allkeys %}<td class="duration">&mdash;</td>{% endif %}
<td class="description">{{d.total_files}} file{% if d.total_files != 1 %}s{% endif %}{% if d.total_folders > 1 %}, {{d.total_folders-1}} subfolder{% if d.total_folders-1!=1%}s{%endif%}{% endif %}</td>
</tr>
{% else %}
<!-- FILE -->
{% set f = i %}
{% if f.play %}
{% set play_link = f.play %}
{%else%}
{% set play_link = f.id %}
{% endif %}
<tr class="file" property="dcterms:hasPart" resource="{{f.id}}" typeof="{% if f.mediatype %}mediaitem {%endif%}file">
<td class="icon" valign="top">
<a href="{{play_link}}">
{% if f.thumbnail and not f.mediatype == "audio" %}
<img src="{{f.thumbnail}}" class="icon" alt="[FILE]">
{% elif f.mediatype == "image" %}
🖼️
{% elif f.mediatype == "video" %}
🎞️
{% elif f.mediatype == "audio" %}
🔊
{% else %}
🗋
{% endif %}
</a>
{% if f.thumbnail %}
<!-- rdf outside of link above which seems to reset the subject -->
<a class="metadata" property="hasThumbnail" href="{{f.thumbnail}}"></a>
{% endif %}
</td>
<td class="name">
<a {% if f.play %}property="hasPlay dcterms:hasFormat" href="{{f.play}}"{%else%}href="{{f.id}}"{% endif %}><span property="dcterms:title" content="{%if f.title%}{{f.title}}{% else %}{{f.filename|filename2title}}{% endif %}">{{f.filename|wbr_}}</span></a>
{% if f.play %}<a class="original" href="{{f.id}}">&crarr;</a>{% endif %}
{% if f.mediatype == "pdf" %}
<span property="mediatype" content="pdf"></span>
{% elif f.mediatype == "video" %}
<span property="mediatype" content="video"></span>
{% elif f.mediatype == "audio" %}
<span property="mediatype" content="audio"></span>
{% elif f.mediatype == "image" %}
<span property="mediatype" content="image"></span>
{% endif %}
{% if f.ext %}<span property="dcterms:format" content="{{f.ext}}"></span>{% endif %}
{% if f.poster %}
<a class="rdf" property="hasPoster dcterms:hasFormat" href="{{f.poster}}"></a>
{% endif %}
</td>
<td class="lastmod" align="right" property="dcterms:modified" datatype="xsd:dateTime" content="{{f.mtime}}">{{f.mtime|strftime}}</td>
<td class="size" align="right" data-sort-numeric="{{f.size}}">{{f.size|filesizeformat}}</td>
{% if 'pages' in allkeys %}<td class="pages" data-sort-numeric="{{f.pages|default(0,True)}}" {% if f.pages %}property="pages" content="{{f.pages}}"{%endif%}>{% if f.pages %}{{f.pages}}{% else %}&mdash;{%endif%}</td>{% endif %}
{# {% if 'author' in allkeys %}<td class="author">{% if f.author %}{{f.author}}{% else %}&mdash;{%endif%}</td>{% endif %} #}
{% if 'duration' in allkeys %}{% if f.duration %}<td class="duration" data-sort-numeric="{{f.duration}}" property="duration dcterms:extent" content="{{f.duration|isoduration}}" datatype="xsd:duration">{{f.duration|timecode(fract=False)}}</td>{% else %}<td class="duration" data-sort-numeric="0">&mdash;</td>{%endif%}{% endif %}
{% if f.description %}
<td class="description" property="dcterms:description">{{f.description|markdown|add_attribute_to_links("property", "hasTag")}}</td>
{% else %}
<td class="description">&mdash;</td>
{%endif%}
</tr>
{% endif %}
{% endfor %}
</tbody>
<tbody class="summary">
<tr><td colspan="{{ colcount }}"><hr></td></tr>
<tr class="summary">
<td>&nbsp;</td>
<td>
{{total_files}} file{% if total_files != 1 %}s{%endif%}{% if total_folders %}, {{total_folders}} folder{% if total_folders != 1 %}s{%endif%}{%endif%}
{% if 'play' in allkeys %}<span class="legend_original">(original: &crarr;)</span>{%endif%}
</td>
<td align="right">{% if last_modification%}<span property="dcterms:modified" datatype="xsd:dateTime" content="{{last_modification}}">{{last_modification|strftime}}</span>{%else %}&nbsp;{%endif%}</td>
<td align="right">{{total_bytes|filesizeformat}}</td>
<!-- TODO: sums of other values -->
{% if 'pages' in allkeys %}<td>&nbsp;</td>{% endif %}
{% if 'title' in allkeys %}<td>&nbsp;</td>{% endif %}
{% if 'author' in allkeys %}<td>&nbsp;</td>{% endif %}
{% if 'duration' in allkeys %}<td>&nbsp;</td>{% endif %}
<td></td>
</tr>
</tbody>
</table>
{% endwith %}
</body>
</html>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment