e9_crm 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. data/.gitignore +1 -0
  2. data/app/controllers/e9_crm/campaigns_controller.rb +3 -0
  3. data/app/controllers/e9_crm/contact_emails_controller.rb +5 -1
  4. data/app/controllers/e9_crm/contact_offers_controller.rb +3 -0
  5. data/app/controllers/e9_crm/deals_controller.rb +41 -13
  6. data/app/controllers/e9_crm/file_download_offers_controller.rb +3 -0
  7. data/app/controllers/e9_crm/leads_controller.rb +74 -0
  8. data/app/controllers/e9_crm/new_content_subscription_offers_controller.rb +3 -0
  9. data/app/controllers/e9_crm/newsletter_subscription_offers_controller.rb +3 -0
  10. data/app/controllers/e9_crm/offer_subclass_controller.rb +11 -0
  11. data/app/controllers/e9_crm/offers_controller.rb +37 -0
  12. data/app/controllers/e9_crm/resources_controller.rb +8 -0
  13. data/app/controllers/e9_crm/video_offers_controller.rb +3 -0
  14. data/app/helpers/e9_crm/deals_helper.rb +32 -0
  15. data/app/helpers/e9_crm/leads_helper.rb +63 -0
  16. data/app/helpers/e9_crm/offers_helper.rb +16 -0
  17. data/app/models/campaign.rb +1 -0
  18. data/app/models/contact.rb +2 -0
  19. data/app/models/contact_offer.rb +2 -0
  20. data/app/models/deal.rb +110 -8
  21. data/app/models/file_download_offer.rb +2 -0
  22. data/app/models/new_content_subscription_offer.rb +5 -0
  23. data/app/models/newsletter_subscription_offer.rb +5 -0
  24. data/app/models/no_campaign.rb +5 -1
  25. data/app/models/offer.rb +30 -19
  26. data/app/models/subscription_offer.rb +3 -0
  27. data/app/models/video_offer.rb +2 -0
  28. data/app/views/e9_crm/campaigns/_header.html.haml +2 -2
  29. data/app/views/e9_crm/contact_offers/_form_inner.html.haml +5 -0
  30. data/app/views/e9_crm/contacts/_form_inner.html.haml +2 -1
  31. data/app/views/e9_crm/contacts/_index_sidebar.html.haml +30 -0
  32. data/app/views/e9_crm/contacts/index.html.haml +1 -30
  33. data/app/views/e9_crm/contacts/index.js.erb +1 -1
  34. data/app/views/e9_crm/deals/_form_inner.html.haml +16 -8
  35. data/app/views/e9_crm/deals/_header.html.haml +13 -0
  36. data/app/views/e9_crm/deals/_leads_header.html.haml +12 -0
  37. data/app/views/e9_crm/deals/_leads_table.html.haml +34 -0
  38. data/app/views/e9_crm/deals/leads.html.haml +4 -9
  39. data/app/views/e9_crm/deals/leads.js.erb +1 -0
  40. data/app/views/e9_crm/deals/offer_form.html.haml +6 -0
  41. data/app/views/e9_crm/deals/reports.html.haml +1 -1
  42. data/app/views/e9_crm/{offers → file_download_offers}/_form.html.haml +0 -0
  43. data/app/views/e9_crm/file_download_offers/_form_inner.html.haml +11 -0
  44. data/app/views/e9_crm/leads/_form.html.haml +26 -0
  45. data/app/views/e9_crm/leads/create.js.erb +11 -0
  46. data/app/views/e9_crm/leads/new.html.haml +6 -0
  47. data/app/views/e9_crm/menu_options/_header.html.haml +3 -4
  48. data/app/views/e9_crm/new_content_subscription_offers/_form_inner.html.haml +1 -0
  49. data/app/views/e9_crm/newsletter_subscription_offers/_form_inner.html.haml +1 -0
  50. data/app/views/e9_crm/offers/_footer.html.haml +0 -0
  51. data/app/views/e9_crm/offers/_form_inner.html.haml +8 -22
  52. data/app/views/e9_crm/offers/_header.html.haml +12 -0
  53. data/app/views/e9_crm/offers/_offer.html.haml +4 -0
  54. data/app/views/e9_crm/offers/_public_offer.html.haml +6 -0
  55. data/app/views/e9_crm/offers/show.html.haml +2 -0
  56. data/app/views/e9_crm/resources/_form_inner.html.haml +0 -5
  57. data/app/views/e9_crm/resources/create.js.erb +3 -2
  58. data/app/views/e9_crm/resources/edit.html.haml +1 -1
  59. data/app/views/e9_crm/resources/new.html.haml +1 -1
  60. data/app/views/e9_crm/resources/show.html.haml +1 -1
  61. data/app/views/e9_crm/resources/update.js.erb +3 -1
  62. data/app/views/e9_crm/subscription_offers/_form_inner.html.haml +5 -0
  63. data/app/views/e9_crm/video_offers/_form_inner.html.haml +5 -0
  64. data/config/locales/e9.en.yml +3 -2
  65. data/config/locales/en.yml +30 -13
  66. data/config/routes.rb +31 -8
  67. data/e9_crm.gemspec +1 -1
  68. data/lib/e9_crm/controller.rb +94 -0
  69. data/lib/e9_crm/model.rb +9 -9
  70. data/lib/e9_crm/rails_extensions.rb +9 -0
  71. data/lib/e9_crm/tracking_controller.rb +48 -80
  72. data/lib/e9_crm/version.rb +1 -1
  73. data/lib/e9_crm.rb +8 -1
  74. data/lib/generators/e9_crm/templates/migration.rb +3 -9
  75. metadata +39 -9
  76. data/Gemfile.lock +0 -98
  77. data/app/models/affiliate.rb +0 -4
  78. data/app/models/sales_person.rb +0 -4
  79. data/app/views/e9_crm/contact_emails/send_email.js.erb +0 -1
  80. data/app/views/e9_crm/offers/_form_inner.html.haml.bak +0 -43
