import Core from 'spotlight/core' import SpotlightNestable from 'spotlight/admin/spotlight_nestable' Core.Block.Resources = (function(){ return Core.Block.extend({ type: "resources", formable: true, autocompleteable: true, show_heading: true, title: function() { return i18n.t("blocks:" + this.type + ":title"); }, description: function() { return i18n.t("blocks:" + this.type + ":description"); }, icon_name: "resources", blockGroup: function() { return i18n.t("blocks:group:items") }, primary_field_key: "primary-caption-field", show_primary_field_key: "show-primary-caption", secondary_field_key: "secondary-caption-field", show_secondary_field_key: "show-secondary-caption", display_checkbox: "display-checkbox", globalIndex: 0, _itemPanelIiifFields: function(index, data) { return []; }, _itemPanel: function(data) { var index = "item_" + this.globalIndex++; var checked; if (data.display == "true") { checked = "checked='checked'" } else { checked = ""; } var resource_id = data.slug || data.id; var markup = `