alchemy_crm 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. data/Gemfile +10 -11
  2. data/alchemy_crm.gemspec +21 -21
  3. data/app/assets/javascripts/alchemy_crm/alchemy_crm.base.js +54 -54
  4. data/app/assets/stylesheets/alchemy_crm/base.css.scss +199 -199
  5. data/app/controllers/alchemy_crm/admin/base_controller.rb +5 -5
  6. data/app/controllers/alchemy_crm/admin/contact_groups_controller.rb +15 -15
  7. data/app/controllers/alchemy_crm/admin/contacts_controller.rb +95 -95
  8. data/app/controllers/alchemy_crm/admin/deliveries_controller.rb +66 -66
  9. data/app/controllers/alchemy_crm/admin/elements_controller_extension.rb +23 -23
  10. data/app/controllers/alchemy_crm/admin/mailings_controller.rb +44 -44
  11. data/app/controllers/alchemy_crm/admin/newsletters_controller.rb +16 -16
  12. data/app/controllers/alchemy_crm/admin/tags_controller.rb +60 -59
  13. data/app/controllers/alchemy_crm/base_controller.rb +3 -3
  14. data/app/controllers/alchemy_crm/contacts_controller.rb +88 -88
  15. data/app/controllers/alchemy_crm/mailings_controller.rb +16 -16
  16. data/app/controllers/alchemy_crm/recipients_controller.rb +30 -30
  17. data/app/controllers/alchemy_crm/subscriptions_controller.rb +54 -54
  18. data/app/helpers/alchemy/pages_helper_extension.rb +14 -14
  19. data/app/helpers/alchemy_crm/admin/base_helper.rb +8 -8
  20. data/app/helpers/alchemy_crm/mailings_helper.rb +175 -175
  21. data/app/mailers/alchemy_crm/bounce_receiver.rb +9 -9
  22. data/app/mailers/alchemy_crm/contacts_mailer.rb +21 -21
  23. data/app/mailers/alchemy_crm/mailings_mailer.rb +46 -46
  24. data/app/mailers/alchemy_crm/subscriptions_mailer.rb +12 -12
  25. data/app/models/alchemy/essence_element_teaser.rb +14 -14
  26. data/app/models/alchemy_crm/contact.rb +260 -260
  27. data/app/models/alchemy_crm/contact_group.rb +15 -15
  28. data/app/models/alchemy_crm/contact_group_filter.rb +17 -17
  29. data/app/models/alchemy_crm/delivery.rb +54 -54
  30. data/app/models/alchemy_crm/element_extension.rb +23 -23
  31. data/app/models/alchemy_crm/mailing.rb +90 -90
  32. data/app/models/alchemy_crm/newsletter.rb +33 -33
  33. data/app/models/alchemy_crm/reaction.rb +5 -5
  34. data/app/models/alchemy_crm/recipient.rb +46 -46
  35. data/app/models/alchemy_crm/subscription.rb +4 -4
  36. data/app/views/alchemy/admin/elements/fill.js.erb +11 -11
  37. data/app/views/alchemy/elements/_newsletter_article_view.html.erb +14 -14
  38. data/app/views/alchemy/elements/_newsletter_greeting_view.html.erb +9 -9
  39. data/app/views/alchemy/elements/_newsletter_signout_form_view.html.erb +18 -18
  40. data/app/views/alchemy/elements/_newsletter_signup_form_view.html.erb +62 -62
  41. data/app/views/alchemy/essences/_essence_element_teaser_editor.html.erb +29 -29
  42. data/app/views/alchemy/newsletter_layouts/_standard.html.erb +37 -37
  43. data/app/views/alchemy_crm/admin/contact_groups/_contact_group.html.erb +30 -30
  44. data/app/views/alchemy_crm/admin/contact_groups/_filter.html.erb +28 -28
  45. data/app/views/alchemy_crm/admin/contact_groups/_form.html.erb +45 -45
  46. data/app/views/alchemy_crm/admin/contact_groups/_tag.html.erb +4 -4
  47. data/app/views/alchemy_crm/admin/contact_groups/add_filter.js.erb +7 -7
  48. data/app/views/alchemy_crm/admin/contact_groups/index.html.erb +28 -28
  49. data/app/views/alchemy_crm/admin/contacts/_contact.html.erb +42 -42
  50. data/app/views/alchemy_crm/admin/contacts/_form.html.erb +76 -76
  51. data/app/views/alchemy_crm/admin/contacts/import.html.erb +27 -27
  52. data/app/views/alchemy_crm/admin/contacts/index.html.erb +39 -39
  53. data/app/views/alchemy_crm/admin/contacts/vcf_import_result.html.erb +24 -24
  54. data/app/views/alchemy_crm/admin/deliveries/_delivery.html.erb +30 -30
  55. data/app/views/alchemy_crm/admin/deliveries/_form.html.erb +61 -61
  56. data/app/views/alchemy_crm/admin/deliveries/_recipient.html.erb +36 -36
  57. data/app/views/alchemy_crm/admin/deliveries/index.html.erb +21 -21
  58. data/app/views/alchemy_crm/admin/deliveries/show.html.erb +61 -61
  59. data/app/views/alchemy_crm/admin/elements/teasables.html.erb +53 -53
  60. data/app/views/alchemy_crm/admin/mailings/_form.html.erb +41 -41
  61. data/app/views/alchemy_crm/admin/mailings/_mailing.html.erb +73 -73
  62. data/app/views/alchemy_crm/admin/mailings/edit_content.html.erb +170 -170
  63. data/app/views/alchemy_crm/admin/mailings/import_result.html.erb +18 -18
  64. data/app/views/alchemy_crm/admin/mailings/index.html.erb +25 -25
  65. data/app/views/alchemy_crm/admin/newsletters/_form.html.erb +52 -52
  66. data/app/views/alchemy_crm/admin/newsletters/_tag_with_radiobutton.html.erb +5 -5
  67. data/app/views/alchemy_crm/admin/newsletters/index.html.erb +29 -29
  68. data/app/views/alchemy_crm/admin/newsletters/new.html.erb +4 -4
  69. data/app/views/alchemy_crm/admin/tags/_radio_tag.html.erb +4 -4
  70. data/app/views/alchemy_crm/admin/tags/_tag.html.erb +30 -30
  71. data/app/views/alchemy_crm/admin/tags/edit.html.erb +32 -32
  72. data/app/views/alchemy_crm/admin/tags/index.html.erb +23 -23
  73. data/app/views/alchemy_crm/admin/tags/new.html.erb +14 -14
  74. data/app/views/alchemy_crm/contacts_mailer/signout_mail.html.erb +6 -6
  75. data/app/views/alchemy_crm/contacts_mailer/signout_mail.text.erb +2 -2
  76. data/app/views/alchemy_crm/contacts_mailer/signup_mail.html.erb +9 -9
  77. data/app/views/alchemy_crm/contacts_mailer/signup_mail.text.erb +2 -2
  78. data/app/views/alchemy_crm/mailings_mailer/verification_mail.html.erb +9 -9
  79. data/app/views/alchemy_crm/subscriptions/index.html.erb +4 -4
  80. data/app/views/alchemy_crm/subscriptions_mailer/overview_mail.html.erb +25 -25
  81. data/app/views/alchemy_crm/subscriptions_mailer/overview_mail.text.erb +2 -2
  82. data/app/views/csv_magic/import_errors.html.erb +23 -23
  83. data/app/views/csv_magic/mapper.html.erb +46 -46
  84. data/app/views/layouts/alchemy_crm/mailings.html.erb +177 -177
  85. data/config/initializers/assets.rb +2 -2
  86. data/config/locales/alchemy_crm.de.yml +1 -1
  87. data/config/locales/alchemy_crm.en.yml +1 -0
  88. data/config/locales/localized_country_select.de.rb +260 -260
  89. data/config/locales/localized_country_select.en.rb +274 -274
  90. data/config/routes.rb +67 -67
  91. data/db/migrate/20111104125306_remove_sent_mailing_pdf_id_from_sent_mailings.rb +1 -1
  92. data/db/migrate/20111124145923_namespace_alchemy_crm_models.rb +13 -13
  93. data/db/migrate/20120307160721_rename_alchemy_crm_recipients_sent_mailing_id.rb +3 -3
  94. data/db/migrate/20120320103412_add_indexes_to_alchemy_crm_sha1_columns.rb +3 -3
  95. data/db/migrate/20120327174301_add_more_indexes_to_alchemy_crm_tables.rb +10 -10
  96. data/lib/alchemy_crm.rb +15 -15
  97. data/lib/alchemy_crm/bounced_delivery.rb +38 -38
  98. data/lib/alchemy_crm/config.rb +25 -25
  99. data/lib/alchemy_crm/engine.rb +31 -31
  100. data/lib/alchemy_crm/i18n_helpers.rb +28 -28
  101. data/lib/alchemy_crm/newsletter_layout.rb +28 -28
  102. data/lib/alchemy_crm/seeder.rb +26 -26
  103. data/lib/alchemy_crm/version.rb +1 -1
  104. data/lib/generators/alchemy_crm/scaffold/files/newsletters.html.erb +19 -19
  105. data/lib/generators/alchemy_crm/scaffold/scaffold_generator.rb +2 -2
  106. data/lib/tasks/alchemy_crm.rake +22 -22
  107. data/lib/tasks/routes.rake +25 -25
  108. data/spec/config_spec.rb +24 -24
  109. data/spec/controllers/alchemy_crm/contacts_controller_spec.rb +147 -147
  110. data/spec/controllers/alchemy_crm/mailings_controller_spec.rb +62 -62
  111. data/spec/controllers/alchemy_crm/recipients_controller_spec.rb +109 -109
  112. data/spec/helpers/alchemy_crm/mailings_helper_spec.rb +165 -165
  113. data/spec/mailers/alchemy_crm/contacts_mailer_spec.rb +84 -84
  114. data/spec/mailers/alchemy_crm/mailings_mailer_spec.rb +29 -29
  115. data/spec/models/alchemy_crm/contact_group_spec.rb +25 -25
  116. data/spec/models/alchemy_crm/contact_spec.rb +71 -71
  117. data/spec/models/alchemy_crm/delivery_spec.rb +43 -39
  118. data/spec/models/alchemy_crm/mailing_spec.rb +46 -42
  119. data/spec/models/alchemy_crm/newsletter_spec.rb +29 -29
  120. data/spec/spec_helper.rb +36 -36
  121. metadata +6 -8
  122. data/rails/init.rb +0 -1
  123. data/recipes/alchemy-mailings-capistrano-tasks.rb +0 -12
