<% # Allow multiple subjects to be linked if it's an empty linker multiplicity = "many" if multiplicity.blank? if form.obj['ref'].blank? selected_json = (multiplicity === "many") ? "[]" : "{}" else multiplicity = "one" selected_json = form.obj['_resolved'].to_json end data_path = form.path data_name = "ref" # De-referenced by the controller if the schema def calls for an item array exclude_ids = [] if exclude_ids.blank? hide_create = false if hide_create.blank? if !defined?(linker_label) linker_label = (multiplicity === "many") ? I18n.t("subject._plural") : I18n.t("subject._singular") end %>
" data-label_plural="<%= I18n.t("subject._plural") %>" data-path="<%= data_path %>" data-name="<%= data_name %>" data-url="<%= url_for :controller => :search, :action => :do_search, :format => :json %>" data-browse-url="<%= url_for :controller => :search, :action => :do_search, :format => :js, :facets => SearchResultData.SUBJECT_FACETS, :sort => "title_sort asc", :exclude => exclude_ids %>" data-selected="<%= selected_json %>" data-format_template="title" data-multiplicity="<%= multiplicity %>" <% if multiplicity === "many" %>data-sortable="true"<% end %> data-types='["subject"]' data-exclude='<%= exclude_ids.to_json %>' />