wco_models 3.1.0.37 → 3.1.0.39

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 (182) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +3 -13
  3. data/app/assets/config/wco_models_manifest.js +2 -0
  4. data/app/assets/javascripts/wco/application.js +43 -5
  5. data/app/assets/javascripts/wco/collapse-expand.js +1 -0
  6. data/app/assets/javascripts/wco/file_upload.js +32 -0
  7. data/app/assets/javascripts/wco/shared.js +22 -0
  8. data/app/assets/stylesheets/wco/application.css +23 -8
  9. data/app/assets/stylesheets/wco/utils.scss +57 -1
  10. data/app/controllers/wco/application_controller.rb +9 -0
  11. data/app/controllers/wco/galleries_controller.rb +143 -0
  12. data/app/controllers/wco/headlines_controller.rb +71 -0
  13. data/app/controllers/wco/leads_controller.rb +59 -0
  14. data/app/controllers/wco/leadsets_controller.rb +90 -0
  15. data/app/controllers/wco/logs_controller.rb +64 -0
  16. data/app/controllers/wco/office_action_templates_controller.rb +80 -0
  17. data/app/controllers/wco/office_actions_controller.rb +71 -0
  18. data/app/controllers/wco/photos_controller.rb +78 -0
  19. data/app/controllers/wco/profiles_controller.rb +26 -0
  20. data/app/controllers/wco/publishers_controller.rb +60 -0
  21. data/app/controllers/wco/reports_controller.rb +75 -0
  22. data/app/controllers/wco/sites_controller.rb +52 -0
  23. data/app/controllers/wco/tags_controller.rb +57 -0
  24. data/app/helpers/wco/application_helper.rb +42 -0
  25. data/app/models/wco/asset.rb +26 -0
  26. data/app/models/wco/gallery.rb +3 -3
  27. data/app/models/wco/headline.rb +19 -0
  28. data/app/models/wco/invoice.rb +127 -0
  29. data/app/models/wco/lead.rb +42 -0
  30. data/app/models/wco/leadset.rb +8 -2
  31. data/app/models/wco/log.rb +18 -0
  32. data/app/models/wco/newsitem.rb +1 -0
  33. data/app/models/wco/office_action.rb +17 -18
  34. data/app/models/wco/office_action_template.rb +41 -0
  35. data/app/models/wco/office_action_template_tie.rb +20 -0
  36. data/app/models/wco/photo.rb +10 -8
  37. data/app/models/wco/price.rb +2 -0
  38. data/app/models/wco/product.rb +2 -0
  39. data/app/models/wco/profile.rb +1 -0
  40. data/app/models/wco/publisher.rb +68 -3
  41. data/app/models/wco/report.rb +48 -0
  42. data/app/models/wco/site.rb +12 -1
  43. data/app/models/wco/subscription.rb +1 -0
  44. data/app/models/wco/tag.rb +17 -4
  45. data/app/models/wco_email/campaign.rb +7 -11
  46. data/app/models/wco_email/context.rb +15 -14
  47. data/app/models/wco_email/conversation.rb +13 -27
  48. data/app/models/wco_email/{scheduled_email_action.rb → email_action.rb} +24 -20
  49. data/app/models/wco_email/email_action_template.rb +35 -0
  50. data/app/models/wco_email/email_filter.rb +9 -12
  51. data/app/models/wco_email/email_template.rb +124 -0
  52. data/app/models/wco_email/message.rb +228 -0
  53. data/app/models/wco_email/message_stub.rb +107 -0
  54. data/app/models/wco_email/obfuscated_redirect.rb +13 -0
  55. data/app/models/wco_email/unsubscribe.rb +19 -0
  56. data/app/models/wco_hosting/appliance.rb +1 -0
  57. data/app/models/wco_hosting/appliance_tmpl.rb +1 -0
  58. data/app/models/wco_hosting/domain.rb +1 -0
  59. data/app/models/wco_hosting/serverhost.rb +1 -0
  60. data/app/views/layouts/wco/application.haml +30 -17
  61. data/app/views/wco/_main_footer.haml +43 -0
  62. data/app/views/wco/_main_header.haml +37 -0
  63. data/app/views/wco/_main_header.haml-bk +109 -0
  64. data/app/views/wco/_paginate.haml +8 -0
  65. data/app/views/wco/_search.haml +8 -0
  66. data/app/views/wco/application/_debug.haml +0 -0
  67. data/app/views/wco/galleries/_form.haml +24 -0
  68. data/app/views/wco/galleries/_header.haml +8 -0
  69. data/app/views/wco/galleries/_index.haml +40 -0
  70. data/app/views/wco/galleries/_menu.haml-trash +10 -0
  71. data/app/views/wco/galleries/_menu_secondary.haml +12 -0
  72. data/app/views/wco/galleries/_thumbs.haml +9 -0
  73. data/app/views/wco/galleries/_title.haml +16 -0
  74. data/app/views/wco/galleries/edit.haml +6 -0
  75. data/app/views/wco/galleries/new.haml +6 -0
  76. data/app/views/wco/galleries/show.haml +43 -0
  77. data/app/views/wco/headlines/_form.haml +17 -0
  78. data/app/views/wco/headlines/_header.haml +6 -0
  79. data/app/views/wco/headlines/_index.haml +20 -0
  80. data/app/views/wco/headlines/edit.haml +6 -0
  81. data/app/views/wco/headlines/new.haml +2 -0
  82. data/app/views/wco/invoices/_form.haml-trash +29 -0
  83. data/app/views/wco/invoices/_header.haml +6 -0
  84. data/app/views/wco/invoices/_index_list.haml +13 -0
  85. data/app/views/wco/invoices/_index_table.haml +20 -0
  86. data/app/views/wco/invoices/index.haml +3 -0
  87. data/app/views/wco/invoices/new_pdf.haml +18 -0
  88. data/app/views/wco/invoices/new_stripe.haml +50 -0
  89. data/app/views/wco/invoices/show.haml +23 -0
  90. data/app/views/wco/kaminari/_first_page.html.erb +11 -0
  91. data/app/views/wco/kaminari/_gap.html.erb +8 -0
  92. data/app/views/wco/kaminari/_last_page.html.erb +11 -0
  93. data/app/views/wco/kaminari/_next_page.html.erb +11 -0
  94. data/app/views/wco/kaminari/_page.html.erb +13 -0
  95. data/app/views/wco/kaminari/_paginator.html.erb +25 -0
  96. data/app/views/wco/kaminari/_prev_page.html.erb +11 -0
  97. data/app/views/wco/leads/_form.haml +45 -0
  98. data/app/views/wco/leads/_form_import.haml +11 -0
  99. data/app/views/wco/leads/_header.haml +7 -0
  100. data/app/views/wco/leads/_index.haml +75 -0
  101. data/app/views/wco/leads/_index_rows.haml +11 -0
  102. data/app/views/wco/leads/edit.haml +22 -0
  103. data/app/views/wco/leads/index.haml +7 -0
  104. data/app/views/wco/leads/new.haml +9 -0
  105. data/app/views/wco/leads/show.haml +85 -0
  106. data/app/views/wco/leadsets/_form.haml +28 -0
  107. data/app/views/wco/leadsets/_header.haml +6 -0
  108. data/app/views/wco/leadsets/edit.haml +4 -0
  109. data/app/views/wco/leadsets/index.haml +45 -0
  110. data/app/views/wco/leadsets/index_dataTables.haml +33 -0
  111. data/app/views/wco/leadsets/new.haml +6 -0
  112. data/app/views/wco/leadsets/show.haml +52 -0
  113. data/app/views/wco/logs/_form.haml +17 -0
  114. data/app/views/wco/logs/_header.haml +6 -0
  115. data/app/views/wco/logs/_index.haml +23 -0
  116. data/app/views/wco/logs/edit.haml +6 -0
  117. data/app/views/wco/logs/new.haml +2 -0
  118. data/app/views/wco/office_action_templates/_form.haml +46 -0
  119. data/app/views/wco/office_action_templates/_header.haml +8 -0
  120. data/app/views/wco/office_action_templates/_ties.haml +18 -0
  121. data/app/views/wco/office_action_templates/edit.haml +6 -0
  122. data/app/views/wco/office_action_templates/index.haml +17 -0
  123. data/app/views/wco/office_action_templates/new.haml +5 -0
  124. data/app/views/wco/office_action_templates/show.haml +22 -0
  125. data/app/views/wco/office_actions/_form.haml +22 -0
  126. data/app/views/wco/office_actions/_header.haml +6 -0
  127. data/app/views/wco/office_actions/_index.haml +15 -0
  128. data/app/views/wco/office_actions/edit.haml +5 -0
  129. data/app/views/wco/office_actions/index.haml +10 -0
  130. data/app/views/wco/office_actions/new.haml +4 -0
  131. data/app/views/wco/office_actions/show.haml +5 -0
  132. data/app/views/wco/photos/_form.haml +0 -0
  133. data/app/views/wco/photos/_index_thumbs.haml +7 -0
  134. data/app/views/wco/photos/_meta.haml +7 -0
  135. data/app/views/wco/photos/_meta_manager.haml +7 -0
  136. data/app/views/wco/photos/_multinew.haml +6 -0
  137. data/app/views/wco/photos/index.haml +3 -0
  138. data/app/views/wco/photos/new.haml +0 -0
  139. data/app/views/wco/photos/show.haml +6 -0
  140. data/app/views/wco/photos/without_gallery.haml +11 -0
  141. data/app/views/wco/prices/_form.haml +1 -1
  142. data/app/views/wco/products/_header.haml +6 -0
  143. data/app/views/wco/publishers/_form.haml +28 -0
  144. data/app/views/wco/publishers/_header.haml +6 -0
  145. data/app/views/wco/publishers/edit.haml +4 -0
  146. data/app/views/wco/publishers/index.haml +37 -0
  147. data/app/views/wco/publishers/new.haml +4 -0
  148. data/app/views/wco/reports/_form.haml +28 -0
  149. data/app/views/wco/reports/_header.haml +14 -0
  150. data/app/views/wco/reports/edit.haml +4 -0
  151. data/app/views/wco/reports/index.haml +17 -0
  152. data/app/views/wco/reports/index_table.haml +17 -0
  153. data/app/views/wco/reports/new.haml +4 -0
  154. data/app/views/wco/reports/show.haml +8 -0
  155. data/app/views/wco/sites/_form.haml +21 -0
  156. data/app/views/wco/sites/_header.haml +6 -0
  157. data/app/views/wco/sites/edit.haml +4 -0
  158. data/app/views/wco/sites/index.haml +24 -0
  159. data/app/views/wco/sites/new.haml +4 -0
  160. data/app/views/wco/tags/_form.haml +10 -0
  161. data/app/views/wco/tags/_header.haml +6 -0
  162. data/app/views/wco/tags/_index.haml +10 -0
  163. data/app/views/wco/tags/_index_inline.haml +8 -0
  164. data/app/views/wco/tags/edit.haml +0 -0
  165. data/app/views/wco/tags/index.haml +9 -0
  166. data/app/views/wco/tags/new.haml +0 -0
  167. data/app/views/wco/tags/show.haml +15 -0
  168. data/config/routes.rb +42 -0
  169. data/lib/tasks/db_tasks.rake +13 -0
  170. data/lib/tasks/office_tasks.rake +36 -0
  171. data/lib/tasks/scrape_tasks.rake-trash +22 -0
  172. data/lib/wco/ai_writer.rb +55 -0
  173. data/lib/wco/engine.rb +0 -1
  174. data/lib/wco/office_worker.rb +4 -0
  175. data/lib/wco/scrape_wsj.rb +29 -0
  176. data/lib/wco/scrape_wsj_capy.rb +44 -0
  177. data/lib/wco_models.rb +19 -2
  178. metadata +254 -45
  179. data/app/helpers/ish_models/application_helper.rb +0 -4
  180. data/app/models/wco_email/message_template.rb +0 -6
  181. data/lib/tasks/ish_models_tasks.rake +0 -4
  182. /data/app/views/wco/{application/_alerts_notices.haml → _alerts_notices.haml} +0 -0