@@ -1,9 +1,9 @@
1
1
  module AlchemyCrm
2
- class Reaction < ActiveRecord::Base
2
+ class Reaction < ActiveRecord::Base
3
3
 
4
- belongs_to :recipient
5
- belongs_to :page
6
- belongs_to :element
4
+ belongs_to :recipient
5
+ belongs_to :page
6
+ belongs_to :element
7
7
 
8
- end
8
+ end
9
9
  end
@@ -1,48 +1,48 @@
1
1
  module AlchemyCrm
2
- class Recipient < ActiveRecord::Base
3
-
4
- belongs_to :delivery
5
- belongs_to :contact
6
- has_many :reactions
7
-
8
- validates_presence_of :email
9
- validates_format_of :email, :with => Authlogic::Regex.email, :if => proc { email.present? }
10
-
11
- before_create :set_sha1
12
-
13
- def mail_to
14
- contact.nil? ? email : "#{contact.name_with_title} <#{email}>"
15
- end
16
-
17
- def reads!
18
- update_attributes(:read => true, :read_at => Time.now)
19
- end
20
-
21
- def reacts!(options={})
22
- update_attributes(
23
- :reacted => true,
24
- :reacted_at => Time.now
25
- )
26
- reactions.create(
27
- :element_id => options[:element_id],
28
- :page_id => options[:page_id],
29
- :url => options[:url]
30
- )
31
- end
32
-
33
- def self.new_from_contact(contact)
34
- raise "No contact given!" if contact.nil?
35
- recipient = new(:contact => contact, :email => contact.email, :sha1 => Digest::SHA1.hexdigest(Time.now.to_i.to_s))
36
- recipient.readonly!
37
- recipient
38
- end
39
-
40
- private
41
-
42
- def set_sha1
43
- self.salt = [Array.new(6){rand(256).chr}.join].pack("m")[0..7]
44
- self.sha1 = Digest::SHA1.hexdigest(Time.now.to_i.to_s + salt)
45
- end
46
-
47
- end
2
+ class Recipient < ActiveRecord::Base
3
+
4
+ belongs_to :delivery
5
+ belongs_to :contact
6
+ has_many :reactions
7
+
8
+ validates_presence_of :email
9
+ validates_format_of :email, :with => Authlogic::Regex.email, :if => proc { email.present? }
10
+
11
+ before_create :set_sha1
12
+
13
+ def mail_to
14
+ contact.nil? ? email : "#{contact.name_with_title} <#{email}>"
15
+ end
16
+
17
+ def reads!
18
+ update_attributes(:read => true, :read_at => Time.now)
19
+ end
20
+
21
+ def reacts!(options={})
22
+ update_attributes(
23
+ :reacted => true,
24
+ :reacted_at => Time.now
25
+ )
26
+ reactions.create(
27
+ :element_id => options[:element_id],
28
+ :page_id => options[:page_id],
29
+ :url => options[:url]
30
+ )
31
+ end
32
+
33
+ def self.new_from_contact(contact)
34
+ raise "No contact given!" if contact.nil?
35
+ recipient = new(:contact => contact, :email => contact.email, :sha1 => Digest::SHA1.hexdigest(Time.now.to_i.to_s))
36
+ recipient.readonly!
37
+ recipient
38
+ end
39
+
40
+ private
41
+
42
+ def set_sha1
43
+ self.salt = [Array.new(6){rand(256).chr}.join].pack("m")[0..7]
44
+ self.sha1 = Digest::SHA1.hexdigest(Time.now.to_i.to_s + salt)
45
+ end
46
+
47
+ end
48
48
  end