data/app/models/offer.rb CHANGED
@@ -2,46 +2,57 @@
2
2
  # offers are tracked as +Leads+
3
3
  #
4
4
  class Offer < Renderable
5
+ include E9Rails::ActiveRecord::STI
6
+ include E9Rails::ActiveRecord::Initialization
7
+ include E9Rails::ActiveRecord::InheritableOptions
8
+
5
9
  has_many :deals, :inverse_of => :offer
6
10
  has_many :leads, :class_name => 'Deal', :conditions => ["deals.status = ?", Deal::Status::Lead]
7
11
 
8
- class << self
9
- def conversion_email
10
- SystemEmail.find_by_identifier(Identifiers::CONVERSION_EMAIL)
11
- end
12
+ validates :conversion_alert_email, :email => { :allow_blank => true }
12
13
 
13
- def page
14
- SystemPage.find_by_identifier(Identifiers::PAGE)
15
- end
16
- end
14
+ mount_uploader :file, FileUploader
17
15
 
18
- include E9Rails::ActiveRecord::InheritableOptions
19
16
  self.delegate_options_methods = true
20
17
  self.options_parameters = [
21
18
  :submit_button_text,
22
19
  :success_alert_text,
20
+ :success_page_text,
23
21
  :download_link_text,
24
22
  :conversion_alert_email,
25
- :success_page_text,
26
23
  :custom_form_html
27
24
  ]
28
25
 
29
- mount_uploader :file, FileUploader
26
+ class << self
27
+ def conversion_email
28
+ SystemEmail.find_by_identifier(Identifiers::CONVERSION_EMAIL)
29
+ end
30
30
 
