From 5a99b8af936f38e741348b64a4c75f2f282985fc Mon Sep 17 00:00:00 2001 From: rythmE Date: Thu, 4 Mar 2021 11:37:46 +0800 Subject: [PATCH 1/3] Fixed test failures and removed iframe tool component --- iframe/iframe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iframe/iframe.py b/iframe/iframe.py index bf64c51..64e671b 100644 --- a/iframe/iframe.py +++ b/iframe/iframe.py @@ -29,7 +29,7 @@ class IframeWithAnonymousIDXBlock(XBlock): display_name = String( help=_("The name of the component seen by the learners."), display_name=_("Component Display Name"), - default=_("Iframe tool"), # name that appears in advanced settings studio menu + default=_("iFrame"), # name that appears in advanced settings studio menu scope=Scope.user_state ) From 66c9db2e82abf40ebca769d2ce71efa8d94490d8 Mon Sep 17 00:00:00 2001 From: rythmE Date: Thu, 4 Mar 2021 18:37:32 +0800 Subject: [PATCH 2/3] Added default text for the component in studio --- iframe/templates/html/iframe.html | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/iframe/templates/html/iframe.html b/iframe/templates/html/iframe.html index ecefc37..72842a2 100644 --- a/iframe/templates/html/iframe.html +++ b/iframe/templates/html/iframe.html @@ -1,6 +1,15 @@ +{% load i18n %} +
-{% if is_in_studio %} -

Iframe URL: {{iframe_url}}

-{% endif %} - + {% if is_in_studio %} +

Iframe URL: {{iframe_url}}

+ {% endif %} + + {% if iframe_url %} + + {% elif is_in_studio %} +

+ {% trans "Use the IFrame tool to embed an exercise or tool from any web site into your course content."%} +

+ {% endif %}
From 8f7ac35750917780f9cc755c79ee39f9ce9d8657 Mon Sep 17 00:00:00 2001 From: rythmE Date: Fri, 5 Mar 2021 17:55:40 +0800 Subject: [PATCH 3/3] Updates for Component Location ID and Component default text --- iframe/iframe.py | 4 ++-- iframe/templates/html/iframe.html | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/iframe/iframe.py b/iframe/iframe.py index 64e671b..0926641 100644 --- a/iframe/iframe.py +++ b/iframe/iframe.py @@ -34,7 +34,7 @@ class IframeWithAnonymousIDXBlock(XBlock): ) iframe_url = String( - display_name=_("Iframe URL"), + display_name=_("iFrame URL"), help=_("Don't forget the leading protocol (http:// or https://) and the path, https://yoururl.com/path is correct, for example."), default="", scope=Scope.settings @@ -61,7 +61,7 @@ def student_view(self, context=None): context = { 'self': self, 'iframe_url': new_iframe_url, - 'is_in_studio': student_id == '' + 'is_in_studio': student_id == 'student' } frag = Fragment() diff --git a/iframe/templates/html/iframe.html b/iframe/templates/html/iframe.html index 72842a2..04484bc 100644 --- a/iframe/templates/html/iframe.html +++ b/iframe/templates/html/iframe.html @@ -1,14 +1,10 @@ {% load i18n %}
- {% if is_in_studio %} -

Iframe URL: {{iframe_url}}

- {% endif %} - {% if iframe_url %} {% elif is_in_studio %} -

+

{% trans "Use the IFrame tool to embed an exercise or tool from any web site into your course content."%}

{% endif %}