% # Input Options hash %> <%- options = Hash.new %> <%- options[:hint] = element.data_entry_hint if element.data_entry_hint.present? %> <%- options[:as] = "boolean" if element.field_type == "boolean" %> <%- options[:required] = "true" if element.required? %> <%- options[:input_html] = { data: { js: element.js_behaviors }} if element.js_behaviors.present? %> <%- options[:label] = element.label %> <%- html_attributes = Hash.new %> <%- html_attributes[:placeholder] = element.placeholder_text if element.placeholder_text.present? %> <%- element.html_attributes.each{ |key,value| html_attributes[key] = value } if element.html_attributes.present? %> <%- options[:html_attributes] = html_attributes %> <% # @TODO: Check the local application file system for a named partial, %> <% # if we find one there render it, if not render via the logic below... %> <% # Title is a special case - saved in the database outside of JSON Attributes %> <% if element.solr_field == "dct_title_s" %> <%= f.input :title, hint: "Theme: city, state, temporal coverage" %> <% # Created At and Updated At are a special case - saved in the database outside of JSON Attributes %> <% elsif element.solr_field == "date_created_dtsi" %> <% if @document.persisted? %> <%= f.input :created_at, as: 'string', label: "Created At", input_html: { disabled: true } %> <% end %> <% elsif element.solr_field == "date_modified_dtsi" %> <% if @document.persisted? %> <%= f.input :updated_at, as: 'string', label: "Last Updated", input_html: { disabled: true } %> <% end %> <% # Publication State is a special case - saved in the database outside of JSON Attributes %> <% elsif element.solr_field == "b1g_publication_state_s" %> <% if @document.persisted? %> <%= f.input :publication_state, label: 'Publication State', required: true, collection: Document::ControlledLists::PUBLICATION_STATE %> <% else %> <%= f.hidden_field :publication_state %> <% end %> <% # References are a special, special case %> <% elsif element.solr_field == 'dct_references_s' %> <%= f.repeatable_attr_input(element.solr_field.to_sym, build: :at_least_one, html_attributes: options[:html_attributes], simple_form_input_args: { label: element.label }) do |sub_form| %> <%= category_and_value(sub_form, category_list: Document::Reference::REFERENCE_VALUES.keys) %> <% end %> <% elsif element.repeatable? %> <% # Text Fields %> <% if element.field_type == 'text' %> <%= f.repeatable_attr_input(element.solr_field.to_sym, build: :at_least_one, html_attributes: options[:html_attributes], simple_form_input_args: { label: element.label }) do |input_name, value| %>