@@ -1,8 +1,8 @@
1
1
  module AlchemyCrm
2
- class Subscription < ActiveRecord::Base
2
+ class Subscription < ActiveRecord::Base
3
3
 
4
- belongs_to :contact
5
- belongs_to :newsletter
4
+ belongs_to :contact
5
+ belongs_to :newsletter
6
6
 
7
- end
7
+ end
8
8
  end
@@ -1,13 +1,13 @@
1
1
  (function($) {
2
- <% @target_contents.each do |tc| %>
3
- $("#<%= tc.form_field_id %>").val('<%= escape_javascript(content.ingredient) %>');
4
- <% if content.essence_type == "EssenceRichtext" %>
5
- tinymce.get('<%= tc.form_field_id %>').load();
6
- <% end %>
7
- <% end %>
8
- $('#<%= @content.form_field_id(:url) %>').val('<%= @params %>');
9
- Alchemy.setElementDirty('#element_<%= @element.id %>')
10
- Alchemy.PreviewWindow.refresh();
11
- Alchemy.closeCurrentWindow();
12
- Alchemy.growl('<%=t("Inhalte wurden übernommen", :scope => "alchemy_crm") %>');
2
+ <% @target_contents.each do |tc| %>
3
+ $("#<%= tc.form_field_id %>").val('<%= escape_javascript(content.ingredient) %>');
4
+ <% if content.essence_type == "EssenceRichtext" %>
5
+ tinymce.get('<%= tc.form_field_id %>').load();
6
+ <% end %>
7
+ <% end %>
8
+ $('#<%= @content.form_field_id(:url) %>').val('<%= @params %>');
9
+ Alchemy.setElementDirty('#element_<%= @element.id %>')
10
+ Alchemy.PreviewWindow.refresh();
11
+ Alchemy.closeCurrentWindow();
12
+ Alchemy.growl('<%=t("Inhalte wurden übernommen", :scope => "alchemy_crm") %>');
13
13
  })(jQuery);
