app/views/wco/leads/_index.haml in wco_models-3.1.0.100 vs app/views/wco/leads/_index.haml in wco_models-3.1.0.101
- old
+ new
@@ -32,13 +32,15 @@
%th
%th.company Company
%th Phone, address
%th Tag
%th created_at
- %th.ctxs Ctxs
- %th Sch
+ - if defined?( wco_email )
+ %th.convs Convs
+ %th Sch
+
%tbody
- leads.each do |lead|
%tr
%td= check_box_tag 'lead_ids[]', lead.id
%td
@@ -51,22 +53,27 @@
%td
.a= lead.phone if lead.phone.present?
.a= lead.address if lead.address.present?
%td
%td= lead.created_at.to_s[0..10]
- %td.ctxs
- = lead.email_contexts.length
- -## without the N+1 but unfinished and messy:
- -# = email_contexts[lead.id] || '-'
- %td.sch
- = lead.email_actions.length
- = link_to '[+]', wco_email.new_email_action_path( lead_id: lead.id )
- -# %ul
- -# - lead.scheduled_email_actions.map do |sch_a|
- -# %li
- -# = link_to sch_a.email_action.slug, edit_scheduled_email_action_path( sch_a )
- -# [x]
+
+ - if defined?( wco_email )
+ %td.convs
+ - if lead.conversations.length > 0
+ = link_to lead.conversations.length, wco_email.conversations_path( lead_id: lead.id )
+ - else
+ 0
+ -## without the N+1 but unfinished and messy:
+ -# = email_contexts[lead.id] || '-'
+ %td.sch
+ = lead.email_actions.length
+ = link_to '[+]', wco_email.new_email_action_path( lead_id: lead.id )
+ -# %ul
+ -# - lead.scheduled_email_actions.map do |sch_a|
+ -# %li
+ -# = link_to sch_a.email_action.slug, edit_scheduled_email_action_path( sch_a )
+ -# [x]
- if !defined?( skip_pagination ) || !skip_pagination
= paginate leads, param_name: :leads_page