31
- validates :conversion_alert_email, :email => { :allow_blank => true }
31
+ def page
32
+ SystemPage.find_by_identifier(Identifiers::PAGE)
33
+ end
34
+
35
+ def partial_path
36
+ 'e9_crm/offers/offer'
37
+ end
38
+
39
+ def element
40
+ 'offer'
41
+ end
42
+ end
32
43
 
33
44
  def to_s
34
45
  name
35
46
  end
36
47
 
37
- def as_json(options={})
38
- {}.tap do |hash|
39
- hash[:id] = self.id,
40
- hash[:name] = self.name,
41
- hash[:template] = self.template,
42
- hash[:errors] = self.errors
48
+
49
+ protected
50
+
51
+ def _assign_initialization_defaults
52
+ self.submit_button_text ||= 'Submit!'
53
+ self.download_link_text ||= 'Click to download your file'
54
+ self.success_page_text ||= 'Thank you!'
43
55
  end
44
- end
45
56
 
46
57
  module Identifiers
47
58
  CONVERSION_EMAIL = 'offer_conversion_email'
@@ -0,0 +1,3 @@
1
+ class SubscriptionOffer < Offer
2
+ def self.mailing_lists; [] end
3
+ end
@@ -0,0 +1,2 @@
1
+ class VideoOffer < Offer
2
+ end
@@ -1,6 +1,6 @@
1
1
  .toolbar
2
2
  .toolbar-left
3
- = form_tag(resource_class, :method => :get, :id => 'campaign_search_form') do
3
+ = form_tag(resource_class, :method => :get, :class => 'scope-selects') do
4
4
  %select{:name => 'type'}
5
5
  = campaign_type_select_options
6
6
  %select{:name => 'group'}
@@ -13,4 +13,4 @@
13
13
  = label_tag 'new_campaign_type_select', t('activerecord.links.new', :model => Campaign.model_name.human)
14
14
  %select{:name => 'type', :id => 'new_campaign_type_select'}
15
15
  = campaign_type_select_options(false)
16
- = submit_tag t(:go)
16
+ = submit_tag t(:go), :name => nil
@@ -0,0 +1,5 @@
1
+ = render 'e9_crm/offers/form_inner', :f => f
2
+
3
+ .field{:class => request.xhr? ? 'tinymcexhr' : 'tinymce'}
4
+ = f.label :success_page_text, nil, :class => :req
5
+ = f.text_area :success_page_text
@@ -1,3 +1,5 @@
1
+ = render_record_attribute_form(:users, f)
2
+
1
3
  %fieldset.contact-standard-fields
2
4
  %legend= e9_t(:form_legend_standard)
3
5
  .field
@@ -22,7 +24,6 @@
22
24
 
23
25
  %fieldset.contact-contact-fields
24
26
  %legend= e9_t(:form_legend_contact)
25
- = render_record_attribute_form(:users , f)
26
27
  = render_record_attribute_form(:phone_number_attributes , f)
27
28
  = render_record_attribute_form(:instant_messaging_handle_attributes , f)
28
29
  = render_record_attribute_form(:website_attributes , f)