@@ -1,16 +1,16 @@
1
1
  <table class="newsletter_article" cellpadding="0" cellspacing="0" border="0" width="100%"<%= element_preview_code(element) -%>>
2
- <tr>
3
- <% if element.has_ingredient?(:image) -%>
4
- <td width="240" valign="top" style="padding-right: 10px">
5
- <%= render_essence_view_by_name(element, 'image', {:image_size => '240x160', :crop => true}, {:style => "outline:none; text-decoration:none; -ms-interpolation-mode: bicubic; display: block"}) %>
6
- </td>
7
- <% end -%>
8
- <td valign="top">
9
- <h2><%= render_essence_view_by_name(element, 'headline') %></h2>
10
- <%= render_essence_view_by_name(element, 'text') %>
11
- <% if element.has_ingredient?('link') -%>
12
- <%= tracked_link_tag ::I18n.t(:more), element.ingredient('link') %>
13
- <% end -%>
14
- </td>
15
- </tr>
2
+ <tr>
3
+ <% if element.has_ingredient?(:image) -%>
4
+ <td width="240" valign="top" style="padding-right: 10px">
5
+ <%= render_essence_view_by_name(element, 'image', {:image_size => '240x160', :crop => true}, {:style => "outline:none; text-decoration:none; -ms-interpolation-mode: bicubic; display: block"}) %>
6
+ </td>
7
+ <% end -%>
8
+ <td valign="top">
9
+ <h2><%= render_essence_view_by_name(element, 'headline') %></h2>
10
+ <%= render_essence_view_by_name(element, 'text') %>
11
+ <% if element.has_ingredient?('link') -%>
12
+ <%= tracked_link_tag ::I18n.t(:more), element.ingredient('link') %>
13
+ <% end -%>
14
+ </td>
15
+ </tr>
16
16
  </table>
