Skip to content

Commit f96d560

Browse files
Merge pull request #230 from open-craft/giovanni/fal-2742-fix-truncated-title
fix: Fix quote rendering on LTI 1.1 form
2 parents 800dd7f + f91f65f commit f96d560

6 files changed

Lines changed: 115 additions & 101 deletions

File tree

README.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,13 @@ Changelog
367367

368368
Please See the [releases tab](https://github.com/edx/xblock-lti-consumer/releases) for the complete changelog.
369369

370+
3.4.2 - 2022-02-01
371+
------------------
372+
373+
* Fix LTI 1.1 form rendering so it properly renders quotes present in titles.
374+
* Migrate LTI 1.1 launch template from Mako to Django template.
375+
* Internationalize LTI 1.1 launch template.
376+
370377
3.4.1 - 2022-02-01
371378
------------------
372379

lti_consumer/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
from .apps import LTIConsumerApp
55
from .lti_xblock import LtiConsumerXBlock
66

7-
__version__ = '3.4.1'
7+
__version__ = '3.4.2'

lti_consumer/lti_xblock.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1063,7 +1063,7 @@ def lti_launch_handler(self, request, suffix=''): # pylint: disable=unused-argu
10631063
loader = ResourceLoader(__name__)
10641064
context = self._get_context_for_template()
10651065
context.update({'lti_parameters': lti_parameters})
1066-
template = loader.render_mako_template('/templates/html/lti_launch.html', context)
1066+
template = loader.render_django_template('/templates/html/lti_launch.html', context)
10671067
return Response(template, content_type='text/html')
10681068

10691069
@XBlock.handler

lti_consumer/templates/html/lti_launch.html

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,33 @@
1+
{% load i18n %}
2+
13
<!DOCTYPE HTML>
24
<html>
35
<head>
46
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
57
<title>LTI</title>
68
</head>
79
<body>
8-
## This form will be hidden.
9-
## LTI module JavaScript will trigger a "submit" on the form, and the
10-
## result will be rendered instead.
10+
{% comment %}
11+
This form will be hidden.
12+
LTI module JavaScript will trigger a "submit" on the form, and the
13+
result will be rendered instead.
14+
{% endcomment %}
1115
<form
12-
id="lti-${element_id}"
13-
action="${launch_url}"
16+
id="lti-{{element_id}}"
17+
action="{{launch_url}}"
1418
method="post"
1519
encType="application/x-www-form-urlencoded"
1620
style="display:none;"
1721
>
22+
{% for param_name, param_value in lti_parameters.items %}
23+
<input name="{{param_name}}" value="{{param_value}}" />
24+
{% endfor %}
1825

19-
% for param_name, param_value in lti_parameters.items():
20-
<input name="${param_name}" value="${param_value}" />
21-
% endfor
22-
23-
<input type="submit" value="Press to Launch" />
26+
<input type="submit" value="{% trans "Press to Launch" %}" />
2427
</form>
2528
<script type="text/javascript">
2629
(function (d) {
27-
var element = d.getElementById("lti-${element_id}");
30+
var element = d.getElementById("lti-{{element_id}}");
2831
if (element) {
2932
element.submit();
3033
}

0 commit comments

Comments
 (0)