_collection.html.erb 1.26 KB
<h1><%= _('DSpace Collection') %></h1>

<%#= required_fields_message %>

<%#= required f.text_field('name', :size => '64', :maxlength => 150) %>

<%= hidden_field_tag 'article[parent_id]', @article.parent_id %>

<%= hidden_field_tag 'article[dspace_community_id]', @article.parent.dspace_community_id %>

<% dspace_server_url = @article.parent.parent.dspace_server_url %>

<% community_id = @article.parent.dspace_community_id %>

<% #dspace_client = Dspace::Client.new(dspace_server_url) %>

<% collections = Dspace::Community.get_all_collections_from( dspace_server_url, community_id ).map { |collection| item = [_(collection.name), collection.id] } %>

<table border="0">
  <tr>
    <th><%= check_box_tag "article[dspace_collection_id]", true %></th>
    <th align="left"><%= _('DSpace Collection') %></th>
  </tr>
  <% collections.each do |collection| %>
  <tr>
    <td align="center"><%= check_box_tag "article[dspace_collection_id][]", collection[1] %> </td>
    <td>
      <%= hidden_field_tag "article[dspace_collection_name][]", collection[0].to_slug %>
      <%= collection[0] %>
    </td>
  </tr>
  <% end %>
</table>

<%#= labelled_form_field(_('Collections:'),
      select(:article,
             :dspace_collection_id,
             options_for_select_with_title(collections))) %>