wco_models 3.1.0.252 → 3.1.0.253

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ed799fd6948e57e5cac5dbd097f38e5d0667f6c5463a1ddecd8c105664b615cc
4
- data.tar.gz: 513fd17a407cda9383315c04afad64a9f3b67725619db1472e445fba722137f8
3
+ metadata.gz: 133eb8d547475c23d32e24d027b292f603f3f6ddaab0f17abb5406090f26ee58
4
+ data.tar.gz: 14b734da9b1b5d256becc87728a820ea402f3afede64ef3e20338471a6725514
5
5
  SHA512:
6
- metadata.gz: f78c8eef005478261535954e8fe4627d24dc88a6502abe709bd79a0499690389b4744c21ace3c991b68b45935f713308aafed1e79e7f36eb557c803fac447f14
7
- data.tar.gz: 7904647d7475fca316cfa238d511c40bbc0d9bdef8efe3eb6f15ac44deda98b9e11eb1aab9c9637d8c5063e21672ccc970b429a78cb9013cdf8e385d57f02a4c
6
+ metadata.gz: bf7078cf29398ae723463bd1afa2d0e4ebb79c0d5f3da86e6c950ee650ee97007965aaccd58987e76832a44edd0809634ae804132513fa3347725c60515468fa
7
+ data.tar.gz: 9a6527815333364070ba8d51e8d44b3f9290c05ae644f7c80f95c97c24b007785443ed675fc3c4ad3f6e4833abd64514a5dae09adf57461ef1da5f65211594dd
@@ -138,7 +138,7 @@ class Wco::LeadsController < Wco::ApplicationController
138
138
  private
139
139
 
140
140
  def set_lists
141
- @email_campaigns_list = [[nil,nil]] + WcoEmail::Campaign.all.map { |c| [ c.slug, c.id ] }
141
+ @email_campaigns_list = [[nil,nil]] + WcoEmail::Campaign.all.map { |c| [ c.tmpl, c.id ] }
142
142
  @email_templates_list = WcoEmail::EmailTemplate.list
143
143
  @leads_list = Wco::Lead.list
144
144
  @leadsets_list = Wco::Leadset.list
@@ -9,38 +9,46 @@ class WcoEmail::Campaign
9
9
  include Mongoid::Paranoia
10
10
  store_in collection: 'ish_email_campaigns'
11
11
 
12
- field :slug
13
- validates_uniqueness_of :slug, allow_nil: true
12
+ # field :slug
13
+ # validates_uniqueness_of :slug, allow_nil: true
14
14
 
15
- PAGE_PARAM_NAME = 'email_contexts_page'
16
-
17
- field :from_email
18
- validates_presence_of :from_email
15
+ PAGE_PARAM_NAME = 'email_campaigns_page'
19
16
 
20
17
  belongs_to :email_template
21
18
  def tmpl; email_template; end
22
19
 
23
- field :subject
24
- field :body
20
+ belongs_to :active_tag, class_name: 'Wco::Tag'
21
+ belongs_to :inactive_tag, class_name: 'Wco::Tag'
22
+
23
+ # field :active_tag_slug
24
+ # field :inactive_tag_slug
25
+
26
+ field :status
27
+ field :sent_at, type: :time
28
+
29
+ # field :subject
30
+ # field :body
25
31
 
26
- field :sent_at, type: DateTime
27
- field :send_at, type: DateTime
32
+ # field :sent_at, type: DateTime
33
+ # field :send_at, type: DateTime
28
34
 
29
- has_many :unsubscribes, class_name: 'WcoEmail::Unsubscribe', inverse_of: :campaign
30
- has_and_belongs_to_many :leads, class_name: 'Wco::Lead'
35
+ ## not really. a template may have unsubscribes?
36
+ # has_many :unsubscribes, class_name: 'WcoEmail::Unsubscribe', inverse_of: :campaign
37
+ # has_and_belongs_to_many :leads, class_name: 'Wco::Lead'
31
38
 
32
39
  ## For tracking
33
40
  attr_reader :tid
34
41
 
35
42
  def do_send
36
- leads.each do |lead|
43
+ active_tag.leads.each do |lead|
37
44
  ctx = Ctx.create!({
38
45
  email_template: tmpl,
39
- from_email: tmpl.from_email,
40
- lead_id: lead.id,
46
+ lead: lead,
41
47
  send_at: Time.now,
42
- subject: tmpl.subject,
43
48
  })
49
+ lead.tags.push inactive_tag
50
+ lead.tags.delete active_tag
51
+ lead.save
44
52
  end
45
53
  end
46
54
 
@@ -5,7 +5,7 @@
5
5
  %li
6
6
  = link_to '[~]', edit_tag_path(tag)
7
7
  = link_to tag.slug, tag_path(tag)
8
- <b>N headlines:</b> #{tag.headlines.length}
8
+ -# <b>N headlines:</b> #{tag.headlines.length}
9
9
  <b>N galleries:</b> #{tag.galleries.length}
10
10
  <b>N reports:</b> #{tag.reports.length}
11
11
  <b>N videos:</b> #{tag.videos.length}
@@ -2,7 +2,16 @@
2
2
  .tags-show.padded
3
3
 
4
4
  .text-center
5
- %h5 Tag `#{@tag.slug}`
5
+ %h5
6
+ #{link_to '[~]', wco.edit_tag_path(@tag)}
7
+ Tag `#{@tag.slug}`
8
+ - if @tag.parent
9
+ parent: #{link_to @tag.parent, wco.tag_path(@tag.parent)}
10
+
11
+ %hr
12
+ %i.fa.fa-compress.collapse-expand#tags
13
+ Tags (#{@tag.sons.length}):
14
+ = render '/wco/tags/index', tags: @tag.sons
6
15
 
7
16
  - if defined?( wco_email )
8
17
  .a
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wco_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0.252
4
+ version: 3.1.0.253
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Pudeyev