@@ -0,0 +1,30 @@
1
+ .actions
2
+ = link_to_new_resource(Contact)
3
+ = link_to_new_resource(Company)
4
+
5
+ -# Email actions (template, newsletter)
6
+ - etag, ntag = contact_email_template_select_tag, contact_newsletter_select_tag
7
+ - if [etag, ntag].any?(&:present?)
8
+ %fieldset
9
+ %legend= e9_t(:email_actions_legend)
10
+ - if etag
11
+ = form_tag new_contact_email_path, :method => :get, :id => 'contact_email_form', 'data-empty' => e9_t(:no_contacts_notification), 'data-count' => @contact_ids.length do
12
+ = etag
13
+ = hidden_field_tag 'uids', @contact_ids.join(','), :id => 'contact_email_uids'
14
+ = submit_tag e9_t(:send_email_template), :name => nil
15
+ - if ntag
16
+ = form_tag send_email_admin_user_email_path('__ID__'), :method => :put, :id => 'contact_newsletter_form', 'data-confirm' => e9_t(:contact_newsletter_confirmation, :count => collection.length), 'data-empty' => e9_t(:no_contacts_notification), 'data-count' => @contact_ids.length do
17
+ = ntag
18
+ = hidden_field_tag 'uids', @contact_ids.join(','), :id => 'contact_newsletter_uids'
19
+ = submit_tag e9_t(:send_email_newsletter), :name => nil
20
+
21
+ -# Search filter options
22
+ %fieldset
23
+ %legend= e9_t(:search_options_legend)
24
+ = form_tag(resource_class, :method => :get, :id => 'contact_search_form') do
25
+ = label_tag 'contact_search_field', t(:search)
26
+ = text_field_tag 'search', params[:search], :id => 'contact_search_field'
27
+ = submit_tag t(:go), :name => nil
28
+ = render 'tag_table'
29
+ .actions
30
+ = submit_tag t(:clear), :name => nil, :id => 'contact_search_clear'
@@ -6,33 +6,4 @@
6
6
  = render 'footer'
7
7
 
8
8
  #index-sidebar
9
- .actions
10
- = link_to_new_resource(Contact)
11
- = link_to_new_resource(Company)
12
-
13
- -# Email actions (template, newsletter)
14
- - etag, ntag = contact_email_template_select_tag, contact_newsletter_select_tag
15
- - if [etag, ntag].any?(&:present?)
16
- %fieldset
17
- %legend= e9_t(:email_actions_legend)
18
- - if etag
19
- = form_tag new_contact_email_path, :method => :get, :id => 'contact_email_form', 'data-empty' => e9_t(:no_contacts_notification), 'data-count' => @contact_ids.length do
20
- = etag
21
- = hidden_field_tag 'uids', @contact_ids.join(','), :id => 'contact_email_uids'
22
- = submit_tag e9_t(:send_email_template), :name => nil
23
- - if ntag
24
- = form_tag send_email_admin_user_email_path('__ID__'), :method => :put, :id => 'contact_newsletter_form', 'data-confirm' => e9_t(:contact_newsletter_confirmation, :count => collection.length), 'data-empty' => e9_t(:no_contacts_notification), 'data-count' => @contact_ids.length do
25
- = ntag
26
- = hidden_field_tag 'uids', @contact_ids.join(','), :id => 'contact_newsletter_uids'
27
- = submit_tag e9_t(:send_email_newsletter), :name => nil
28
-
29
- -# Search filter options
30
- %fieldset
31
- %legend= e9_t(:search_options_legend)
32
- = form_tag(resource_class, :method => :get, :id => 'contact_search_form') do
33
- = label_tag 'contact_search_field', t(:search)
34
- = text_field_tag 'search', params[:search], :id => 'contact_search_field'
35
- = submit_tag t(:go), :name => nil
36
- = render 'tag_table'
37
- .actions
38
- = submit_tag t(:clear), :name => nil, :id => 'contact_search_clear'
9
+ = render 'index_sidebar'
@@ -1,5 +1,5 @@
1
1
  <% new_title = @index_title || e9_t(:index_title) %>
2
- $('#index_header').html("<%= escape_javascript(render('header')) %>");
2
+ $('#index-sidebar').html("<%= escape_javascript(render('index_sidebar')) %>");
3
3
  $('#records_table').html("<%= escape_javascript(render('table', :resources => collection)) %>");
4
4
  document.title = "<%= escape_javascript(meta_title(new_title)) %>";
5
5
  $("h1.title, ul.breadcrumbs li.last").html("<%= escape_javascript(new_title) %>");
@@ -1,14 +1,28 @@
1
- .actions
2
- = link_to_destroy_resource(resource, :remote => false) if resource.persisted?
1
+ .actions.top
2
+ - if resource.persisted?
3
+ - if resource.lead?
4
+ = link_to 'Back to Leads', leads_path
5
+ - else
6
+ = link_to_destroy_resource(resource, :remote => false)
7
+
3
8
  .field
