Commit 7dd4efba by Tim Krones

Address review comments.

parent 1626ec0b
......@@ -26,7 +26,7 @@ class DragAndDropBlock(XBlock):
display_name=_("Title"),
help=_("The title of the Drag and Drop that is displayed to the user"),
scope=Scope.settings,
default="Drag and Drop",
default=_("Drag and Drop"),
)
show_title = Boolean(
......@@ -91,6 +91,10 @@ class DragAndDropBlock(XBlock):
has_score = True
def _(self, text):
""" Translate text """
return self.runtime.service(self, "i18n").ugettext(text)
def student_view(self, context):
"""
Player view, displayed to the student
......@@ -124,8 +128,13 @@ class DragAndDropBlock(XBlock):
"""
js_templates = load_resource('/templates/html/js_templates.html')
help_texts = {
'item_background_color': self._(self.fields['item_background_color'].help),
'item_text_color': self._(self.fields['item_text_color'].help)
}
context = {
'js_templates': js_templates,
'help_texts': help_texts,
'self': self,
'data': urllib.quote(json.dumps(self.data)),
}
......
......@@ -74,7 +74,7 @@
aria-labelledby="item-background-color-label"
aria-describedby="item-background-color-description">
<div id="item-background-color-description" class="item-styles-form-help">
{{ self.fields.item_background_color.help }}
{{ help_texts.item_background_color }}
</div>
<h3 id="item-text-color-label">
{% trans "Text color" %}
......@@ -85,7 +85,7 @@
aria-labelledby="item-text-color-label"
aria-describedby="item-text-color-description">
<div id="item-text-color-description" class="item-styles-form-help">
{{ self.fields.item_text_color.help }}
{{ help_texts.item_text_color }}
</div>
</form>
</section>
......
......@@ -21,9 +21,9 @@
<label>{{i18n "height"}}</label>
<input type="text" class="size height" value="{{ height }}" />
<br />
<label>{{i18n "x"}}</label>
<label>x</label>
<input type="text" class="coord x" value="{{ x }}" />
<label>{{i18n "y"}}</label>
<label>y</label>
<input type="text" class="coord y" value="{{ y }}" />
</div>
</div>
......@@ -57,9 +57,9 @@
<textarea class="error-feedback">{{ feedback.incorrect }}</textarea>
</div>
<div class="row">
<label>{{i18n "Width (px - 0 for auto)"}}</label>
<label>{{i18n "Width in pixels (0 for auto)"}}</label>
<input type="text" class="item-width" value="{{ width }}"></input>
<label>{{i18n "Height (px - 0 for auto)"}}</label>
<label>{{i18n "Height in pixels (0 for auto)"}}</label>
<input type="text" class="item-height" value="{{ height }}"></input>
</div>
<div class="row">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment