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,33 +1,33 @@
1
1
  <%= form_tag import_admin_contacts_path, :remote => request.xhr?, :multipart => true, :class => 'contact_import' do %>
2
2
 
3
- <div class="info">
4
- <%= render_icon('info') %>
5
- <h1><%= alchemy_crm_t(:headline, :scope => 'import_format_notice') %></h1>
6
- <ul>
7
- <li><%= alchemy_crm_t(:vcf_format, :scope => 'import_format_notice') %></li>
8
- <li><%= alchemy_crm_t(:csv_format, :scope => 'import_format_notice') %></li>
9
- </ul>
10
- </div>
3
+ <div class="info">
4
+ <%= render_icon('info') %>
5
+ <h1><%= alchemy_crm_t(:headline, :scope => 'import_format_notice') %></h1>
6
+ <ul>
7
+ <li><%= alchemy_crm_t(:vcf_format, :scope => 'import_format_notice') %></li>
8
+ <li><%= alchemy_crm_t(:csv_format, :scope => 'import_format_notice') %></li>
9
+ </ul>
10
+ </div>
11
11
 
12
- <div id="errors" style="display: none"></div>
12
+ <div id="errors" style="display: none"></div>
13
13
 
14
- <table>
15
- <tr>
16
- <td class="label"><%= label_tag :file, alchemy_crm_t(:file) %></td>
17
- <td><%= file_field_tag :file %></td>
18
- </tr>
19
- <tr>
20
- <td></td>
21
- <td>
22
- <%= check_box_tag :verified %>
23
- <%= label_tag :verified, alchemy_crm_t(:import_contacts_verified) %>
24
- </td>
25
- </tr>
26
- <tr>
27
- <td class="submit" colspan="2">
28
- <%= button_tag alchemy_crm_t(:import), :name => nil, :class => 'button' %>
29
- </td>
30
- </tr>
31
- </table>
14
+ <table>
15
+ <tr>
16
+ <td class="label"><%= label_tag :file, alchemy_crm_t(:file) %></td>
17
+ <td><%= file_field_tag :file %></td>
18
+ </tr>
19
+ <tr>
20
+ <td></td>
21
+ <td>
22
+ <%= check_box_tag :verified %>
23
+ <%= label_tag :verified, alchemy_crm_t(:import_contacts_verified) %>
24
+ </td>
25
+ </tr>
26
+ <tr>
27
+ <td class="submit" colspan="2">
28
+ <%= button_tag alchemy_crm_t(:import), :name => nil, :class => 'button' %>
29
+ </td>
30
+ </tr>
31
+ </table>
32
32
 
33
33
  <% end %>
@@ -1,51 +1,51 @@
1
1
  <% content_for(:javascript_includes) do -%>
2
- <%= javascript_include_tag "alchemy_crm/scripts.js" %>
2
+ <%= javascript_include_tag "alchemy_crm/scripts.js" %>
3
3
  <% end -%>
4
4
 
5
5
  <% content_for(:stylesheets) do -%>
6
- <%= stylesheet_link_tag('alchemy_crm/styles') %>
6
+ <%= stylesheet_link_tag('alchemy_crm/styles') %>
7
7
  <% end -%>
8
8
 
9
9
  <% toolbar(
10
- :buttons => [
11
- {
12
- :icon => "contact_add",
13
- :label => alchemy_crm_t(:add_contact),
14
- :url => alchemy_crm.new_admin_contact_path,
15
- :title => alchemy_crm_t(:add_contact),
16
- :overlay_options => {
17
- :title => alchemy_crm_t(:add_contact),
18
- :size => '415x560'
19
- },
20
- :if_permitted_to => [:new, :alchemy_crm_admin_contacts]
21
- },
22
- {
23
- :icon => :contact_import,
24
- :label => alchemy_crm_t(:import_contacts),
25
- :url => alchemy_crm.import_admin_contacts_path,
26
- :title => alchemy_crm_t(:import_contacts),
27
- :overlay_options => {
28
- :title => alchemy_crm_t(:import_contacts),
29
- :size => '400x300'
30
- },
31
- :if_permitted_to => [:import, :alchemy_crm_admin_contacts]
32
- }
33
- ]
10
+ :buttons => [
11
+ {
12
+ :icon => "contact_add",
13
+ :label => alchemy_crm_t(:add_contact),
14
+ :url => alchemy_crm.new_admin_contact_path,
15
+ :title => alchemy_crm_t(:add_contact),
16
+ :overlay_options => {
17
+ :title => alchemy_crm_t(:add_contact),
18
+ :size => '415x560'
19
+ },
20
+ :if_permitted_to => [:new, :alchemy_crm_admin_contacts]
21
+ },
22
+ {
23
+ :icon => :contact_import,
24
+ :label => alchemy_crm_t(:import_contacts),
25
+ :url => alchemy_crm.import_admin_contacts_path,
26
+ :title => alchemy_crm_t(:import_contacts),
27
+ :overlay_options => {
28
+ :title => alchemy_crm_t(:import_contacts),
29
+ :size => '400x300'
30
+ },
31
+ :if_permitted_to => [:import, :alchemy_crm_admin_contacts]
32
+ }
33
+ ]
34
34
  ) %>