@@ -0,0 +1,20 @@
1
+
2
+ - headlines ||= @headlines
3
+
4
+ .headlines--index
5
+ %ul
6
+ - headlines.each do |headline|
7
+ %li
8
+ = link_to '[~]', edit_headline_path(headline)
9
+ .d-inline-block= button_to 'x', headline_path(headline), method: :delete, data: { confirm: 'Are you sure?' }
10
+ = headline.name
11
+ %ul
12
+ %li <b>Date:</b> #{headline.date.to_date}
13
+ %li
14
+ <b>Tags (#{headline.tags.length}):</b>&nbsp;
15
+ - headline.tags.each do |tag|
16
+ = link_to tag.slug, tag_path( tag )
17
+ \,&nbsp;
18
+
19
+
20
+
@@ -0,0 +1,6 @@
1
+
2
+ .headlines-edit.maxwidth
3
+ %h5 Editing headline `#{@headline.name}`
4
+
5
+ = render 'form', headline: @headline
6
+
@@ -0,0 +1,2 @@
1
+
2
+ = render 'form', headline: Wco::Headline.new
@@ -0,0 +1,29 @@
1
+
2
+ - url = invoice.persisted? ? invoice_path( invoice.id ) : invoices_path
3
+
4
+ = form_for invoice, :as => :invoice, :url => url do |f|
5
+ = hidden_field_tag 'invoice[leadset_id]', @leadset.id
6
+
7
+ .input-field
8
+ %label Email
9
+ = @leadset.email
10
+ -# - if @leadset.email
11
+ -# = f.text_field :email, value: @leadset.email
12
+ -# - elsif @leadset.employees.length == 1
13
+ -# = f.text_field :email, value: @leadset.employees[0].email
14
+ -# - else
15
+ -# = f.select :email, options_for_select([[nil,nil]] + @leadset.employees.map { |i| [ i.email, i.email ] } )
16
+
17
+ .input-field
18
+ %label item
19
+ = select_tag 'invoice[items][]', options_for_select( @products_list )
20
+
21
+ -# .input-field
22
+ -# %label number
23
+ -# = f.number_field :number
24
+
25
+ -# .input-field
26
+ -# %label Description
27
+ -# = f.text_area :description
28
+
29
+ = f.submit 'Save'
@@ -0,0 +1,6 @@
1
+
2
+ = link_to "Invoices (#{Wco::Invoice.all.length})", wco.invoices_path
3
+ .inline-search
4
+ = form_tag wco.invoices_path, method: :get do
5
+ = text_field_tag :q
6
+ = link_to '[+]', wco.new_invoice_path
@@ -0,0 +1,13 @@
1
+
2
+ .invoices--list
3
+ %ul
4
+ - invoices.each do |i|
5
+ %li
6
+ = link_to '[view]', invoice_path( i )
7
+ = i.month_on
8
+ \::
9
+ - if i.asset
10
+ = link_to i.number, i.asset.object.url(:original)
11
+ .inline-block= button_to 'Send', send_invoice_path(i), data: { confirm: 'Are you sure?' }
12
+ - else
13
+ = i.number
@@ -0,0 +1,20 @@
1
+
2
+ .invoices--index-table
3
+ %table.bordered.data-table
4
+ %thead
5
+ %tr
6
+ %th
7
+ %th Email
8
+ %th Number
9
+ %th Amount
10
+ %th Amount Paid
11
+ %th Created At
12
+ %tbody
13
+ - invoices.each do |i|
14
+ %tr
15
+ %td= link_to "View", invoice_path( i )
16
+ %td= i.email
17
+ %td= i.number
18
+ %td= i.amount_cents
19
+ %td= i.paid_amount_cents
20
+ %td= i.created_at.to_s[0..10]
@@ -0,0 +1,3 @@
1
+
2
+ .invoices-index.max-width
3
+ = render 'index_table', invoices: @invoices
@@ -0,0 +1,18 @@
1
+
2
+ .invoices-new.max-width
3
+
4
+ .row
5
+ .col.s12.col.m6.col-md-offset-3
6
+
7
+ %h5 New PDF Invoice for `#{link_to @leadset&.name, leadset_path(@leadset)}`:
8
+ = form_for @new_invoice, as: :invoice, url: create_invoice_pdf_path do |f|
9
+ .input-field
10
+ %label Email
11
+ = f.text_field :email
12
+ .input-field
13
+ invoice month, description
14
+ .input-field
15
+ lineitems
16
+ .actions
17
+ = f.submit 'Submit'
18
+
@@ -0,0 +1,50 @@
1
+
2
+ - invoice = @new_invoice
3
+ - url = invoice.persisted? ? invoice_path( invoice.id ) : create_invoice_stripe_path
4
+
5
+
6
+ .invoices-new.max-width
7
+
8
+ .row
9
+ .col.s12.col.m6.col-md-offset-3
10
+ %h5 New Stripe Invoice for `#{link_to @leadset&.name, leadset_path(@leadset)}`:
11
+
12
+ = form_for invoice, :as => :invoice, :url => url do |f|
13
+ = hidden_field_tag 'invoice[leadset_id]', @leadset.id
14
+
15
+ .input-field
16
+ %label Email
17
+ = @leadset.email
18
+ -# - if @leadset.email
19
+ -# = f.text_field :email, value: @leadset.email
20
+ -# - elsif @leadset.employees.length == 1
21
+ -# = f.text_field :email, value: @leadset.employees[0].email
22
+ -# - else
23
+ -# = f.select :email, options_for_select([[nil,nil]] + @leadset.employees.map { |i| [ i.email, i.email ] } )
24
+
25
+ .input-row
26
+ %label item (product)
27
+ = select_tag 'invoice[items][][product_id]', options_for_select( @products_list ), class: 'products select2'
28
+
29
+ %label price
30
+ = select_tag 'invoice[items][][price_id]'
31
+
32
+ %label quantity
33
+ = number_field_tag 'invoice[items][][quantity]'
34
+
35
+ -# .input-field
36
+ -# %label number
37
+ -# = f.number_field :number
38
+
39
+ -# .input-field
40
+ -# %label Description
41
+ -# = f.text_area :description
42
+
43
+ .input-field
44
+ %label Send now?
45
+ = check_box_tag :do_send
46
+
47
+ .actions
48
+
49
+ = f.submit 'Create', data: { confirm: 'Are you sure?' }
50
+
@@ -0,0 +1,23 @@
1
+
2
+ - i = @invoice
3
+
4
+ .invoices-show.max-width
5
+ %h5 Invoice ##{i.number}
6
+
7
+ %ul
8
+ %li email: #{i.email}
9
+ %li leadset: #{link_to i.leadset.name, leadset_path( i.leadset) }
10
+ %li invoice_id: #{i.invoice_id}
11
+ %li items: #{i.items}
12
+
13
+ -# = @invoice.inspect
14
+
15
+ %hr
16
+ %h5
17
+ Stripe Invoice
18
+ = link_to 'pdf', @stripe_invoice[:invoice_pdf], target: :_blank
19
+ .inline-block= button_to 'stripe-send', send_invoice_stripe_path( i.id ), data: { confirm: 'Are you sure?' }
20
+
21
+ -# %pre
22
+ -# = @stripe_invoice.inspect
23
+
@@ -0,0 +1,11 @@
1
+ <%# Link to the "First" page
2
+ - available local variables
3
+ url: url to the first page
4
+ current_page: a page object for the currently displayed page
5
+ total_pages: total number of pages
6
+ per_page: number of items to fetch per page
7
+ remote: data-remote
8
+ -%>
9
+ <li class="first">
10
+ <%= link_to_unless current_page.first?, t('views.pagination.first').html_safe, url, remote: remote %>
11
+ </li>
@@ -0,0 +1,8 @@
1
+ <%# Non-link tag that stands for skipped pages...
2
+ - available local variables
3
+ current_page: a page object for the currently displayed page
4
+ total_pages: total number of pages
5
+ per_page: number of items to fetch per page
6
+ remote: data-remote
7
+ -%>
8
+ <li class="page gap"><%= t('views.pagination.truncate').html_safe %></li>
@@ -0,0 +1,11 @@
1
+ <%# Link to the "Last" page
2
+ - available local variables
3
+ url: url to the last page
4
+ current_page: a page object for the currently displayed page
5
+ total_pages: total number of pages
6
+ per_page: number of items to fetch per page
7
+ remote: data-remote
8
+ -%>
9
+ <li class="last">
10
+ <%= link_to_unless current_page.last?, t('views.pagination.last').html_safe, url, remote: remote %>
11
+ </li>
@@ -0,0 +1,11 @@
1
+ <%# Link to the "Next" page
2
+ - available local variables
3
+ url: url to the next page
4
+ current_page: a page object for the currently displayed page
5
+ total_pages: total number of pages
6
+ per_page: number of items to fetch per page
7
+ remote: data-remote
8
+ -%>
9
+ <li class="next">
10
+ <%= link_to_unless current_page.last?, t('views.pagination.next').html_safe, url, rel: 'next', remote: remote %>
11
+ </li>
@@ -0,0 +1,13 @@
1
+ <%# Link showing page number
2
+ - available local variables
3
+ page: a page object for "this" page
4
+ url: url to this page
5
+ current_page: a page object for the currently displayed page
6
+ total_pages: total number of pages
7
+ per_page: number of items to fetch per page
8
+ remote: data-remote
9
+ -%>
10
+ <li class="waves-effect page <%= 'active' if page.current? %>">
11
+ <%= link_to_unless page.current?, page, url, {remote: remote, rel: page.rel} %>
12
+ <% # = link_to page, url, {remote: remote, rel: page.rel} %>
13
+ </li>
@@ -0,0 +1,25 @@
1
+ <%# The container tag
2
+ - available local variables
3
+ current_page: a page object for the currently displayed page
4
+ total_pages: total number of pages
5
+ per_page: number of items to fetch per page
6
+ remote: data-remote
7
+ paginator: the paginator that renders the pagination tags inside
8
+ -%>
9
+ <%= paginator.render do -%>
10
+ <ul class="pagination">
11
+ <%= first_page_tag unless current_page.first? %>
12
+ <%= prev_page_tag unless current_page.first? %>
13
+ <% each_page do |page| -%>
14
+ <% if page.display_tag? -%>
15
+ <%= page_tag page %>
16
+ <% elsif !page.was_truncated? -%>
17
+ <%= gap_tag %>
18
+ <% end -%>
19
+ <% end -%>
20
+ <% unless current_page.out_of_range? %>
21
+ <%= next_page_tag unless current_page.last? %>
22
+ <%= last_page_tag unless current_page.last? %>
23
+ <% end %>
24
+ </ul>
25
+ <% end -%>
@@ -0,0 +1,11 @@
1
+ <%# Link to the "Previous" page
2
+ - available local variables
3
+ url: url to the previous page
4
+ current_page: a page object for the currently displayed page
5
+ total_pages: total number of pages
6
+ per_page: number of items to fetch per page
7
+ remote: data-remote
8
+ -%>
9
+ <li class="prev">
10
+ <%= link_to_unless current_page.first?, t('views.pagination.previous').html_safe, url, rel: 'prev', remote: remote %>
11
+ </li>
@@ -0,0 +1,45 @@
1
+
2
+ - url = lead.new_record? ? leads_path : lead_path( lead.id )
3
+
4
+ = form_for lead, html: { multipart: true }, as: :lead, url: url do |f|
5
+
6
+ .field
7
+ = f.label :name
8
+ = f.text_field :name
9
+
10
+ .field
11
+ = f.label :email
12
+ = f.text_field :email
13
+
14
+ .field
15
+ = f.label :phone
16
+ = f.text_field :phone
17
+
18
+ .field
19
+ = f.label :address
20
+ = f.text_field :address
21
+
22
+ .field
23
+ = f.label "Leadset (company)"
24
+ = f.select :m3_leadset_id, options_for_select(@leadsets_list, selected: lead.m3_leadset_id), { include_blank: true }, { class: :select2 }
25
+
26
+ .field
27
+ %label Rating
28
+ = f.number_field :rating
29
+
30
+ .field
31
+ = f.label :comment
32
+ = f.text_area :comment, class: :tinymce
33
+
34
+ .field
35
+ = f.label "Tags"
36
+ = lead.wp_tags.inspect
37
+ = f.select :lead_tags, options_for_select(@tags_list, selected: lead.wp_tags.map(&:term_id) ), {}, { class: :select2, multiple: true }
38
+
39
+ .field
40
+ = f.label :photo
41
+ = f.file_field :photo
42
+
43
+ .actions
44
+ = f.submit
45
+
@@ -0,0 +1,11 @@
1
+
2
+ .Card
3
+ = form_tag leads_import_path, multipart: true do
4
+ .doc
5
+ %pre= Lead.import_v1_fields
6
+ .field
7
+ %label File
8
+ = file_field_tag :csv_file
9
+
10
+ .actions
11
+ = submit_tag 'Submit'
@@ -0,0 +1,7 @@
1
+
2
+
3
+ = link_to "Leads (#{Wco::Lead.all.length})", wco.leads_path
4
+ .inline-search
5
+ = form_tag wco.leads_path, method: :get do
6
+ = text_field_tag :q
7
+ = link_to '[+]', wco.new_lead_path
@@ -0,0 +1,75 @@
1
+
2
+ -#
3
+ -# receives locals: leads , search_path
4
+ -#
5
+ -# - email_contexts ||= {}
6
+
7
+ .leads--index.padded
8
+ .header
9
+ %h2.title
10
+ Leads
11
+ - if !defined?( skip_pagination ) || !skip_pagination
12
+ (#{leads.total_count})
13
+ - else
14
+ (#{leads.length})
15
+ = link_to raw("<i class='fa fa-plus-square'></i>"), new_lead_path
16
+
17
+ - if defined?( search_path )
18
+ .float-right= render 'wco/search', path: search_path
19
+ = form_tag leads_bulkop_path do
20
+ = label_tag 'Act on Selected:'
21
+ = select_tag :op, options_for_select( [[nil,nil]] + Wco::Lead::OPS )
22
+ = select_tag :email_campaign_id, options_for_select( @email_campaigns_list )
23
+ = submit_tag 'Go'
24
+
25
+ - if !defined?( skip_pagination ) || !skip_pagination
26
+ = paginate leads, param_name: :leads_page
27
+ %table.bordered
28
+ %thead
29
+ %tr
30
+ %th= check_box_tag :selectAll
31
+ %th Name/Email
32
+ %th
33
+ %th.company Company
34
+ %th Phone, address
35
+ %th Tag
36
+ %th created_at
37
+ %th.ctxs Ctxs
38
+ %th Sch
39
+
40
+ %tbody
41
+ - leads.each do |lead|
42
+ %tr
43
+ %td= check_box_tag 'lead_ids[]', lead.id
44
+ %td
45
+ = link_to '[~]', edit_lead_path( lead )
46
+ = link_to "#{lead.name} <#{lead.email}>", lead_path( lead )
47
+ %td
48
+ = image_tag lead.photo.url(:thumb) if lead.photo
49
+ %td.company
50
+ = lead.leadset.company_url
51
+ %td
52
+ .a= lead.phone if lead.phone.present?
53
+ .a= lead.address if lead.address.present?
54
+ %td
55
+ %td= lead.created_at.to_s[0..10]
56
+ %td.ctxs
57
+ = lead.email_contexts.length
58
+ -## without the N+1 but unfinished and messy:
59
+ -# = email_contexts[lead.id] || '-'
60
+
61
+ %td.sch
62
+ = lead.email_actions.length
63
+ = link_to '[+]', wco_email.new_email_action_path( lead_id: lead.id )
64
+ -# %ul
65
+ -# - lead.scheduled_email_actions.map do |sch_a|
66
+ -# %li
67
+ -# = link_to sch_a.email_action.slug, edit_scheduled_email_action_path( sch_a )
68
+ -# [x]
69
+
70
+ - if !defined?( skip_pagination ) || !skip_pagination
71
+ = paginate leads, param_name: :leads_page
72
+
73
+
74
+
75
+
@@ -0,0 +1,11 @@
1
+
2
+ .leads--index-rows
3
+ - leads.each do |lead|
4
+ .item
5
+ = link_to lead.email, lead_path(lead)
6
+ \(#{lead.scheduled_email_actions.length} sch
7
+ %span.expand-next [+]
8
+ .expand-hide= render 'ish_manager/scheduled_actions/form_mini'
9
+ \)
10
+ %span.expand-next [reply]
11
+ .expand-hide= render 'ish_manager/email_contexts/form_reply', lead: lead
@@ -0,0 +1,22 @@
1
+
2
+ .leads-edit.max-width
3
+ .header
4
+ %h2.title Edit lead #{ link_to @lead.name, lead_path(@lead) }
5
+
6
+ = render 'form', :lead => @lead
7
+
8
+ -# %hr
9
+ -# %h1 Email Campaigns:
10
+ -# %ul
11
+ -# - @lead.email_campaign_leads.each do |x|
12
+ -# %li
13
+ -# <b>Sent on ::</b> #{x.sent_at.to_s[0..10]}
14
+ -# <b>Slug ::</b> #{x.email_campaign.slug}
15
+
16
+ -# %hr
17
+ -# %h1 Single Emails:
18
+ -# %ul
19
+ -# - @lead.email_contexts.each do |x|
20
+ -# %li
21
+ -# <b>Sent at ::</b> #{x.sent_at.to_s[0..10]}
22
+ -# <b>Subject ::</b> #{x.subject}
@@ -0,0 +1,7 @@
1
+
2
+ .leads-index.maxwidth
3
+ = form_tag leads_path, method: :get do
4
+ = select_tag :q_tag_ids, options_for_select(@tags_list, selected: params[:q_tag_ids]), { class: :select2, multiple: true }
5
+ = submit_tag 'tag-search'
6
+ %hr
7
+ = render 'index', leads: @leads, search_path: leads_path
@@ -0,0 +1,9 @@
1
+
2
+ .leads-new.max-width
3
+ .row
4
+ .col-sm-12.col-md-6
5
+ %h1 New Lead
6
+ = render 'form', lead: @lead
7
+ .col-sm-12.col-md-6
8
+ %h1 Import Leads
9
+ = render 'form_import'
@@ -0,0 +1,85 @@
1
+
2
+ .leads-show.padded
3
+
4
+ .header
5
+ %h2.title
6
+ Lead ##{@lead.id}
7
+ = link_to '[~]', edit_lead_path(@lead)
8
+
9
+ .row
10
+ .col-md-6
11
+ %ul
12
+ %li Name: #{@lead.name}
13
+ %li Email: #{@lead.email}
14
+ %li
15
+ Leadset: #{ link_to @lead.leadset.company_url, leadset_path(@lead.leadset) }
16
+ -# %li Rating: #{@lead.rating}
17
+ - if @lead.phone
18
+ %li Phone: #{@lead.phone}
19
+ - if @lead.address
20
+ %li Address: #{@lead.address}
21
+ -# - if @lead.shoe_size
22
+ -# %li Shoe size: #{@lead.shoe_size}
23
+ -# - if @lead.comment
24
+ -# %li Comment: #{raw @lead.comment}
25
+ - if @lead.photo
26
+ %li
27
+ = image_tag Photo.find( @lead.photo_id ).photo.url(:small)
28
+
29
+ .col-md-6
30
+ %h5 Tags
31
+ %ul
32
+ - @lead.tags.each do |tag|
33
+ %li
34
+ = link_to tag.name, tag_path(tag)
35
+
36
+ .row
37
+ .col-md-6.ctxs
38
+ %h5
39
+ Email Contexts (#{@lead.ctxs.length})
40
+ = link_to '[+]', '#'
41
+ %ul
42
+ - @lead.ctxs.each do |ctx|
43
+ %li
44
+ = pp_date( ctx.sent_at ) || 'not sent'
45
+ = link_to ctx.subject.presence||"No Subj?!", email_context_path(ctx)
46
+
47
+ .col-md-6.schs
48
+ %h5
49
+ Scheduled actions (#{@lead.schs.length})
50
+ -# = link_to '[+]', '#'
51
+ \[+]
52
+ %ul
53
+ - @lead.schs.each do |sch|
54
+ %li
55
+ = link_to sch.email_action.slug, edit_scheduled_email_action_path(sch)
56
+ = sch.state
57
+ (#{link_to 'proto-action', edit_email_action_path(sch.email_action)})
58
+ = sch.perform_at
59
+
60
+ %hr
61
+ %h5
62
+ Invoices (?)
63
+ = link_to '[+stripe]', new_invoice_stripe_path({ leadset: @lead.leadset })
64
+ = link_to '[+pdf]', new_invoice_pdf_path({ leadset: @lead.leadset })
65
+ %ul
66
+ %li None?
67
+
68
+
69
+
70
+ .row
71
+ .col-md-12.msgs
72
+ %h5 Email Conversations (#{@lead.convs.length})
73
+ %ul
74
+ - @lead.convs.each do |conv|
75
+ %li
76
+ = link_to conv.subject, wco_email.email_conversation_path( conv )
77
+
78
+ -# .row
79
+ -# .col-md-6
80
+ -# = render 'ish_manager/galleries/index', galleries: @lead.galleries
81
+ -# .col-md-6
82
+ -# = render 'ish_manager/videos/index', videos: @lead.videos
83
+
84
+
85
+
@@ -0,0 +1,28 @@
1
+
2
+ - url = leadset.persisted? ? leadset_path( leadset.id ) : leadsets_path
3
+
4
+ = form_for leadset, :as => :leadset, :url => url do |f|
5
+
6
+ .input-field
7
+ = f.label :company_url
8
+ = f.text_field :company_url
9
+
10
+ .input-field
11
+ = f.label :name
12
+ = f.text_field :name
13
+
14
+ .input-field
15
+ = f.label :email
16
+ = f.text_field :email
17
+
18
+ .input-field
19
+ = f.label :next_invoice_number
20
+ = f.text_field :next_invoice_number
21
+
22
+ -# .input-field
23
+ -# %label Stripe customer_id
24
+ -# = f.text_field :customer_id
25
+
26
+ .actions
27
+ = f.submit
28
+
@@ -0,0 +1,6 @@
1
+
2
+ = link_to "Leadsets (#{Wco::Leadset.all.length})", wco.leadsets_path
3
+ .inline-search
4
+ = form_tag wco.leadsets_path, method: :get do
5
+ = text_field_tag :q
6
+ = link_to '[+]', wco.new_leadset_path
@@ -0,0 +1,4 @@
1
+
2
+ .leadsets-edit.max-width
3
+ %h1 Edit leadset `#{link_to @leadset.name, leadset_path(@leadset)}`
4
+ = render 'form', :leadset => @leadset