4
9
  = f.label :name, nil, :class => :req
5
10
  = f.text_field :name
11
+ .field.select
12
+ = f.label :category
13
+ = f.select :category, MenuOption.options_for('Deal Category'), :include_blank => 'No Category'
6
14
  .field
7
15
  = f.label :info
8
16
  = f.text_area :info
17
+ .field
18
+ = f.label :custom_info
19
+ = f.text_area :custom_info
9
20
  .field
10
21
  = f.label :value, nil, :class => :req
11
22
  = f.text_field :value
23
+ .field.select
24
+ = f.label :owner
25
+ = f.collection_select :contact_id, Contact.all, :id, :name, :prompt => true
12
26
  .field.select
13
27
  = f.label :contacts
14
28
  %select.list{'data-iname' => resource_instance_name, 'data-field' => '[contact_ids]'}
@@ -19,9 +33,3 @@
19
33
  %span= contact.name
20
34
  %input{:type => :hidden, :name => "contact[contact_ids][]", :value => contact.id}
21
35
  %a{:class => :remove, :title => "Remove", :alt => "Remove"} Remove
22
- .field.select
23
- = f.label :owner
24
- = f.collection_select :contact_id, Contact.all, :id, :name
25
- .field.select
26
- = f.label :category
27
- = f.select :category, MenuOption.options_for('Deal Category'), :include_blank => 'No Category'
@@ -0,0 +1,13 @@
1
+ .toolbar
2
+ .toolbar-left
3
+ = form_tag(resource_class, :method => :get, :class => 'scope-selects') do
4
+ %select{:name => 'status'}
5
+ = deal_status_select_options
6
+ %select{:name => 'category'}
7
+ = deal_category_select_options
8
+ %select{:name => 'owner'}
9
+ = deal_owner_select_options
10
+
11
+ .toolbar-right
12
+ = link_to I18n.t('activerecord.links.index', :models => 'Leads'), leads_path
13
+ = link_to_new_resource(Deal)
@@ -0,0 +1,12 @@
1
+ .toolbar
2
+ .toolbar-left
3
+ = form_tag(resource_class, :method => :get, :class => 'scope-selects') do
4
+ %select{:name => 'offer'}
5
+ = deal_offer_select_options
6
+ %select{:name => 'from'}
7
+ = deal_date_select_options
8
+ %select{:name => 'until'}
9
+ = deal_date_select_options(true)
10
+
11
+ .toolbar-right
12
+ = link_to_collection(Deal)
@@ -0,0 +1,34 @@
1
+ %table.records
2
+ %thead
3
+ %tr
4
+ %th= orderable_column_link(:created_at)
5
+ %th= orderable_column_link(:offer_name)
6
+ %th= orderable_column_link(:campaign_code)
7
+ %th= orderable_column_link(:lead_name)
8
+ %th= orderable_column_link(:lead_email)
9
+ %th= orderable_column_link(:options, :custom_info)
10
+ %th= t(:actions)
11
+ %tbody
12
+ - if collection.empty?
13
+ %tr
14
+ %td{:colspan => 7}= e9_t(:no_records_text, :scope => 'e9_crm.leads')
15
+ - else
16
+ - collection.each do |record|
17
+ %tr{:id => "ids_#{record.id}", :class => cycle('odd', 'even')}
18
+ %td.record-created-at
19
+ = I18n.l(record.created_at)
20
+ %td.record-offer-name
21
+ = record.offer_name
22
+ %td.record-campaign-code
23
+ = record.campaign_code
24
+ %td.record-lead-name
25
+ = record.lead_name
26
+ %td.record-lead-email
27
+ = record.lead_email
28
+ %td.record-custom-info
29
+ = record.custom_info
30
+ %td.actions
31
+ - if record.contacts.present?
32
+ = link_to_show_resource(record.contacts.first)
33
+ = link_to 'Create Deal', edit_deal_path(record)
34
+ = link_to 'Delete Lead', record, :method => :delete, :remote => true, :confirm => I18n.t("#{resource_class.i18n_scope}.links.confirm_destroy")
@@ -1,13 +1,8 @@
1
1
  = title (@index_title || e9_t(:index_title))