@@ -1,11 +1,11 @@
1
1
  <div class="newsletter_greeting" <%= element_preview_code(element) -%>>
2
- <h2>
3
- <% if @contact.salutation == "ms" -%>
4
- <%= render_essence_view_by_name(element, 'female_greeting') %>
5
- <% else -%>
6
- <%= render_essence_view_by_name(element, 'male_greeting') %>
7
- <% end -%>
8
- <%= @contact.fullname %>,
9
- </h2>
10
- <%= render_essence_view_by_name(element, 'text') %>
2
+ <h2>
3
+ <% if @contact.salutation == "ms" -%>
4
+ <%= render_essence_view_by_name(element, 'female_greeting') %>
5
+ <% else -%>
6
+ <%= render_essence_view_by_name(element, 'male_greeting') %>
7
+ <% end -%>
8
+ <%= @contact.fullname %>,
9
+ </h2>
10
+ <%= render_essence_view_by_name(element, 'text') %>
11
11
  </div>
@@ -9,24 +9,24 @@
9
9
  <% else -%>
10
10
 
11
11
  <%= form_tag alchemy_crm.signout_contacts_path do %>
12
- <% if flash[:notice].present? -%>
13
- <p class="flash notice"><%= flash[:notice] %></p>
14
- <% end -%>
15
- <table>
16
- <tr>
17
- <td class="label">
18
- <%= label_tag 'email', ::I18n.t(:email, :scope => "activerecord.attributes.alchemy_crm/contact") %>
19
- </td>
20
- <td class="input">
21
- <%= email_field_tag 'email', params[:email], :required => true, :class => 'text_field' %>
22
- </td>
23
- </tr>
24
- <tr>
25
- <td colspan="2" class="submit">
26
- <%= button_tag ::I18n.t('signout_form.button_label', :scope => :alchemy_crm), :name => nil %>
27
- </td>
28
- </tr>
29
- </table>
12
+ <% if flash[:notice].present? -%>
13
+ <p class="flash notice"><%= flash[:notice] %></p>
14
+ <% end -%>
15
+ <table>
16
+ <tr>
17
+ <td class="label">
18
+ <%= label_tag 'email', ::I18n.t(:email, :scope => "activerecord.attributes.alchemy_crm/contact") %>
19
+ </td>
20
+ <td class="input">
21
+ <%= email_field_tag 'email', params[:email], :required => true, :class => 'text_field' %>
22
+ </td>
23
+ </tr>
24
+ <tr>
25
+ <td colspan="2" class="submit">
26
+ <%= button_tag ::I18n.t('signout_form.button_label', :scope => :alchemy_crm), :name => nil %>
27
+ </td>
28
+ </tr>
29
+ </table>
30
30
  <% end %>
31
31
 
32
32
  <% end -%>
@@ -11,68 +11,68 @@
11
11
  <% else -%>
12
12
 
