<%# Copyright © 2012 The Pennsylvania State University Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. %> <%= form_for @generic_file, :url => sufia.generic_file_path, :html => {:multipart => true, :class => 'form-horizontal'} do |f| %> <%= hidden_field_tag('generic_file[terms_of_service]', '1') %> <%= hidden_field_tag('redirect_tab', 'descriptions') %>

Descriptions * indicates required fields

<%= f.label :resource_type, "Resource Types", :class=>"control-label", :for=>"resource_type" %>

You may select multiple types to apply

<%= f.select "resource_type", options_for_select(Sufia::Engine.config.resource_types.keys, @generic_file.resource_type.to_a), {}, {:multiple=>true, :size=>7} %>

<% @terms.each do |t| %> <% next if t.empty? %> <% key = t.to_s.split("generic_file__").last %> <%# consider these fields to be uneditable via the web form %> <% next if ['part_of', 'date_modified', 'date_uploaded', 'format', 'resource_type'].include?(key) %> <% logger.info "!!!! Generic file has no method #{key}" unless @generic_file.respond_to?(key) %> <% if @generic_file.respond_to?(key) %> <%= render :partial => "generic_files/field_form", :locals => { :generic_file => @generic_file, :f =>f, :render_req => true, :key => key } %> <% end %> <% end %>
<%= f.button ' Save Descriptions'.html_safe, :type => 'submit', :class => 'btn-primary', :onclick => "confirmation_needed = false;", :id => "upload_submit", :name => "update_descriptions" %>
<% end %>