1
0
mirror of https://github.com/sjlongland/tornado-gallery.git synced 2025-10-25 14:57:51 +10:00

templates: Use {% raw %} when dumping JSON

This commit is contained in:
Stuart Longland 2018-04-17 14:16:50 +10:00
parent 2cbe4f6cf9
commit 3cf45ad5d6
Signed by: stuartl
GPG Key ID: 6AA32EFB18079BAA

View File

@ -12,25 +12,25 @@ body {
function getData() {
var data = {
CGI: {
ScriptName: {{ dumps(site_uri) }}
ScriptName: {% raw dumps(site_uri) %}
},
gallery: {
name: {{ dumps(gallery.name) }},
title: {{ dumps(gallery.title) }},
desc: {{ dumps(gallery.desc) }},
first: {{ dumps(gallery.first) }},
last: {{ dumps(gallery.last) }}
name: {% raw dumps(gallery.name) %},
title: {% raw dumps(gallery.title) %},
desc: {% raw dumps(gallery.desc) %},
first: {% raw dumps(gallery.first) %},
last: {% raw dumps(gallery.last) %}
},
settings: {{ dumps(settings) }},
settings: {% raw dumps(settings) %},
photo: {
origwidth: {{photo.width}},
origheight: {{photo.height}},
width: {{width}},
height: {{height}},
annotation: {{ dumps(photo.annotation or '') }},
name: {{ dumps(photo.name) }},
previous: {{ dumps(photo.prev) }},
next: {{ dumps(photo.next) }},
annotation: {% raw dumps(photo.annotation or '') %},
name: {% raw dumps(photo.name) %},
previous: {% raw dumps(photo.prev) %},
next: {% raw dumps(photo.next) %},
zoom: Math.round( 100*({{width}}) /
{{photo.width}})/100
}};
@ -43,7 +43,7 @@ body {
document.defaultZoom =
Math.round( 100*({{width}}) /
{{photo.width}})/100;
document.rotation = {{settings['rotation']}}-0;
document.rotation = {{settings['rotation'] or 0}}-0;
</script>
<script lang="text/javascript" src="{{static_uri}}/lib.js"></script>
<script lang="text/javascript" src="{{static_uri}}/wheellib.js"></script>