Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions iframe/iframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ 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
)

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
Expand All @@ -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()
Expand Down
13 changes: 9 additions & 4 deletions iframe/templates/html/iframe.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{% load i18n %}

<div class="iframe_block">
{% if is_in_studio %}
<p>Iframe URL: <a href="{{iframe_url}}">{{iframe_url}}</a></p>
{% endif %}
<iframe class="iframe" width="100%" height="1000px" frameborder="0" src="{{iframe_url}}"></iframe>
{% if iframe_url %}
<iframe class="iframe" width="100%" height="1000px" frameborder="0" src="{{iframe_url}}"></iframe>
{% elif is_in_studio %}
<p class="iframe-default-text component-default-text">
{% trans "Use the IFrame tool to embed an exercise or tool from any web site into your course content."%}
</p>
{% endif %}
</div>