2
2
 
3
- = render 'header'
3
+ = render 'leads_header'
4
4
 
5
- - if sortable_controller?
6
- = form_tag polymorphic_path([:update_order, resource_class]) do
7
- %div#records_table
8
- = render 'table', :resources => collection, :field_map => {}
9
- - else
10
- %div#records_table
11
- = render 'table', :resources => collection
5
+ %div#records_table
6
+ = render 'leads_table', :resources => collection
12
7
 
13
- = render 'footer'
8
+ = will_paginate collection
@@ -0,0 +1 @@
1
+ $("table.records").replaceWith("<%= escape_javascript(render('leads_table', :collection => collection)) %>");
@@ -0,0 +1,6 @@
1
+ = form_for resource, :url => offer_submit_path, :remote => request.xhr? do |f|
2
+ .errors= resource_error_messages!
3
+
4
+
5
+ .actions
6
+ = f.submit
@@ -2,7 +2,7 @@
2
2
 
3
3
  .toolbar
4
4
  .toolbar-left
5
- = form_tag(resource_class, :method => :get, :id => 'campaign_search_form') do
5
+ = form_tag(resource_class, :method => :get, :class => 'scope-selects') do
6
6
  %select{:name => 'type'}
7
7
  = campaign_type_select_options
8
8
  %select{:name => 'group'}
@@ -0,0 +1,11 @@
1
+ = render 'e9_crm/offers/form_inner', :f => f
2
+
3
+ .field{:class => request.xhr? ? 'tinymcexhr' : 'tinymce'}
4
+ = f.label :success_page_text, nil, :class => :req
5
+ = f.text_area :success_page_text
6
+
7
+ %fieldset.upload
8
+ = render 'shared/form_partials/carrierwave_upload_field', :field => :file, :f => f
9
+ .field
10
+ = f.label :download_link_text
11
+ = f.text_field :download_link_text
@@ -0,0 +1,26 @@
1
+ = form_for resource, :url => public_offer_deals_path(@offer), :remote => request.xhr? do |f|
2
+ .errors= resource_error_messages!
3
+ .notice
4
+
5
+ - if f.object.user.blank?
6
+ .field
7
+ = f.label :lead_email
8
+ = f.text_field :lead_email
9
+ .field
10
+ = f.label :lead_name
11
+ = f.text_field :lead_name
12
+
13
+ = @offer.custom_form_html.html_safe
14
+
15
+ - if @offer.kind_of?(SubscriptionOffer)
16
+ %fieldset
17
+ - @offer.class.mailing_lists.each do |ml|
18
+ .field.checkbox
19
+ = label_tag "#{resource_instance_name}_mailing_list_ids_#{ml.id}", ml.description
20
+ = check_box_tag "#{resource_instance_name}[mailing_list_ids][]", ml.id, true, :id => "#{resource_instance_name}_mailing_list_ids_#{ml.id}"
21
+
22
+ .actions
23
+ - if @offer.submit_button_text.present?
24
+ = f.submit @offer.submit_button_text
25
+ - else
26
+ = f.submit
@@ -0,0 +1,11 @@
1
+ var $offer = $('#offer_<%= @offer.id %>_body');
2
+ <% if resource.errors.any? %>
3
+ $('form .errors', $offer).html("<%= escape_javascript(resource_error_messages!) %>");
4
+ <% else %>
5
+ <% if @offer.kind_of?(SubscriptionOffer) %>
6
+ $('form .errors', $offer).html("");
7
+ $('form .notice', $offer).html("<%= escape_javascript(@offer.success_alert_text) %>");
8
+ <% else %>
9
+ window.location = "<%= public_offer_path(@offer) %>";
10
+ <% end %>
11
+ <% end %>
@@ -0,0 +1,6 @@
1
+ = title @offer.name
2
+
3
+ .offer-body
4
+ = @offer.template
5
+
6
+ = render 'form'
@@ -1,8 +1,7 @@
1
1
  .toolbar
