81 lines
1.7 KiB
Django/Jinja
81 lines
1.7 KiB
Django/Jinja
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
|
<xsl:output method="xml" omit-xml-declaration="yes" />
|
|
<xsl:template match="/*">
|
|
{% set newline = "<xsl:text disable-output-escaping='yes'>\n</xsl:text>" %}
|
|
{% set gt = "<xsl:text disable-output-escaping='yes'>></xsl:text>" %}
|
|
{% set lt = "<xsl:text disable-output-escaping='yes'><</xsl:text>" %}
|
|
{% set amp = "<xsl:text disable-output-escaping='yes'>&</xsl:text>" %}
|
|
<html>
|
|
|
|
{% filter replace(">", ">foobarhuehuehue")
|
|
| replace("<", lt)
|
|
| replace(">foobarhuehuehue", gt)
|
|
| replace("\n", newline)
|
|
| replace("</xsl:text><xsl:text disable-output-escaping='yes'>", "") %}
|
|
|
|
<head>
|
|
|
|
{{ card_header }}
|
|
|
|
<title>Status Card</title>
|
|
|
|
</head>
|
|
{% endfilter %}
|
|
|
|
<body content_type="html5">
|
|
|
|
<style type="text/css">
|
|
{{ css_data.strip() }}
|
|
</style>
|
|
|
|
{{ newline*2 }}
|
|
|
|
<script type="text/html" id="yaml_data">
|
|
<xsl:value-of select="yaml_data"/>
|
|
</script>
|
|
|
|
{{ newline*2 }}
|
|
|
|
{# just name all the xml fields of interest here #}
|
|
{% for value in [
|
|
"name",
|
|
"description",
|
|
"image",
|
|
"cp",
|
|
"range",
|
|
"power",
|
|
"symbol",
|
|
"difficulty",
|
|
"duration",
|
|
"playcost"] %}
|
|
{{lt}}script type="text/html" class="xml_data" id="xml_data_{{ value }}"{{gt}}<xsl:value-of select="{{ value }}"/>{{lt}}/script{{gt}}
|
|
{{ newline }}
|
|
{% endfor %}
|
|
|
|
{{ newline*2 }}
|
|
|
|
<script type="text/javascript">
|
|
var jinja_template =
|
|
{{ jinja_data.strip() | tojson | replace("\\n", "\\n\" +\n\"") }};
|
|
</script>
|
|
|
|
{{ newline*2 }}
|
|
|
|
<script type="text/javascript">
|
|
{{ js_data.strip()
|
|
| replace(">", ">foobarhuehuehue")
|
|
| replace("&", "&spismegdinnisse")
|
|
| replace("<", lt)
|
|
| replace(">foobarhuehuehue", gt)
|
|
| replace("&spismegdinnisse", amp) }}
|
|
</script>
|
|
|
|
{{ newline*2 }}
|
|
|
|
</body>
|
|
{{ newline }}
|
|
</html>
|
|
|
|
</xsl:template>
|
|
</xsl:stylesheet>
|