app/views/contributions/index.html.haml in artfully_ose-1.2.0 vs app/views/contributions/index.html.haml in artfully_ose-1.3.0.pre1
- old
+ new
@@ -1,37 +1,74 @@
- in_section :transactions
- content_for :header do
%h1 Donations
#donations-search
- = form_tag contributions_path, :method => :get, :class => 'well form-inline' do
- .pull-left
- = label_tag :start, "From", :class => "control-label"
- = text_field_tag :start,"#{l @search.start, :format => :date_for_input}", :class => 'datepicker input-small'
- = label_tag :stop, "To", :class => "control-label"
- = text_field_tag :stop, "#{l @search.stop, :format => :date_for_input}", :class => 'datepicker input-small'
- .pull-right
- = submit_tag "Search", :class => "btn"
- = submit_tag "Download", :class => "btn"
+- 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 @search.results.empty?
+- unless @rows.empty?
#donations
%table.table
%thead
- %tr
+ %tr
%th Order
- %th Time
+ %th Date
%th Person
- %th Total Contribution
- %th Non-deductible
+ -with_kit(:campaigns) do
+ %th Campaign
+ %th Appeal
+ %th Type
+ %th Fiscal Year
+ %th.right Total Contribution
%tbody
- - @search.results.each do |order|
- - order.items.select(&:donation?).each do |item|
- %tr
- %td= link_to order.id, order_path(order.id)
- %td= l order.created_at_local_to_organization
- %td= link_to_person order.person
- %td= number_as_cents item.total_price
- %td= number_as_cents item.nongift_amount
- = will_paginate(@search.results)
+ - @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 @search.start} and #{l @search.stop}"
+ %h4= "No donations found between #{l @report.start} and #{l @report.stop}"
+
+-content_for :custom_js do
+ = javascript_include_tag 'contributions'
\ No newline at end of file