1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-12-22 23:42:25 +00:00

Escape strings

This commit is contained in:
Yohann D'ANELLO 2020-07-31 19:00:19 +02:00
parent 8409ee4cc4
commit d8127e8936
2 changed files with 5 additions and 5 deletions

View File

@ -161,8 +161,8 @@
{% if button.display %}
$("#highlighted_button{{ button.id }}").click(function() {
addConso({{ button.destination_id }}, {{ button.amount }},
{{ polymorphic_ctype }}, {{ button.category_id }}, "{{ button.category.name }}",
{{ button.id }}, "{{ button.name }}");
{{ polymorphic_ctype }}, {{ button.category_id }}, "{{ button.category.name|escapejs }}",
{{ button.id }}, "{{ button.name|escapejs }}");
});
{% endif %}
{% endfor %}
@ -172,8 +172,8 @@
{% if button.display %}
$("#button{{ button.id }}").click(function() {
addConso({{ button.destination_id }}, {{ button.amount }},
{{ polymorphic_ctype }}, {{ button.category_id }}, "{{ button.category.name }}",
{{ button.id }}, "{{ button.name }}");
{{ polymorphic_ctype }}, {{ button.category_id }}, "{{ button.category.name|escapejs }}",
{{ button.id }}, "{{ button.name|escapejs }}");
});
{% endif %}
{% endfor %}

View File

@ -160,7 +160,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
TRANSFER_POLYMORPHIC_CTYPE = {{ polymorphic_ctype }};
SPECIAL_TRANSFER_POLYMORPHIC_CTYPE = {{ special_polymorphic_ctype }};
user_id = {{ user.note.pk }};
username = "{{ user.username }}";
username = "{{ user.username|escapejs }}";
</script>
<script src="/static/js/transfer.js"></script>
{% endblock %}