2
2
  .toolbar-left
3
- %form{:action => menu_options_path, :method => :get, :id => 'menu_option_key_select_form'}
3
+ %form{:action => menu_options_path, :method => :get, :class => 'scope-selects'}
4
4
  = label_tag 'menu_option_key_select', t(:view)
5
- = select_tag 'key', options_for_select(MenuOption::KEYS.sort, params[:key]), :id => 'menu_option_key_select'
6
- = submit_tag t(:go), :name => nil
5
+ = select_tag 'key', options_for_select(MenuOption::KEYS.sort, params[:key])
7
6
  .toolbar-right
8
- = link_to_new_resource(MenuOption, :menu_option => {:key => params[:key]})
7
+ = link_to_new_resource(MenuOption, :menu_option => {:key => params[:key]}, :class => 'new-menu-option')
@@ -0,0 +1 @@
1
+ = render 'e9_crm/subscription_offers/form_inner', :f => f
@@ -0,0 +1 @@
1
+ = render 'e9_crm/subscription_offers/form_inner', :f => f
File without changes
@@ -2,10 +2,14 @@
2
2
  = f.label :name, nil, :class => :req
3
3
  = f.text_field :name
4
4
 
5
- .field{:class => request.xhr? ? 'tinymcexhr' : 'tinymce'}
6
- = f.label :template, nil, :class => :req
5
+ .field.tinymce
6
+ = f.label :template
7
7
  = f.text_area :template
8
8
 
9
+ .field
10
+ = f.label :custom_form_html
11
+ = f.text_area :custom_form_html
12
+
9
13
  - if request.xhr?
10
14
  - resource.region_type_ids.each_with_index do |id, i|
11
15
  = hidden_field_tag 'offer[region_type_ids][]', id, :id => "offer_region_type_ids_#{i}"
@@ -15,28 +19,10 @@
15
19
  - else
16
20
  = render 'shared/admin/region_type_select', :f => f
17
21
 
18
- %fieldset.upload
19
- = render 'shared/form_partials/carrierwave_upload_field', :field => :file, :f => f
20
- .field
21
- = f.label :download_link_text
22
- = f.text_field :download_link_text
23
-
24
- .field
25
- = f.label :success_alert_text
26
- = f.text_field :success_alert_text
27
-
28
22
  .field
29
- = f.label :success_page_text
30
- = f.text_area :success_page_text
31
-
32
- .field
33
- = f.label :success_alert_text
34
- = f.text_field :success_alert_text
23
+ = f.label :submit_button_text
24
+ = f.text_field :submit_button_text
35
25
 
36
26
  .field
37
27
  = f.label :conversion_alert_email
38
28
  = f.text_field :conversion_alert_email
