Sha256: 8d008ab84217e7c40d1f85456ad9fa2cf5e7a0906c9d60abc9ef4db106e917e2

Contents?: true

Size: 1.29 KB

Versions: 5

Compression:

Stored size: 1.29 KB

Contents

%table.records
  %thead
    %tr
      %th= orderable_column_link(:name)
      %th= orderable_column_link(:status)
      %th= orderable_column_link(:category)
      %th= orderable_column_link('owner_name', :owner)
      %th= orderable_column_link(:value)
      %th= t(:actions)
  %tbody
    -# prepare a hash to store the accumulated row data for calculations
    - dat = Hash.new {|k,v| k[v] = [] }

    - if collection.empty?
      %tr
        %td{:colspan => 6}= e9_t(:no_records_text, :scope => 'e9_crm.deals')
    - else
      - collection.each do |record|
        %tr{:id => "ids_#{record.id}", :class => cycle('odd', 'even')}
          %td.record-name
            = record.name
          %td.record-status
            = record.status
          %td.record-category
            = record.category
          %td.record-owner
            = record.owner_name
          %td.record-value
            - dat[:value] << record.value
            = record.value
          %td.actions
            = link_to_edit_resource(record)
            = link_to_destroy_resource(record)

    %tfooter
      %tr{:class => 'record-totals'}
        %td.record-totals-label{:colspan => 4}
          #{t(:total)}:
        %td.record-totals
          = dat[:value].sum
        %td

- if @controller.should_paginate_index
  = will_paginate collection

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
e9_crm-0.1.16 app/views/e9_crm/deals/_table.html.haml
e9_crm-0.1.14 app/views/e9_crm/deals/_table.html.haml
e9_crm-0.1.13 app/views/e9_crm/deals/_table.html.haml
e9_crm-0.1.12 app/views/e9_crm/deals/_table.html.haml
e9_crm-0.1.11 app/views/e9_crm/deals/_table.html.haml