Sha256: 44aea78c58dfdb677692a8afcae662118c7c1c173313b3f96532dc7efb57579c

Contents?: true

Size: 1.34 KB

Versions: 1

Compression:

Stored size: 1.34 KB

Contents

<script type="text/javascript">
$(document).ready(function() {
  $("ul.droptrue").sortable({
    connectWith: "ul"
  });
  $("#sortable, #sortable_container").disableSelection();
  return $("#create_collection").submit(function(e) {
    e.preventDefault();
    var routeSetIds = new Array();
    $.each($("#sortable_container li"), function(key, item) {
      return routeSetIds.push($(item).attr("id"));
    });
    return $.post($(this).attr("action"), {
      route_set_ids: routeSetIds,
      title: $("#title").val()
    }, function(data) {
      return window.location.replace(window.location.href.replace("/new", ""));
    });
  });
});
</script>
<h2>Create a new collection</h2>
<%= form_tag collections_path, :id => "create_collection" do %>
<table>
  <tr>
    <td>
      Title:
    </td>
    <td>
      <%= text_field_tag :title %>
    </td>
  </tr>
  <tr>
    <td colspan="2">
      <ul id="sortable" class="droptrue">
	<% @route_set.routes.each do |route| %>
	  <li class="ui-state-highlight" id="<%= route.id %>">
	    <span class="label"><%= route.verb %></span> <%= link_to route.path, route_path(:id => generate_name(route.verb, route.path)) %>
	  </li>
	<% end %>
      </ul>
      <ul id="sortable_container" class="droptrue container">
      </ul>
    </td>
    <td>
    </td>
  </tr>
</table>
<div class="actions">
  <%= submit_tag %>
</div>
<% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
docushin-0.0.2 app/views/docushin/collections/new.html.erb