DISCO-1342 hide fields
hide course card image, course about page image, and course display name when publisher flag is turned on
This commit is contained in:
@@ -2,7 +2,7 @@ define([
|
||||
'jquery', 'gettext', 'js/models/settings/advanced', 'js/views/settings/advanced'
|
||||
], function($, gettext, AdvancedSettingsModel, AdvancedSettingsView) {
|
||||
'use strict';
|
||||
return function(advancedDict, advancedSettingsUrl) {
|
||||
return function(advancedDict, advancedSettingsUrl, publisherEnabled) {
|
||||
var advancedModel, editor;
|
||||
|
||||
$('form :input')
|
||||
@@ -17,6 +17,14 @@ define([
|
||||
advancedModel = new AdvancedSettingsModel(advancedDict, {parse: true});
|
||||
advancedModel.url = advancedSettingsUrl;
|
||||
|
||||
// set the hidden property to true on relevant fields if publisher is enabled
|
||||
if (publisherEnabled && advancedModel.attributes) {
|
||||
Object.keys(advancedModel.attributes).forEach(function(am) {
|
||||
var field = advancedModel.attributes[am];
|
||||
field.hidden = field.hide_on_enabled_publisher;
|
||||
});
|
||||
}
|
||||
|
||||
editor = new AdvancedSettingsView({
|
||||
el: $('.settings-advanced'),
|
||||
model: advancedModel
|
||||
|
||||
@@ -153,7 +153,7 @@ define(['js/views/validation',
|
||||
var newKeyId = _.uniqueId('policy_key_'),
|
||||
newEle = this.template({key: key, display_name: model.display_name, help: model.help,
|
||||
value: JSON.stringify(model.value, null, 4), deprecated: model.deprecated,
|
||||
keyUniqueId: newKeyId, valueUniqueId: _.uniqueId('policy_value_')});
|
||||
keyUniqueId: newKeyId, valueUniqueId: _.uniqueId('policy_value_'), hidden: model.hidden});
|
||||
|
||||
this.fieldToSelectorMap[key] = newKeyId;
|
||||
this.selectorToField[newKeyId] = key;
|
||||
|
||||
Reference in New Issue
Block a user