35
35
 
36
36
  <table class="list">
37
- <%- unless @contacts.blank? -%>
38
- <tr>
39
- <th class="icon"></th>
40
- <th class="name" style="width: 180px"><%= translate_model_attribute(:contact, :lastname).gsub(/\*$/, '') %></th>
41
- <th class="name" style="width: 180px"><%= translate_model_attribute(:contact, :firstname).gsub(/\*$/, '') %></th>
42
- <th class="name"><%= translate_model_attribute(:contact, :organisation) %></th>
43
- <th class="name"><%= translate_model_attribute(:contact, :email).gsub(/\*$/, '') %></th>
44
- <th class="name"><%= translate_model_attribute(:contact, :tags) %></th>
45
- <th class="center"><%= translate_model_attribute(:contact, :verified) %></th>
46
- <th class="tools" style="width: 60px"></th>
47
- </tr>
48
- <%- end -%>
49
- <%= render @contacts %>
37
+ <%- unless @contacts.blank? -%>
38
+ <tr>
39
+ <th class="icon"></th>
40
+ <th class="name" style="width: 180px"><%= translate_model_attribute(:contact, :lastname).gsub(/\*$/, '') %></th>
41
+ <th class="name" style="width: 180px"><%= translate_model_attribute(:contact, :firstname).gsub(/\*$/, '') %></th>
42
+ <th class="name"><%= translate_model_attribute(:contact, :organisation) %></th>
43
+ <th class="name"><%= translate_model_attribute(:contact, :email).gsub(/\*$/, '') %></th>
44
+ <th class="name"><%= translate_model_attribute(:contact, :tags) %></th>
45
+ <th class="center"><%= translate_model_attribute(:contact, :verified) %></th>
46
+ <th class="tools" style="width: 60px"></th>
47
+ </tr>
48
+ <%- end -%>
49
+ <%= render @contacts %>
50
50
  </table>
51
51
  <%= render 'alchemy/admin/partials/pagination_links', :items => @contacts, :scope => alchemy_crm %>
@@ -1,49 +1,49 @@
1
1
  <%- content_for(:javascript_includes) do -%>
2
- <%= javascript_include_tag "alchemy_crm/scripts.js" %>
2
+ <%= javascript_include_tag "alchemy_crm/scripts.js" %>
3
3
  <%- end -%>
4
4
 
5
5
  <%- content_for(:stylesheets) do -%>
6
- <%= stylesheet_link_tag('alchemy_crm/styles') %>
6
+ <%= stylesheet_link_tag('alchemy_crm/styles') %>
7
7
  <%- end -%>
8
8
 
9
9
  <h1><%= alchemy_crm_t('Import result') %></h1>
10
10
 
11
11
  <% if @valid_contacts.any? -%>
12
12
  <div class="flash notice" style="margin: 8px 0">
13
- <%= render_icon('true') %>
14
- <%= alchemy_crm_t('%{count} contacts imported successfully') % {:count => @valid_contacts.length} %>
13
+ <%= render_icon('true') %>
14
+ <%= alchemy_crm_t('%{count} contacts imported successfully') % {:count => @valid_contacts.length} %>
15
15
  </div>
16
16
  <% end -%>
17
17
 
18
18
  <% if @errors -%>
19
19
  <div class="flash error" style="margin: 8px 0">
20
- <%= render_icon('error') %><%= @errors %>
20
+ <%= render_icon('error') %><%= @errors %>
21
21
  </div>
22
22
  <% end -%>
23
23
 
24
24
  <% if @contacts -%>
25
25
  <table>