39
-
40
- .field
41
- = f.label :custom_form_html
42
- = f.text_area :custom_form_html
@@ -0,0 +1,12 @@
1
+ .toolbar
2
+ .toolbar-left
3
+ = form_tag(resource_class, :method => :get, :class => 'scope-selects') do
4
+ %select{:name => 'type'}
5
+ = offer_select_options
6
+
7
+ .toolbar-right
8
+ = form_tag new_contact_offer_path, :method => :get, :id => 'new_offer_form' do
9
+ = label_tag 'new_offer_select', t('activerecord.links.new', :model => Offer.model_name.human)
10
+ %select{:name => 'type', :id => 'new_offer_select'}
11
+ = offer_select_options(false)
12
+ = submit_tag t(:go), :name => nil
@@ -0,0 +1,4 @@
1
+ %div{:id => "offer_#{renderable.id}_body"}
2
+ - content_for :bottom_javascripts do
3
+ :javascript
4
+ $(function(){ $("#offer_#{renderable.id}_body").load("#{new_public_offer_deal_path(renderable)}") });
@@ -0,0 +1,6 @@
1
+ #offer-body
2
+ = resource.success_page_text
3
+
4
+ - if resource.file?
5
+ #offer-download-link
6
+ = link_to(resource.download_link_text, resource.file_url)
@@ -0,0 +1,2 @@
1
+ = title @show_title || e9_t(:show_title)
2
+ = render 'public_offer', :offer => resource
@@ -1,5 +0,0 @@
1
- - resource.attributes.each_pair do |field, value|
2
- - next if ['id', 'created_at', 'updated_at'].include?(field)
3
- .field
4
- = f.label field
5
- = f.text_field field
@@ -1,6 +1,7 @@
1
1
  <% if resource.errors.any? %>
2
2
  $('form .errors').html("<%= escape_javascript(resource_error_messages!) %>");
3
- $.fn.colorbox.resize();
3
+ try { $.fn.colorbox.resize(); } catch(e) {}
4
4
  <% else %>
5
- window.location.reload(true);
5
+ try { $.fn.colorbox.close(); } catch(e) {}
6
+ $('form .errors').html("");
6
7
  <% end %>
@@ -1,2 +1,2 @@
1
- = title e9_t(:edit_title)
1
+ = title @edit_title || e9_t(:edit_title)
2
2
  = render 'form'
@@ -1,2 +1,2 @@
1
- = title e9_t(:new_title)
1
+ = title @new_title || e9_t(:new_title)
2
2
  = render 'form'
@@ -1,2 +1,2 @@
1
- = title e9_t(:show_title)
1
+ = title @show_title || e9_t(:show_title)
2
2
  = render resource
@@ -1,5 +1,7 @@
1
1
  <% if resource.errors.any? %>
2
2
  $('form .errors').html("<%= escape_javascript(resource_error_messages!) %>");
3
+ try { $.fn.colorbox.resize(); } catch(e) {}
3
4
  <% else %>
4
- window.location.reload(true);
5
+ try { $.fn.colorbox.close(); } catch(e) {}
6
+ $('form .errors').html("");
5
7
  <% end %>
@@ -0,0 +1,5 @@
1
+ = render 'e9_crm/offers/form_inner', :f => f
2
+
3
+ .field
4
+ = f.label :success_alert_text
5
+ = f.text_field :success_alert_text
@@ -0,0 +1,5 @@
1
+ = render 'e9_crm/offers/form_inner', :f => f
2
+
3
+ .field{:class => request.xhr? ? 'tinymcexhr' : 'tinymce'}
4
+ = f.label :success_page_text, nil, :class => :req
5
+ = f.text_area :success_page_text
@@ -13,7 +13,6 @@ en:
13
13
  index_title_with_search_and_tags: "%{models} tagged \"%{tagged}\", matching \"%{search}\""
14
14
  form_legend_contact: Contact Information
15
15
  form_legend_standard: Personal Information
16
- form_legend_user: Login Accounts
17
16
  send_email_template: Send Email
18
17
  send_email_newsletter: Send Newsletter
19
18
  contact_newsletter_confirmation: "The system will send the newsletter to all of the selected contacts (%{count}) if they are subscribed to receieve email. Are you sure you want to proceed?"
@@ -26,8 +25,10 @@ en:
26
25
  contact_emails:
27
26
  prepare_title: Edit Your Template
28
27
  send_email: Send Email
28
+ deals:
29
+ new_title: Create Deal
29
30
  leads:
30
- index_title: Leads
31
+ index_title: Leads
31
32
  reports:
32
33
  index_title: Marketing Report
33
34
  no_records_text: No data exists for those query parameters.