- in_section :transactions - content_for :header do %h1 Donations #donations-search - if current_user.current_organization.has_kit?(:campaigns) = form_tag contributions_path, :method => :get, :class => 'well form-horizontal' do .row-fluid .pull-left .control-group = label_tag :start, "From", :class => "control-label" .controls = text_field_tag :start,"#{l @report.start, :format => :date_for_input}", :readonly => true, :class => 'datepicker input-small', :style=>'float:left' = label_tag :stop, "To", :class => "control-label", :style=>'width:30px;margin-right:18px' = text_field_tag :stop, "#{l @report.stop, :format => :date_for_input}", :readonly => true, :class => 'datepicker input-small' .control-group = label_tag :type, "Gift Type", :class => "control-label" .controls = select_tag :type, options_for_select(Donation::GIFT_TYPES.invert.to_a, @report.type) .control-group = label_tag :campaign_id, "Campaign", :class => "control-label" .controls = select_tag :campaign_id, options_from_collection_for_select(current_user.current_organization.campaigns.active, :id, :name, @report.campaign_id), :onchange => "loadAppeals('campaign_id','appeal_id', #{@campaign_appeals.to_json})", :include_blank => true .control-group = label_tag :appeal_id, "Appeal", :class => "control-label" .controls = select_tag :appeal_id, options_from_collection_for_select(@report.campaign ? @report.campaign.appeals.active : [], :id, :name, @report.appeal_id), :include_blank => true .pull-right = submit_tag "Search", :class => "btn" = submit_tag "Download", :class => "btn" - else = form_tag contributions_path, :method => :get, :class => 'form-inline' do .control-group.well .pull-left = label_tag :start, "From", :class => "control-label" = text_field_tag :start,"#{l @report.start, :format => :date_for_input}", :readonly => true, :class => 'datepicker input-small' = label_tag :stop, "To", :class => "control-label" = text_field_tag :stop, "#{l @report.stop, :format => :date_for_input}", :readonly => true, :class => 'datepicker input-small' .pull-right = submit_tag "Search", :class => "btn" = submit_tag "Download", :class => "btn" - unless @rows.empty? #donations %table.table %thead %tr %th Order %th Date %th Person -with_kit(:campaigns) do %th Campaign %th Appeal %th Type %th Fiscal Year %th.right Total Contribution %tbody - @rows.each do |row| %tr %td= link_to row.order.id, order_path(row.order.id) %td= l(row.date, :format => '%m/%d/%Y') %td= link_to_person row.order.person -with_kit(:campaigns) do %td= row.donation.campaign.name unless row.donation.campaign.nil? %td= row.donation.appeal.name unless row.donation.appeal.nil? %td= row.type %td= row.donation.fiscal_year %td.right= number_as_cents row.order.sum_donations = will_paginate(@rows) - else %h4= "No donations found between #{l @report.start} and #{l @report.stop}" -content_for :custom_js do = javascript_include_tag 'contributions'