13
13
  <%= form_for [alchemy_crm, @contact ||= AlchemyCrm::Contact.new], :url => alchemy_crm.signup_contacts_path do |form| %>
14
- <% if flash[:notice].present? -%>
15
- <p class="flash notice"><%= flash[:notice] %></p>
16
- <% end -%>
17
- <%= form.error_messages %>
18
- <table>
19
- <tr>
20
- <td class="label"><%= form.label :salutation %></td>
21
- <td class="input" colspan="3">
22
- <%= form.radio_button :salutation, :mr, :required => true %>
23
- <%= form.label :salutation_mr, ::I18n.t(:mr, :scope => 'alchemy_crm.salutations', :default => 'Mr') %>
24
- <%= form.radio_button :salutation, :ms, :required => true %>
25
- <%= form.label :salutation_ms, ::I18n.t(:ms, :scope => 'alchemy_crm.salutations', :default => 'Ms') %>
26
- </td>
27
- </tr>
28
- <tr>
29
- <td class="label"><%= form.label :firstname %></td>
30
- <td class="input" colspan="3"><%= form.text_field :firstname, :class => 'text_field', :required => true %></td>
31
- </tr>
32
- <tr>
33
- <td class="label"><%= form.label :lastname %></td>
34
- <td class="input" colspan="3"><%= form.text_field :lastname, :class => 'text_field', :required => true %></td>
35
- </tr>
36
- <tr>
37
- <td class="label"><%= form.label :email %></td>
38
- <td class="input" colspan="3"><%= form.email_field :email, :class => 'text_field', :required => true %></td>
39
- </tr>
40
- <tr>
41
- <td class="label"><%= form.label :address %></td>
42
- <td class="input" colspan="3"><%= form.text_field :address, :class => 'text_field' %></td>
43
- </tr>
44
- <tr>
45
- <td class="label"><%= form.label :zip %></td>
46
- <td class="input short"><%= form.text_field :zip, :class => 'text_field' %></td>
47
- <td class="label short"><%= form.label :city %></td>
48
- <td class="input medium"><%= form.text_field :city, :class => 'text_field' %></td>
49
- </tr>
50
- <tr>
51
- <td class="label"><%= form.label :phone %></td>
52
- <td class="input" colspan="3"><%= form.text_field :phone, :class => 'text_field' %></td>
53
- </tr>
54
- <tr>
55
- <td colspan="4">
56
- <%= render_essence_view_by_name element, 'choose_newsletter_text' %>
57
- <% if @newsletters.length == 1 -%>
58
- <%= hidden_field_tag "contact[subscriptions_attributes][0][newsletter_id]", @newsletters.first.id %>
59
- <% else -%>
60
- <% @newsletters.each_with_index do |newsletter, idx| -%>
61
- <p>
62
- <%= check_box_tag "contact[subscriptions_attributes][#{idx}][newsletter_id]", newsletter.id, @contact.subscriptions.detect { |ns| ns.newsletter_id == newsletter.id } %>
63
- <%= label_tag "contact[subscriptions_attributes][#{idx}][newsletter_id]", newsletter.name %>
64
- </p>
65
- <% end -%>
66
- <% end -%>
67
- </td>
68
- </tr>
69
- <tr>
70
- <td colspan="4" class="submit">
71
- <%= form.button ::I18n.t('subscribe_form.button_label', :scope => :alchemy_crm), :name => nil %>
72
- </td>
73
- </tr>
74
- </table>
75
- <p class="mandatory_fields_notice"><%= ::I18n.t(:mandatory_fields, :scope => :alchemy_crm) %></p>
14
+ <% if flash[:notice].present? -%>
15
+ <p class="flash notice"><%= flash[:notice] %></p>
16
+ <% end -%>
17
+ <%= form.error_messages %>
18
+ <table>
19
+ <tr>
20
+ <td class="label"><%= form.label :salutation %></td>
21
+ <td class="input" colspan="3">
22
+ <%= form.radio_button :salutation, :mr, :required => true %>
23
+ <%= form.label :salutation_mr, ::I18n.t(:mr, :scope => 'alchemy_crm.salutations', :default => 'Mr') %>
24
+ <%= form.radio_button :salutation, :ms, :required => true %>
25
+ <%= form.label :salutation_ms, ::I18n.t(:ms, :scope => 'alchemy_crm.salutations', :default => 'Ms') %>
26
+ </td>
27
+ </tr>
28
+ <tr>
29
+ <td class="label"><%= form.label :firstname %></td>
30
+ <td class="input" colspan="3"><%= form.text_field :firstname, :class => 'text_field', :required => true %></td>
31
+ </tr>
32
+ <tr>
33
+ <td class="label"><%= form.label :lastname %></td>
34
+ <td class="input" colspan="3"><%= form.text_field :lastname, :class => 'text_field', :required => true %></td>
35
+ </tr>
36
+ <tr>
37
+ <td class="label"><%= form.label :email %></td>
38
+ <td class="input" colspan="3"><%= form.email_field :email, :class => 'text_field', :required => true %></td>
39
+ </tr>
40
+ <tr>
41
+ <td class="label"><%= form.label :address %></td>
42
+ <td class="input" colspan="3"><%= form.text_field :address, :class => 'text_field' %></td>
43
+ </tr>
44
+ <tr>
45
+ <td class="label"><%= form.label :zip %></td>
46
+ <td class="input short"><%= form.text_field :zip, :class => 'text_field' %></td>
47
+ <td class="label short"><%= form.label :city %></td>
48
+ <td class="input medium"><%= form.text_field :city, :class => 'text_field' %></td>
49
+ </tr>
50
+ <tr>
51
+ <td class="label"><%= form.label :phone %></td>
52
+ <td class="input" colspan="3"><%= form.text_field :phone, :class => 'text_field' %></td>
53
+ </tr>
54
+ <tr>
55
+ <td colspan="4">
56
+ <%= render_essence_view_by_name element, 'choose_newsletter_text' %>
57
+ <% if @newsletters.length == 1 -%>
58
+ <%= hidden_field_tag "contact[subscriptions_attributes][0][newsletter_id]", @newsletters.first.id %>
59
+ <% else -%>
60
+ <% @newsletters.each_with_index do |newsletter, idx| -%>
61
+ <p>
62
+ <%= check_box_tag "contact[subscriptions_attributes][#{idx}][newsletter_id]", newsletter.id, @contact.subscriptions.detect { |ns| ns.newsletter_id == newsletter.id } %>
63
+ <%= label_tag "contact[subscriptions_attributes][#{idx}][newsletter_id]", newsletter.name %>
64
+ </p>
65
+ <% end -%>
66
+ <% end -%>
67
+ </td>
68
+ </tr>
69
+ <tr>
70
+ <td colspan="4" class="submit">
71
+ <%= form.button ::I18n.t('subscribe_form.button_label', :scope => :alchemy_crm), :name => nil %>
72
+ </td>
73
+ </tr>
74
+ </table>
75
+ <p class="mandatory_fields_notice"><%= ::I18n.t(:mandatory_fields, :scope => :alchemy_crm) %></p>
76
76
  <% end %>
