Commit 7dd4efba by Tim Krones

Address review comments.

parent 1626ec0b
...@@ -26,7 +26,7 @@ class DragAndDropBlock(XBlock): ...@@ -26,7 +26,7 @@ class DragAndDropBlock(XBlock):
display_name=_("Title"), display_name=_("Title"),
help=_("The title of the Drag and Drop that is displayed to the user"), help=_("The title of the Drag and Drop that is displayed to the user"),
scope=Scope.settings, scope=Scope.settings,
default="Drag and Drop", default=_("Drag and Drop"),
) )
show_title = Boolean( show_title = Boolean(
...@@ -91,6 +91,10 @@ class DragAndDropBlock(XBlock): ...@@ -91,6 +91,10 @@ class DragAndDropBlock(XBlock):
has_score = True has_score = True
def _(self, text):
""" Translate text """
return self.runtime.service(self, "i18n").ugettext(text)
def student_view(self, context): def student_view(self, context):
""" """
Player view, displayed to the student Player view, displayed to the student
...@@ -124,8 +128,13 @@ class DragAndDropBlock(XBlock): ...@@ -124,8 +128,13 @@ class DragAndDropBlock(XBlock):
""" """
js_templates = load_resource('/templates/html/js_templates.html') 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 = { context = {
'js_templates': js_templates, 'js_templates': js_templates,
'help_texts': help_texts,
'self': self, 'self': self,
'data': urllib.quote(json.dumps(self.data)), 'data': urllib.quote(json.dumps(self.data)),
} }
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
aria-labelledby="item-background-color-label" aria-labelledby="item-background-color-label"
aria-describedby="item-background-color-description"> aria-describedby="item-background-color-description">
<div id="item-background-color-description" class="item-styles-form-help"> <div id="item-background-color-description" class="item-styles-form-help">
{{ self.fields.item_background_color.help }} {{ help_texts.item_background_color }}
</div> </div>
<h3 id="item-text-color-label"> <h3 id="item-text-color-label">
{% trans "Text color" %} {% trans "Text color" %}
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
aria-labelledby="item-text-color-label" aria-labelledby="item-text-color-label"
aria-describedby="item-text-color-description"> aria-describedby="item-text-color-description">
<div id="item-text-color-description" class="item-styles-form-help"> <div id="item-text-color-description" class="item-styles-form-help">
{{ self.fields.item_text_color.help }} {{ help_texts.item_text_color }}
</div> </div>
</form> </form>
</section> </section>
......
...@@ -21,9 +21,9 @@ ...@@ -21,9 +21,9 @@
<label>{{i18n "height"}}</label> <label>{{i18n "height"}}</label>
<input type="text" class="size height" value="{{ height }}" /> <input type="text" class="size height" value="{{ height }}" />
<br /> <br />
<label>{{i18n "x"}}</label> <label>x</label>
<input type="text" class="coord x" value="{{ x }}" /> <input type="text" class="coord x" value="{{ x }}" />
<label>{{i18n "y"}}</label> <label>y</label>
<input type="text" class="coord y" value="{{ y }}" /> <input type="text" class="coord y" value="{{ y }}" />
</div> </div>
</div> </div>
...@@ -57,9 +57,9 @@ ...@@ -57,9 +57,9 @@
<textarea class="error-feedback">{{ feedback.incorrect }}</textarea> <textarea class="error-feedback">{{ feedback.incorrect }}</textarea>
</div> </div>
<div class="row"> <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> <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> <input type="text" class="item-height" value="{{ height }}"></input>
</div> </div>
<div class="row"> <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