26
- <tr>
27
- <th><%= translate_model_attribute(:contact, :name) %></th>
28
- <th><%= translate_model_attribute(:contact, :email).gsub(/\*$/, '') %></th>
29
- <th><%= alchemy_crm_t(:import_status) %></th>
30
- </tr>
31
- <% @contacts.each do |contact| -%>
32
- <tr class="<%= cycle("even", "odd") %><%= contact.invalid? ? ' disabled' : nil -%>">
33
- <td><%= contact.fullname %></td>
34
- <td><%= contact.email %></td>
35
- <td>
36
- <% if contact.valid? -%>
37
- <%= render_icon(:true) %>
38
- <% else -%>
39
- <%= contact.errors.full_messages.join('<br>') %>
40
- <% end -%>
41
- </td>
42
- </tr>
43
- <% end -%>
26
+ <tr>
27
+ <th><%= translate_model_attribute(:contact, :name) %></th>
28
+ <th><%= translate_model_attribute(:contact, :email).gsub(/\*$/, '') %></th>
29
+ <th><%= alchemy_crm_t(:import_status) %></th>
30
+ </tr>
31
+ <% @contacts.each do |contact| -%>
32
+ <tr class="<%= cycle("even", "odd") %><%= contact.invalid? ? ' disabled' : nil -%>">
33
+ <td><%= contact.fullname %></td>
34
+ <td><%= contact.email %></td>
35
+ <td>
36
+ <% if contact.valid? -%>
37
+ <%= render_icon(:true) %>
38
+ <% else -%>
39
+ <%= contact.errors.full_messages.join('<br>') %>
40
+ <% end -%>
41
+ </td>
42
+ </tr>
43
+ <% end -%>
44
44
  </table>
45
45
  <% end -%>
46
46
 
47
47
  <p style="margin: 8px 0">
48
- <%= link_to t(:continue), admin_contacts_path, :class => 'button' %>
48
+ <%= link_to t(:continue), admin_contacts_path, :class => 'button' %>
49
49
  </p>
@@ -1,32 +1,32 @@
1
1
  <tr class="delivery <%= cycle('even', 'odd') %>">
2
- <td>
3
- <%= l(delivery.deliver_at, :format => :deliveries) %>
4
- <%- unless delivery.delivered? -%>
5
- <%= link_to_confirmation_window(
6
- render_icon('destroy'),
7
- alchemy_crm_t(:do_you_want_to_cancel_the_delivery?),
8
- admin_delivery_path(delivery),
9
- :title => alchemy_crm_t(:cancel_delivery)
10
- ) -%>
11
- <%- end -%>
12
- </td>
13
- <td class="right">
14
- <%= delivery.recipients.count %>
15
- </td>
16
- <td class="center">
17
- <%= render_icon(delivery.delivered?) %>
18
- </td>
19
- <td class="center">
20
- <%- if delivery.delivered? -%>
21
- <%= link_to_overlay_window(
22
- render_icon('statistics'),
23
- admin_delivery_path(delivery),
24
- {
25
- :title => alchemy_crm_t(:show_statistics) % {:name => delivery.mailing.name, :date => l(delivery.delivered_at)},
26
- :size => '540x400',
27
- :modal => false
28
- }
29
- ) %>
30
- <%- end -%>
31
- </td>
2
+ <td>
3
+ <%= l(delivery.deliver_at, :format => :deliveries) %>
4
+ <%- unless delivery.delivered? -%>
5
+ <%= link_to_confirmation_window(
6
+ render_icon('destroy'),
7
+ alchemy_crm_t(:do_you_want_to_cancel_the_delivery?),
8
+ admin_delivery_path(delivery),
9
+ :title => alchemy_crm_t(:cancel_delivery)
10
+ ) -%>
11
+ <%- end -%>
12
+ </td>
13
+ <td class="right">
14
+ <%= delivery.recipients.count %>
15
+ </td>
16
+ <td class="center">
17
+ <%= render_icon(delivery.delivered?) %>
18
+ </td>
19
+ <td class="center">
20
+ <%- if delivery.delivered? -%>
21
+ <%= link_to_overlay_window(
22
+ render_icon('statistics'),
23
+ admin_delivery_path(delivery),
24
+ {
25
+ :title => alchemy_crm_t(:show_statistics) % {:name => delivery.mailing.name, :date => l(delivery.delivered_at)},
26
+ :size => '540x400',
27
+ :modal => false
28
+ }
29
+ ) %>
30
+ <%- end -%>
31
+ </td>
32
32
  </tr>
@@ -1,65 +1,65 @@
1
1
  <%= form_for [:admin, @delivery] do |f| %>
