Support level support for Studio xblock creation.

TNL-4670
This commit is contained in:
cahrens
2016-07-06 15:06:02 -04:00
parent 71bebec579
commit d4cc7b8ffd
25 changed files with 605 additions and 243 deletions

View File

@@ -1,5 +1,5 @@
define(["jquery", "js/views/baseview"],
function ($, BaseView) {
define(["jquery", "js/views/baseview", 'edx-ui-toolkit/js/utils/html-utils'],
function ($, BaseView, HtmlUtils) {
return BaseView.extend({
className: function () {
@@ -9,8 +9,19 @@ define(["jquery", "js/views/baseview"],
BaseView.prototype.initialize.call(this);
var template_name = this.model.type === "problem" ? "add-xblock-component-menu-problem" :
"add-xblock-component-menu";
var support_indicator_template = this.loadTemplate("add-xblock-component-support-level");
var support_legend_template = this.loadTemplate("add-xblock-component-support-legend");
this.template = this.loadTemplate(template_name);
this.$el.html(this.template({type: this.model.type, templates: this.model.templates}));
HtmlUtils.setHtml(
this.$el,
HtmlUtils.HTML(this.template({
type: this.model.type, templates: this.model.templates,
support_legend: this.model.support_legend,
support_indicator_template: support_indicator_template,
support_legend_template: support_legend_template,
HtmlUtils: HtmlUtils
}))
);
// Make the tabs on problems into "real tabs"
this.$('.tab-group').tabs();
}