<%= render_aspace_partial :partial => "shared/form_messages", :locals => {:form => form} %>

<fieldset>

  <%= hidden_field_tag "uri", @digital_object.uri %>

  <% define_template "digital_object", jsonmodel_definition(:digital_object) do |form| %>
    <section id="basic_information">
      <h3>
        <%= I18n.t("digital_object._frontend.section.basic_information") %>
        <%= link_to_help :topic => "digital_object_basic_information" %>
      </h3>
      <%= form.label_and_textarea "title" %>

      <%= render_aspace_partial :partial => "shared/slug", :locals => {:form => form, :record_type => @digital_object} if AppConfig[:use_human_readable_urls] %>

      <%= form.label_and_textfield "digital_object_id" %>
      <%= form.label_and_boolean "publish", {}, user_prefs["publish"] %>
      <%= form.label_and_select "level", form.possible_options_for("level", true) %>
      <%= form.label_and_select "digital_object_type", form.possible_options_for("digital_object_type", true) %>
      <%= form.label_and_boolean "restrictions", {}, form.default_for("restrictions") %>
    </section>
  <% end %>

  <% form.emit_template("digital_object") %>

  <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "file_versions"} %>

  <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "lang_materials", :custom_action_template => "lang_materials/subrecord_form_action"} %>
  <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "dates", :template => "archival_record_date"} %>
  <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "extents"} %>

  <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "linked_agents", :template => "digital_object_linked_agent"} %>
  <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "subjects", :template => "subrecord_subject"} %>

  <%= render_aspace_partial :partial => "notes/form", :locals => { :section_id => "digital_object_notes", :form => form, :all_note_types => note_types_for(form['jsonmodel_type'])} %>

  <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "external_documents"} %>
  <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "rights_statements"} %>
  <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "collection_management", :cardinality => :zero_to_one} %>
  <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "user_defined", :cardinality => :zero_to_one} %>

  <%= render_aspace_partial :partial => "external_ids/edit", :locals => {:form => form, :section_id => "external_ids"} %>

  <%= form_plugins_for("digital_object", form) %>

</fieldset>
