Sha256: e3251c154b1a9f623b103c49ac04a2342d42f2a5f7ca54a615764d40830a481e

Contents?: true

Size: 1.71 KB

Versions: 1

Compression:

Stored size: 1.71 KB

Contents

<div id="summary" style="clear:both">
  <%= page_entries_info @cltn, :entry_name => 'item' %>
</div>  

<%= partial :'collections/search_form' %>

<div class="borders" style="padding:10px;">
  <table id="cltn" class="cltn" border="0" cellpadding="10" cellspacing="20">
    <thead>
      <th width="2%">&nbsp;</td>
      <% @selected_cols.each do |col| %>
        <th><%=col%></th>
      <% end %>
    </thead>
    <tbody>
      <% @cltn.each do |cltn| %>
        <% id = cltn['_id'] %>
        <tr id="<%=id%>" valign="top">
          <td id="<%=id%>">
            <img class="delete" id="<%=id%>" src="/images/delete.png" title="delete this record"/>
            <img class="wait" id="wait_<%=id%>" src="/images/loading.gif"></img>          
          </td>
          <% @selected_cols.each do |k| %>
            <td><%= format_value(cltn[k]) %></td>
          <% end %>
        </tr>
      <% end %>
    </tbody>
  </table>
</div>

<div id="links">
  <%= will_paginate @cltn, :params => { :url => '/collections' } %>
</div>      

<script>
  $( function() {
    $("table#cltn tr" ).hover( 
      function() { 
        $(this).addClass( 'highlight' );
        $("td#" + $(this).attr('id') + " img.delete" ).show();
      }, 
      function() { 
        $(this).removeClass( 'highlight' );      
        $("td#" + $(this).attr('id') + " img.delete" ).hide();
      });
    $( "img.delete" ).click( function() {
      var id = $(this).attr('id');
      $.ajax({
        data:     {id: id},
        dataType: 'script',
        type:     'post',
        url:      '/collections/delete/',
        beforeSend: function() { $('img#_wait_' + id ).show(); },
        complete:   function() { $('img#_wait_' + id ).hide(); }
      }); 
    });    
  });
</script>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mongo3-0.0.9 lib/views/collections/_rows.erb