_collection.html.erb
1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<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))) %>