<%
record = list_record if list_record # compat with render :partial :collection
dont_show_calculations ||= false
tr_class = cycle("", "even-record")
tr_class += " #{list_row_class(record)}" if respond_to? :list_row_class
url_options = params_for(:action => :list, :id => record.id)
-%>

<tr class="record <%= tr_class %>" id="<%= element_row_id(:action => :list, :id => record.id) %>">
  <% active_scaffold_config.list.columns.each do |column| %>
    <% column_value = get_column_value(record, column) -%>

    <td class="<%= column_class(column, column_value) %>" >
      <%= render_list_column(column_value, column, record) %>
    </td>
  <% end -%>
  <% if active_scaffold_config.action_links.any? {|link| link.type == :record } -%>
  <td class="actions">
    <%= render :partial => 'list_actions', :locals => {:record => record, :url_options => url_options} %>
  </td>
  <% end -%>
</tr>

<% target_id = element_row_id(:action => :list, :id => record.id) -%>
<script type="text/javascript">
actions = new ActiveScaffold.Actions.Record(
  $$('#<%= target_id -%> a.action'),
  $('<%= target_id -%>'),
  $('<%= loading_indicator_id(:action => :record, :id => record.id) -%>'),
  {refresh_url: '<%= url_for params_for(:action => :row, :id => record.id, :_method => :get, :escape => false) -%>'}
);
  <%= update_page do |page|
        page.replace active_scaffold_calculations_id, :partial => 'list_calculations'
      end if not dont_show_calculations and active_scaffold_config.list.columns.any? {|c| c.calculation?} %>
</script>