templeos-info/file_index.xslt

51 lines
1.5 KiB
HTML

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="directory"/>
<xsl:template match="/">
<html lang="en">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>TempleOS files</title>
<link rel="stylesheet" href="/style/templeos.css"/>
</head>
<body>
<pre style="font-family: courier, monospace; font-size: 10pt; width: 700px; max-width: 100%;">
<p>Index of <script>document.write(location.pathname.substr(3));</script></p>
<a href=".." style="color: #aa00aa;">..</a>
<br/>
<xsl:for-each select="list/*">
<xsl:variable name="name">
<xsl:value-of select="."/>
</xsl:variable>
<xsl:choose>
<xsl:when test="contains($name, '.DD.HTML')">
<a href="{$name}" style="color: #5555ff;"><xsl:value-of select="substring-before($name, '.HTML')"/></a>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="contains($name, '.')">
<a href="{$name}" style="color: #5555ff;"><xsl:value-of select="."/></a>
</xsl:when>
<xsl:otherwise>
<a href="{$name}" style="color: #aa00aa;">+] <xsl:value-of select="."/></a>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
<br/>
</xsl:for-each>
</pre>
</body>
</html>
</xsl:template>
</xsl:stylesheet>