Sha256: 6faf22020030a20a0a2f17e337830c85b1a70b82d81bfd34921b355ce3b3a7b5

Contents?: true

Size: 1.34 KB

Versions: 182

Compression:

Stored size: 1.34 KB

Contents

<h1>Edit Sort Order</h1>

<a href="/admin/agents" class="caboose-btn">Back to Agents</a>

<ul class="sortable" id="sortable_agents">
	<% @agents.each do |agent| %>
		<li id="agent_<%= agent.id %>" class="clearfix ui-state-default" data-paid="<%= agent.id %>">
      <span class="ui-icon ui-icon-arrowthick-2-n-s"></span>
      <span class="resource-title"><%= agent.full_name %></span>
    </li>
	<% end %>
</ul>

<% content_for :caboose_css do %>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<style>
	.sortable {
      list-style-type: none;
      padding-left: 0;
    }
    .sortable li {
      cursor: ns-resize;
      width: 800px;
      padding: 3px 6px;
    }
    .sortable li a {
      color: #0357FF;
      font-size: 14px;
    }
    .sortable li a:hover {
      text-decoration: underline;
    }
    .ui-state-default .ui-icon  {
      display: inline-block;
    }
</style>
<% end %>

<% content_for :caboose_js do %>
<script>
	function change_sort_order(data) {
  $.ajax({
      url: '/admin/agents/update-sort',
      type: 'put',
      data: data,
      success: function(resp) { }
    });
  }
  $(document).ready(function() {
  	var sort = $(".sortable");
  	sort.sortable({
      update: function(event, ui) {
        change_sort_order( sort.sortable('serialize') );
      }
    });
  });
</script>
<% end %>

Version data entries

182 entries across 182 versions & 1 rubygems

Version Path
caboose-rets-0.1.214 app/views/caboose_rets/agents/admin_edit_sort.html.erb
caboose-rets-0.1.213 app/views/caboose_rets/agents/admin_edit_sort.html.erb
caboose-rets-0.1.212 app/views/caboose_rets/agents/admin_edit_sort.html.erb
caboose-rets-0.1.211 app/views/caboose_rets/agents/admin_edit_sort.html.erb
caboose-rets-0.1.210 app/views/caboose_rets/agents/admin_edit_sort.html.erb
caboose-rets-0.1.209 app/views/caboose_rets/agents/admin_edit_sort.html.erb
caboose-rets-0.1.208 app/views/caboose_rets/agents/admin_edit_sort.html.erb
caboose-rets-0.1.207 app/views/caboose_rets/agents/admin_edit_sort.html.erb
caboose-rets-0.1.206 app/views/caboose_rets/agents/admin_edit_sort.html.erb
caboose-rets-0.1.205 app/views/caboose_rets/agents/admin_edit_sort.html.erb
caboose-rets-0.1.204 app/views/caboose_rets/agents/admin_edit_sort.html.erb
caboose-rets-0.1.203 app/views/caboose_rets/agents/admin_edit_sort.html.erb
caboose-rets-0.1.202 app/views/caboose_rets/agents/admin_edit_sort.html.erb
caboose-rets-0.1.201 app/views/caboose_rets/agents/admin_edit_sort.html.erb
caboose-rets-0.1.200 app/views/caboose_rets/agents/admin_edit_sort.html.erb
caboose-rets-0.1.199 app/views/caboose_rets/agents/admin_edit_sort.html.erb
caboose-rets-0.1.198 app/views/caboose_rets/agents/admin_edit_sort.html.erb
caboose-rets-0.1.197 app/views/caboose_rets/agents/admin_edit_sort.html.erb
caboose-rets-0.1.196 app/views/caboose_rets/agents/admin_edit_sort.html.erb
caboose-rets-0.1.195 app/views/caboose_rets/agents/admin_edit_sort.html.erb