2
- <div id="errors" style="display:none"></div>
3
- <table style="width: 100%">
4
- <tr>
5
- <td class="label"><%= f.label :name, 'Name:' %></td>
6
- <td><%= @mailing.name %></td>
7
- </tr>
8
- <tr>
9
- <td class="label"><%= f.label :subject, 'Betreff:' %></td>
10
- <td><%= @mailing.subject %></td>
11
- </tr>
12
- <tr>
13
- <td class="label"><%= f.label :recipients, 'Empfänger:' %></td>
14
- <td><%= @delivery.new_record? ? @mailing.contacts_not_having_email_yet.count : @delivery.recipients.count %> (<%= link_to_function "Empfänger anzeigen", "jQuery('#all_contacts').toggle(); AlchemyCrm.toggleLabel(this, 'Empfänger ausblenden', 'Empfänger anzeigen')" ,:class => "" %>)</td>
15
- </tr>
16
- <tr>
17
- <td></td>
18
- <td>
19
- <ul id="all_contacts" style="display: none">
20
- <% emails = @delivery.new_record? ? @mailing.emails : @delivery.recipients.collect(&:email) -%>
21
- <%- emails.each do |email| -%>
22
- <li class="<%= cycle("even", "odd") -%>"><%= email %></li>
23
- <%- end -%>
24
- </ul>
25
- </td>
26
- </tr>
27
- <tr>
28
- <td class="label">
29
- <%= f.label :deliver_at, "versenden am" %>
30
- </td>
31
- <td class="delivery_time">
32
- <%= text_field_tag nil, @delivery.deliver_at.strftime('%d.%m.%Y'), :class => 'datepicker thin_border', :id => nil, :style => 'width: 90px' %>
33
- <label>um</label>
34
- <%= f.time_select :deliver_at, { :minute_step => 15, :time_separator => '<label>:&nbsp;</label>'.html_safe }, { :class => 'alchemy_selectbox time_select' } %>
35
- <label>Uhr</label>
36
- </td>
37
- </tr>
38
- <tr>
39
- <td colspan="2" class="submit">
40
- <%= f.hidden_field :mailing_id %>
41
- <%= f.button("speichern", :class => "button") %>
42
- </td>
43
- </tr>
44
- </table>
2
+ <div id="errors" style="display:none"></div>
3
+ <table style="width: 100%">
4
+ <tr>
5
+ <td class="label"><%= f.label :name, 'Name:' %></td>
6
+ <td><%= @mailing.name %></td>
7
+ </tr>
8
+ <tr>
9
+ <td class="label"><%= f.label :subject, 'Betreff:' %></td>
10
+ <td><%= @mailing.subject %></td>
11
+ </tr>
12
+ <tr>
13
+ <td class="label"><%= f.label :recipients, 'Empfänger:' %></td>
14
+ <td><%= @delivery.new_record? ? @mailing.contacts_not_having_email_yet.count : @delivery.recipients.count %> (<%= link_to_function "Empfänger anzeigen", "jQuery('#all_contacts').toggle(); AlchemyCrm.toggleLabel(this, 'Empfänger ausblenden', 'Empfänger anzeigen')" ,:class => "" %>)</td>
15
+ </tr>
16
+ <tr>
17
+ <td></td>
18
+ <td>
19
+ <ul id="all_contacts" style="display: none">
20
+ <% emails = @delivery.new_record? ? @mailing.emails : @delivery.recipients.collect(&:email) -%>
21
+ <%- emails.each do |email| -%>
22
+ <li class="<%= cycle("even", "odd") -%>"><%= email %></li>
23
+ <%- end -%>
24
+ </ul>
25
+ </td>
26
+ </tr>
27
+ <tr>
28
+ <td class="label">
29
+ <%= f.label :deliver_at, "versenden am" %>
30
+ </td>
31
+ <td class="delivery_time">
32
+ <%= text_field_tag nil, @delivery.deliver_at.strftime('%d.%m.%Y'), :class => 'datepicker thin_border', :id => nil, :style => 'width: 90px' %>
33
+ <label>um</label>
34
+ <%= f.time_select :deliver_at, { :minute_step => 15, :time_separator => '<label>:&nbsp;</label>'.html_safe }, { :class => 'alchemy_selectbox time_select' } %>
35
+ <label>Uhr</label>
36
+ </td>
37
+ </tr>
38
+ <tr>
39
+ <td colspan="2" class="submit">
40
+ <%= f.hidden_field :mailing_id %>
41
+ <%= f.button("speichern", :class => "button") %>
42
+ </td>
43
+ </tr>
44
+ </table>
45
45
  <% end %>
