52 lines
1.4 KiB
Django/Jinja
52 lines
1.4 KiB
Django/Jinja
<!DOCTYPE html>
|
|
{{ card_header }}
|
|
<title>Status Card</title>
|
|
<style type="text/css">
|
|
{{ css_data.strip() }}
|
|
</style>
|
|
|
|
<body style="margin:0px;">
|
|
|
|
<script type="text/html" id="yaml_data">
|
|
##DATA::/ability_card/yaml_data##
|
|
</script>
|
|
|
|
{# just name all the xml fields of interest here #}
|
|
{% for value in [
|
|
"name",
|
|
"description",
|
|
"image",
|
|
"cp",
|
|
"range",
|
|
"power",
|
|
"symbol",
|
|
"difficulty",
|
|
"duration",
|
|
"artistic_value",
|
|
"playcost",
|
|
] %}
|
|
<script type="text/html" class="xml_data" id="xml_data_{{ value }}">##DATA::/ability_card/{{ value }}##</script>
|
|
{% endfor %}
|
|
|
|
{# 2hacky4me #}
|
|
<script type="text/javascript">
|
|
const component_data = ##JSON::/ability_card/component##;
|
|
var i = 1;
|
|
for (const component of component_data) {
|
|
document.write('<script type="text/html" class="xml_component" id="xml_component_' + i + '_x">' + component.attributes.x + '</script' + '>');
|
|
document.write('<script type="text/html" class="xml_component" id="xml_component_' + i + '_y">' + component.attributes.y + '</script' + '>');
|
|
document.write('<script type="text/html" class="xml_component" id="xml_component_' + i + '_db_entry">' + component.attributes.db_entry + '</script' + '>');
|
|
i += 1;
|
|
}
|
|
</script>
|
|
|
|
|
|
<script type="text/javascript">
|
|
var jinja_template =
|
|
{{ jinja_data.strip() | tojson | replace("\\n", "\\n\" +\n\"") }};
|
|
</script>
|
|
|
|
<script type="text/javascript">
|
|
{{ js_data }}
|
|
</script>
|