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.
- checksums.yaml +4 -4
- data/Rakefile +3 -13
- data/app/assets/config/wco_models_manifest.js +2 -0
- data/app/assets/javascripts/wco/application.js +43 -5
- data/app/assets/javascripts/wco/collapse-expand.js +1 -0
- data/app/assets/javascripts/wco/file_upload.js +32 -0
- data/app/assets/javascripts/wco/shared.js +22 -0
- data/app/assets/stylesheets/wco/application.css +23 -8
- data/app/assets/stylesheets/wco/utils.scss +57 -1
- data/app/controllers/wco/application_controller.rb +9 -0
- data/app/controllers/wco/galleries_controller.rb +143 -0
- data/app/controllers/wco/headlines_controller.rb +71 -0
- data/app/controllers/wco/leads_controller.rb +59 -0
- data/app/controllers/wco/leadsets_controller.rb +90 -0
- data/app/controllers/wco/logs_controller.rb +64 -0
- data/app/controllers/wco/office_action_templates_controller.rb +80 -0
- data/app/controllers/wco/office_actions_controller.rb +71 -0
- data/app/controllers/wco/photos_controller.rb +78 -0
- data/app/controllers/wco/profiles_controller.rb +26 -0
- data/app/controllers/wco/publishers_controller.rb +60 -0
- data/app/controllers/wco/reports_controller.rb +75 -0
- data/app/controllers/wco/sites_controller.rb +52 -0
- data/app/controllers/wco/tags_controller.rb +57 -0
- data/app/helpers/wco/application_helper.rb +42 -0
- data/app/models/wco/asset.rb +26 -0
- data/app/models/wco/gallery.rb +3 -3
- data/app/models/wco/headline.rb +19 -0
- data/app/models/wco/invoice.rb +127 -0
- data/app/models/wco/lead.rb +42 -0
- data/app/models/wco/leadset.rb +8 -2
- data/app/models/wco/log.rb +18 -0
- data/app/models/wco/newsitem.rb +1 -0
- data/app/models/wco/office_action.rb +17 -18
- data/app/models/wco/office_action_template.rb +41 -0
- data/app/models/wco/office_action_template_tie.rb +20 -0
- data/app/models/wco/photo.rb +10 -8
- data/app/models/wco/price.rb +2 -0
- data/app/models/wco/product.rb +2 -0
- data/app/models/wco/profile.rb +1 -0
- data/app/models/wco/publisher.rb +68 -3
- data/app/models/wco/report.rb +48 -0
- data/app/models/wco/site.rb +12 -1
- data/app/models/wco/subscription.rb +1 -0
- data/app/models/wco/tag.rb +17 -4
- data/app/models/wco_email/campaign.rb +7 -11
- data/app/models/wco_email/context.rb +15 -14
- data/app/models/wco_email/conversation.rb +13 -27
- data/app/models/wco_email/{scheduled_email_action.rb → email_action.rb} +24 -20
- data/app/models/wco_email/email_action_template.rb +35 -0
- data/app/models/wco_email/email_filter.rb +9 -12
- data/app/models/wco_email/email_template.rb +124 -0
- data/app/models/wco_email/message.rb +228 -0
- data/app/models/wco_email/message_stub.rb +107 -0
- data/app/models/wco_email/obfuscated_redirect.rb +13 -0
- data/app/models/wco_email/unsubscribe.rb +19 -0
- data/app/models/wco_hosting/appliance.rb +1 -0
- data/app/models/wco_hosting/appliance_tmpl.rb +1 -0
- data/app/models/wco_hosting/domain.rb +1 -0
- data/app/models/wco_hosting/serverhost.rb +1 -0
- data/app/views/layouts/wco/application.haml +30 -17
- data/app/views/wco/_main_footer.haml +43 -0
- data/app/views/wco/_main_header.haml +37 -0
- data/app/views/wco/_main_header.haml-bk +109 -0
- data/app/views/wco/_paginate.haml +8 -0
- data/app/views/wco/_search.haml +8 -0
- data/app/views/wco/application/_debug.haml +0 -0
- data/app/views/wco/galleries/_form.haml +24 -0
- data/app/views/wco/galleries/_header.haml +8 -0
- data/app/views/wco/galleries/_index.haml +40 -0
- data/app/views/wco/galleries/_menu.haml-trash +10 -0
- data/app/views/wco/galleries/_menu_secondary.haml +12 -0
- data/app/views/wco/galleries/_thumbs.haml +9 -0
- data/app/views/wco/galleries/_title.haml +16 -0
- data/app/views/wco/galleries/edit.haml +6 -0
- data/app/views/wco/galleries/new.haml +6 -0
- data/app/views/wco/galleries/show.haml +43 -0
- data/app/views/wco/headlines/_form.haml +17 -0
- data/app/views/wco/headlines/_header.haml +6 -0
- data/app/views/wco/headlines/_index.haml +20 -0
- data/app/views/wco/headlines/edit.haml +6 -0
- data/app/views/wco/headlines/new.haml +2 -0
- data/app/views/wco/invoices/_form.haml-trash +29 -0
- data/app/views/wco/invoices/_header.haml +6 -0
- data/app/views/wco/invoices/_index_list.haml +13 -0
- data/app/views/wco/invoices/_index_table.haml +20 -0
- data/app/views/wco/invoices/index.haml +3 -0
- data/app/views/wco/invoices/new_pdf.haml +18 -0
- data/app/views/wco/invoices/new_stripe.haml +50 -0
- data/app/views/wco/invoices/show.haml +23 -0
- data/app/views/wco/kaminari/_first_page.html.erb +11 -0
- data/app/views/wco/kaminari/_gap.html.erb +8 -0
- data/app/views/wco/kaminari/_last_page.html.erb +11 -0
- data/app/views/wco/kaminari/_next_page.html.erb +11 -0
- data/app/views/wco/kaminari/_page.html.erb +13 -0
- data/app/views/wco/kaminari/_paginator.html.erb +25 -0
- data/app/views/wco/kaminari/_prev_page.html.erb +11 -0
- data/app/views/wco/leads/_form.haml +45 -0
- data/app/views/wco/leads/_form_import.haml +11 -0
- data/app/views/wco/leads/_header.haml +7 -0
- data/app/views/wco/leads/_index.haml +75 -0
- data/app/views/wco/leads/_index_rows.haml +11 -0
- data/app/views/wco/leads/edit.haml +22 -0
- data/app/views/wco/leads/index.haml +7 -0
- data/app/views/wco/leads/new.haml +9 -0
- data/app/views/wco/leads/show.haml +85 -0
- data/app/views/wco/leadsets/_form.haml +28 -0
- data/app/views/wco/leadsets/_header.haml +6 -0
- data/app/views/wco/leadsets/edit.haml +4 -0
- data/app/views/wco/leadsets/index.haml +45 -0
- data/app/views/wco/leadsets/index_dataTables.haml +33 -0
- data/app/views/wco/leadsets/new.haml +6 -0
- data/app/views/wco/leadsets/show.haml +52 -0
- data/app/views/wco/logs/_form.haml +17 -0
- data/app/views/wco/logs/_header.haml +6 -0
- data/app/views/wco/logs/_index.haml +23 -0
- data/app/views/wco/logs/edit.haml +6 -0
- data/app/views/wco/logs/new.haml +2 -0
- data/app/views/wco/office_action_templates/_form.haml +46 -0
- data/app/views/wco/office_action_templates/_header.haml +8 -0
- data/app/views/wco/office_action_templates/_ties.haml +18 -0
- data/app/views/wco/office_action_templates/edit.haml +6 -0
- data/app/views/wco/office_action_templates/index.haml +17 -0
- data/app/views/wco/office_action_templates/new.haml +5 -0
- data/app/views/wco/office_action_templates/show.haml +22 -0
- data/app/views/wco/office_actions/_form.haml +22 -0
- data/app/views/wco/office_actions/_header.haml +6 -0
- data/app/views/wco/office_actions/_index.haml +15 -0
- data/app/views/wco/office_actions/edit.haml +5 -0
- data/app/views/wco/office_actions/index.haml +10 -0
- data/app/views/wco/office_actions/new.haml +4 -0
- data/app/views/wco/office_actions/show.haml +5 -0
- data/app/views/wco/photos/_form.haml +0 -0
- data/app/views/wco/photos/_index_thumbs.haml +7 -0
- data/app/views/wco/photos/_meta.haml +7 -0
- data/app/views/wco/photos/_meta_manager.haml +7 -0
- data/app/views/wco/photos/_multinew.haml +6 -0
- data/app/views/wco/photos/index.haml +3 -0
- data/app/views/wco/photos/new.haml +0 -0
- data/app/views/wco/photos/show.haml +6 -0
- data/app/views/wco/photos/without_gallery.haml +11 -0
- data/app/views/wco/prices/_form.haml +1 -1
- data/app/views/wco/products/_header.haml +6 -0
- data/app/views/wco/publishers/_form.haml +28 -0
- data/app/views/wco/publishers/_header.haml +6 -0
- data/app/views/wco/publishers/edit.haml +4 -0
- data/app/views/wco/publishers/index.haml +37 -0
- data/app/views/wco/publishers/new.haml +4 -0
- data/app/views/wco/reports/_form.haml +28 -0
- data/app/views/wco/reports/_header.haml +14 -0
- data/app/views/wco/reports/edit.haml +4 -0
- data/app/views/wco/reports/index.haml +17 -0
- data/app/views/wco/reports/index_table.haml +17 -0
- data/app/views/wco/reports/new.haml +4 -0
- data/app/views/wco/reports/show.haml +8 -0
- data/app/views/wco/sites/_form.haml +21 -0
- data/app/views/wco/sites/_header.haml +6 -0
- data/app/views/wco/sites/edit.haml +4 -0
- data/app/views/wco/sites/index.haml +24 -0
- data/app/views/wco/sites/new.haml +4 -0
- data/app/views/wco/tags/_form.haml +10 -0
- data/app/views/wco/tags/_header.haml +6 -0
- data/app/views/wco/tags/_index.haml +10 -0
- data/app/views/wco/tags/_index_inline.haml +8 -0
- data/app/views/wco/tags/edit.haml +0 -0
- data/app/views/wco/tags/index.haml +9 -0
- data/app/views/wco/tags/new.haml +0 -0
- data/app/views/wco/tags/show.haml +15 -0
- data/config/routes.rb +42 -0
- data/lib/tasks/db_tasks.rake +13 -0
- data/lib/tasks/office_tasks.rake +36 -0
- data/lib/tasks/scrape_tasks.rake-trash +22 -0
- data/lib/wco/ai_writer.rb +55 -0
- data/lib/wco/engine.rb +0 -1
- data/lib/wco/office_worker.rb +4 -0
- data/lib/wco/scrape_wsj.rb +29 -0
- data/lib/wco/scrape_wsj_capy.rb +44 -0
- data/lib/wco_models.rb +19 -2
- metadata +254 -45
- data/app/helpers/ish_models/application_helper.rb +0 -4
- data/app/models/wco_email/message_template.rb +0 -6
- data/lib/tasks/ish_models_tasks.rake +0 -4
- /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>
|
|
15
|
+
- headline.tags.each do |tag|
|
|
16
|
+
= link_to tag.slug, tag_path( tag )
|
|
17
|
+
\,
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
@@ -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,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,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,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,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
|
+
|