46
46
  <script type="text/javascript" charset="utf-8">
47
- (function($) {
48
-
49
- $('input.datepicker').datepicker({
50
- dateFormat: 'dd.mm.yy',
51
- dayNames: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'],
52
- dayNamesMin: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
53
- monthNames: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
54
- monthNamesShort: ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'],
55
- onClose: function(dateText, inst) {
56
- var dateparts = dateText.split('.');
57
- console.info('partsText: ', dateparts);
58
- $('#delivery_deliver_at_1i').val(dateparts[2]);
59
- $('#delivery_deliver_at_2i').val(dateparts[1]);
60
- $('#delivery_deliver_at_3i').val(dateparts[0]);
61
- }
62
- });
63
-
64
- })(jQuery);
47
+ (function($) {
48
+
49
+ $('input.datepicker').datepicker({
50
+ dateFormat: 'dd.mm.yy',
51
+ dayNames: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'],
52
+ dayNamesMin: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
53
+ monthNames: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
54
+ monthNamesShort: ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'],
55
+ onClose: function(dateText, inst) {
56
+ var dateparts = dateText.split('.');
57
+ console.info('partsText: ', dateparts);
58
+ $('#delivery_deliver_at_1i').val(dateparts[2]);
59
+ $('#delivery_deliver_at_2i').val(dateparts[1]);
60
+ $('#delivery_deliver_at_3i').val(dateparts[0]);
61
+ }
62
+ });
63
+
64
+ })(jQuery);
65
65
  </script>
@@ -1,40 +1,40 @@
1
1
  <tr class="recipient">
2
- <td>
3
- <%= if recipient.contact.blank?
4
- "<i>#{alchemy_crm_t(:without)}</i>".html_safe
5
- else
6
- link_to(recipient.contact.fullname.blank? ? "<i>#{alchemy_crm_t(:without)}</i>".html_safe : recipient.contact.fullname, admin_contacts_path(:query => recipient.contact.email), :title => alchemy_crm_t(:show_contact))
7
- end
8
- %>
9
- </td>
10
- <td>
11
- <%= recipient.email %>
12
- </td>
13
- <%- if reactions -%>
14
- <td>
15
- <%- recipient.reactions.each do |reaction| -%>
16
- <%= reaction.url %><br />
17
- <%- end -%>
18
- </td>
2
+ <td>
3
+ <%= if recipient.contact.blank?
4
+ "<i>#{alchemy_crm_t(:without)}</i>".html_safe
5
+ else
6
+ link_to(recipient.contact.fullname.blank? ? "<i>#{alchemy_crm_t(:without)}</i>".html_safe : recipient.contact.fullname, admin_contacts_path(:query => recipient.contact.email), :title => alchemy_crm_t(:show_contact))
7
+ end
8
+ %>
9
+ </td>
10
+ <td>
11
+ <%= recipient.email %>
12
+ </td>
13
+ <%- if reactions -%>
14
+ <td>
15
+ <%- recipient.reactions.each do |reaction| -%>
16
+ <%= reaction.url %><br />
19
17
  <%- end -%>
20
- <%- if bounced -%>
21
- <td>
22
- <%- if recipient.contact -%>
23
- <%= link_to_overlay_window(
24
- alchemy_crm_t(:edit_contact),
25
- edit_admin_contact_path(recipient.contact),
26
- {
27
- :title => alchemy_crm_t(:edit_contact),
28
- :size => '415x560'
29
- },
30
- {
31
- :title => alchemy_crm_t(:edit_contact),
32
- :class => 'button with_icon edit'
33
- }
34
- ) -%>
35
- <%- else -%>
36
- &nbsp;
37
- <%- end -%>
38
- </td>
18
+ </td>
19
+ <%- end -%>
20
+ <%- if bounced -%>
21
+ <td>
22
+ <%- if recipient.contact -%>
23
+ <%= link_to_overlay_window(
24
+ alchemy_crm_t(:edit_contact),
25
+ edit_admin_contact_path(recipient.contact),
26
+ {
27
+ :title => alchemy_crm_t(:edit_contact),
28
+ :size => '415x560'
29
+ },
30
+ {
31
+ :title => alchemy_crm_t(:edit_contact),
32
+ :class => 'button with_icon edit'
33
+ }
34
+ ) -%>
35
+ <%- else -%>
36
+ &nbsp;
39
37
  <%- end -%>
38
+ </td>
39
+ <%- end -%>
40
40
  </tr>