77
77
 
78
78
  <% end -%>
@@ -1,31 +1,31 @@
1
1
  <div class="content_editor" id="<%= content_dom_id(content) %>">
2
- <%- if options[:show_link_text] -%>
3
- <label>Link Text</label>
4
- <%= text_field_tag(
5
- "contents[content_#{content.id}][text]",
6
- content.essence.text,
7
- :id => "content_#{content.id}_text",
8
- :class => "thin_border text_long"
9
- ) %>
10
- <%- end -%>
11
- <%= hidden_field_tag "contents[content_#{content.id}][url]", content.essence.url, :id => "content_#{content.id}_url" %>
12
- <%= hidden_field_tag "contents[content_#{content.id}][title]", content.essence.title, :id => "content_#{content.id}_title" %>
13
- <div style="overflow: hidden; margin: 4px 0; line-height: 25px">
14
- <p>
15
- Mit einem Element aus dem CMS verknüpfen:
16
- <%= link_to_overlay_window(
17
- render_icon('fill_from_element'),
18
- teasable_elements_path(:content_id => content.id),
19
- {
20
- :title => 'Element aus dem CMS wählen',
21
- :size => '450x500'
22
- },
23
- {
24
- :class => 'icon_button',
25
- :title => 'Element aus dem CMS wählen',
26
- :style => 'float: right'
27
- }
28
- ) -%>
29
- </p>
30
- </div>
2
+ <%- if options[:show_link_text] -%>
3
+ <label>Link Text</label>
4
+ <%= text_field_tag(
5
+ "contents[content_#{content.id}][text]",
6
+ content.essence.text,
7
+ :id => "content_#{content.id}_text",
8
+ :class => "thin_border text_long"
9
+ ) %>
10
+ <%- end -%>
11
+ <%= hidden_field_tag "contents[content_#{content.id}][url]", content.essence.url, :id => "content_#{content.id}_url" %>
12
+ <%= hidden_field_tag "contents[content_#{content.id}][title]", content.essence.title, :id => "content_#{content.id}_title" %>
13
+ <div style="overflow: hidden; margin: 4px 0; line-height: 25px">
14
+ <p>
15
+ Mit einem Element aus dem CMS verknüpfen:
16
+ <%= link_to_overlay_window(
17
+ render_icon('fill_from_element'),
18
+ teasable_elements_path(:content_id => content.id),
19
+ {
20
+ :title => 'Element aus dem CMS wählen',
21
+ :size => '450x500'
22
+ },
23
+ {
24
+ :class => 'icon_button',
25
+ :title => 'Element aus dem CMS wählen',
26
+ :style => 'float: right'
27
+ }
28
+ ) -%>
29
+ </p>
30
+ </div>
31
31
  </div>
