metamaps--metamaps/app/views/maps/_newsynapse.html.erb
2012-11-03 20:14:21 -04:00

22 lines
No EOL
1.3 KiB
Text

<div class="anypage">
<%= form_for Synapse.new, url: user_synapses_url(user), remote: true do |form| %>
<button id="closenewsynapse" onclick="$('#new_synapse').fadeOut('fast'); $('#new_synapse')[0].reset(); return false;">close</button>
<h3>Add Synapse Between Topics</h3>
<% if Item.visibleToUser(user, nil).count > 0 %>
<label for="node1_id">Choose First Topic</label>
<%= select_tag :node1_id, options_from_collection_for_select(Item.order("name ASC").visibleToUser(user, nil), "id", "name") %>
<% end %>
<label for="item_category">Directionality of the Connection</label>
<%= form.select :category, options_for_select(['none', 'both', 'from-to', 'to-from']) %>
<label for="item_desc">Describe The Connection</label>
<%= form.text_field :desc, class: "description" %>
<% if Item.visibleToUser(user, nil).count > 0 %>
<label for="node2_id">Choose Second Topic</label>
<%= select_tag :node2_id, options_from_collection_for_select(Item.order("name ASC").visibleToUser(user, nil), "id", "name") %>
<% end %>
<label for="synapse_permission">Permission</label>
<%= form.select(:permission, options_for_select(['commons', 'public', 'private'])) %>
<%= form.hidden_field :map, :value => @map.id %>
<%= form.submit "Add Synapse", class: "add" %>
<% end %>
</div>