@@ -1,39 +1,39 @@
1
1
  <table cellpadding="0" cellspacing="0" border="0" align="center" width="100%">
2
- <tr>
3
- <td valign="top">
4
- <table cellpadding="0" cellspacing="0" border="0" align="center" width="610">
5
- <tr>
6
- <td valign="middle">
7
- <%= image_from_server_tag('logo.png', :style => 'outline:none; text-decoration:none; -ms-interpolation-mode: bicubic;') %>
8
- </td>
9
- <td valign="middle" align="center">
10
- <h1>Newsletter in <%= current_language.name %></h1>
11
- <h2><%= @mailing.name %></h2>
12
- </td>
13
- </tr>
14
- </table>
15
- </td>
16
- </tr>
17
- <tr>
18
- <td valign="top">
19
- <table cellpadding="0" cellspacing="0" border="0" align="center" width="610">
20
- <tr>
21
- <td valign="top">
22
- <%= render_elements %>
23
- </td>
24
- </tr>
25
- </table
26
- </td>
27
- </tr>
28
- <tr>
29
- <td valign="top">
30
- <table cellpadding="0" cellspacing="0" border="0" align="center" width="610">
31
- <tr>
32
- <td valign="top">
33
- <%= link_to_unsubscribe_page %>
34
- </td>
35
- </tr>
36
- </table
37
- </td>
38
- </tr>
2
+ <tr>
3
+ <td valign="top">
4
+ <table cellpadding="0" cellspacing="0" border="0" align="center" width="610">
5
+ <tr>
6
+ <td valign="middle">
7
+ <%= image_from_server_tag('logo.png', :style => 'outline:none; text-decoration:none; -ms-interpolation-mode: bicubic;') %>
8
+ </td>
9
+ <td valign="middle" align="center">
10
+ <h1>Newsletter in <%= current_language.name %></h1>
11
+ <h2><%= @mailing.name %></h2>
12
+ </td>
13
+ </tr>
14
+ </table>
15
+ </td>
16
+ </tr>
17
+ <tr>
18
+ <td valign="top">
19
+ <table cellpadding="0" cellspacing="0" border="0" align="center" width="610">
20
+ <tr>
21
+ <td valign="top">
22
+ <%= render_elements %>
23
+ </td>
24
+ </tr>
25
+ </table
26
+ </td>
27
+ </tr>
28
+ <tr>
29
+ <td valign="top">
30
+ <table cellpadding="0" cellspacing="0" border="0" align="center" width="610">
31
+ <tr>
32
+ <td valign="top">
33
+ <%= link_to_unsubscribe_page %>
34
+ </td>
35
+ </tr>
36
+ </table
37
+ </td>
38
+ </tr>
39
39
  </table>