wco_models 3.1.0.159 → 3.1.0.161

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 631a19b5362a0b67eb43d6883e89f2aa554cea9c0de5a35ab641c466f71350ec
4
- data.tar.gz: b4aed0740e389a30eaa7f2b84d4a0802f251ff6c057f7436246575cc3e479ca6
3
+ metadata.gz: 96f8f41510a97ed15c15a6594f542a3c65b65590dbc710ea277f293db1d3429f
4
+ data.tar.gz: 2eaf694e31445856c59b081ee8ceb3fb0ef15a30a22c8d19556016d060c912b2
5
5
  SHA512:
6
- metadata.gz: a525a6eabe3ac69ab09c789166ab875d9da4e075243216de90cd3aa2f2a8a6e1ca2132f218f61c5d571219bbf28886a431561b6e818e66496c3deaed583d3848
7
- data.tar.gz: 3779643f6dc60f1212abe5c25d0b190a1f726ca3a58975b6510d06752287ac11eb28fac215989b4e577134877f859b5c17aeeebd64d2e0399fefb56d6d0fafb6
6
+ metadata.gz: db5d8c264282bc718451b273e6b50af0884e0dff64247368c1547784a9f3d3fe53898af6ee9d31bf73cae241df35a6efc3b39a898f389e2aad7586bc5e9543fc
7
+ data.tar.gz: f9ef6930a6bcbc40a59c5e5909693448083e60e650bae6913e2151f05ddab0b78c8a3af36ecaa84a82a6d1c514d149c6059807415078c164110ee097f81a1873
@@ -16,12 +16,14 @@ $enable-important-utilities: false;
16
16
 
17
17
 
18
18
  /* A */
19
+
19
20
  .application--main-header.development {
20
21
  background: url('//wasyaco.com/wp-content/uploads/2024/02/weather-bg-development.png'),
21
22
  linear-gradient(90deg, pink, rgba(255,255,255,0) 5% );
22
23
  }
23
24
 
24
25
  /* B */
26
+
25
27
  .bold {
26
28
  font-weight: bold;
27
29
  }
@@ -29,6 +31,23 @@ $enable-important-utilities: false;
29
31
  border-bottom: 1px solid grey !important;
30
32
  }
31
33
 
34
+ /* F */
35
+
36
+ .field {
37
+ display: flex;
38
+ margin-bottom: 0.5em;
39
+
40
+ input {
41
+ flex-grow: 1;
42
+ }
43
+
44
+ label {
45
+ margin-right: 0.5em;
46
+ min-width: 100px;
47
+ }
48
+ }
49
+
50
+ /* M */
32
51
 
33
52
  .main-footer {
34
53
  border-top: 2px solid #6395b9;
@@ -46,10 +65,14 @@ $enable-important-utilities: false;
46
65
  }
47
66
  }
48
67
 
68
+ /* S */
69
+
49
70
  .select2 {
50
71
  min-width: 200px;
51
72
  }
52
73
 
74
+ /* T */
75
+
53
76
  td.tags {
54
77
  min-width: 200px;
55
78
  }
@@ -1,6 +1,8 @@
1
1
 
2
2
  class Wco::Api::ObfuscatedRedirectsController < Wco::ApiController
3
3
 
4
+ skip_before_action :decode_jwt
5
+
4
6
  def show
5
7
  @obf = Wco::ObfuscatedRedirect.find params[:id]
6
8
  # puts! @obf, '@obf'
@@ -16,7 +18,7 @@ class Wco::Api::ObfuscatedRedirectsController < Wco::ApiController
16
18
  render and return
17
19
  end
18
20
 
19
- redirect_to @obf.to
21
+ redirect_to @obf.to_link
20
22
  end
21
23
 
22
24
  end
@@ -60,7 +60,7 @@ class Wco::LeadsetsController < Wco::ApplicationController
60
60
  @email_contexts[lead.email] = lead.email_contexts
61
61
  end
62
62
 
63
- @leads = @leadset.leads.page( params[:leads_page] ).per( current_profile.per_page )
63
+ @leads = @leadset.leads.page( params[:leads_page] ).per( current_profile.per_page )
64
64
  @subscriptions = @leadset.subscriptions
65
65
  @invoices = @leadset.invoices
66
66
  end
@@ -1,7 +1,7 @@
1
1
 
2
2
  class Wco::VideosController < Wco::ApplicationController
3
3
 
4
- # before_action :set_lists
4
+ before_action :set_lists
5
5
 
6
6
  # Alphabetized : )
7
7
 
@@ -46,9 +46,7 @@ class Wco::VideosController < Wco::ApplicationController
46
46
  @videos = @videos.page( params[:videos_page] ).per( 9 )
47
47
 
48
48
  respond_to do |format|
49
- format.html do
50
- render '_index'
51
- end
49
+ format.html
52
50
  format.json do
53
51
  render :json => @videos
54
52
  end
@@ -98,9 +96,20 @@ class Wco::VideosController < Wco::ApplicationController
98
96
  flash[:notice] = 'Success.'
99
97
  redirect_to video_path(@video)
100
98
  else
101
- flash[:alert] = "No luck: #{@video.errors.full_messages.joing(', ')}"
99
+ flash[:alert] = "No luck: #{@video.errors.full_messages.join(', ')}"
102
100
  render :edit
103
101
  end
104
102
  end
105
103
 
104
+ ##
105
+ ## private
106
+ ##
107
+ private
108
+
109
+ def set_lists
110
+ super
111
+ @leads_list = Wco::Lead.list
112
+ @tags_list = Wco::Tag.list
113
+ end
114
+
106
115
  end
@@ -61,8 +61,8 @@ class Wco::Lead
61
61
  has_and_belongs_to_many :email_campaigns, class_name: '::WcoEmail::Campaign'
62
62
  has_and_belongs_to_many :tags, class_name: '::Wco::Tag', index: true
63
63
 
64
- # has_many :galleries, class_name: 'Wco::Gallery'
65
- # has_many :videos, class_name: 'Wco::Video'
64
+ has_many :galleries, class_name: 'Wco::Gallery'
65
+ has_many :videos, class_name: 'Wco::Video'
66
66
 
67
67
  OP_DELETE = 'delete'
68
68
  OP_ADD_TO_CAMPAIGN = 'add_to_campaign'
@@ -32,6 +32,8 @@ class Wco::Video
32
32
  # belongs_to :user_profile, :class_name => 'Ish::UserProfile', :inverse_of => :videos
33
33
  # has_and_belongs_to_many :shared_profiles, :class_name => 'Ish::UserProfile', :inverse_of => :shared_videos
34
34
 
35
+ belongs_to :lead, optional: true
36
+
35
37
  has_and_belongs_to_many :tags
36
38
 
37
39
 
@@ -6,8 +6,8 @@
6
6
  <b>By</b>
7
7
  = link_to item.profile.name, edit_profile_path( item.profile )
8
8
 
9
- -# - if item.tags.length > 0
10
- -# <b>Tags:</b> #{ item.tags.map(&:name).join(', ') }
9
+ - if item.tags.length > 0
10
+ <b>Tags:</b> #{ item.tags.map(&:slug).join(', ') }
11
11
 
12
12
  - if defined?(item.premium_tier) && item.premium_tier > 0
13
13
  <b>Tier $#{item.premium_tier}</b>
@@ -2,7 +2,7 @@
2
2
  %ul.leads--list
3
3
  - leads.each do |lead|
4
4
  %li.item
5
- = image_tag lead.photo.photo.url(:thumb)
5
+ = image_tag lead.photo.photo.url(:thumb) if lead.photo
6
6
  = link_to lead, lead_path(lead)
7
7
  = link_to '[~]', edit_lead_path(lead)
8
8
 
@@ -26,7 +26,7 @@
26
26
  .col-md-4
27
27
  &nbsp;
28
28
  .col-md-8
29
- .field
29
+ .a
30
30
  %label Next Office Action Templates
31
31
  .eg rand(1..5).business_days.from_now.to_date + rand(8..16).hours + rand(1..59).minutes
32
32
  .eg This is not an interval! But you can do Time.now + 30.seconds
@@ -36,7 +36,7 @@
36
36
  .flex-row.field
37
37
  %label next_at_exe
38
38
  = next_f.text_field :next_at_exe, class: 'flex-grow w-100'
39
- .flex-row.field
39
+ .flex-row
40
40
  %label to_delete
41
41
  = next_f.check_box :to_delete
42
42
  = next_f.select :next_office_action_template_id, options_for_select( @oats_list, selected: next_f.object.next_office_action_template_id ), { }, { class: 'select2' }
@@ -0,0 +1,31 @@
1
+
2
+ %table.bordered.tags--index.data-table
3
+ %thead
4
+ %tr
5
+ %td &nbsp;
6
+ %td N Conv
7
+ %td N Stubs
8
+
9
+ %td N Headlines
10
+
11
+ %td N Galleries
12
+ %td N Reports
13
+ %td N Videos
14
+
15
+ %td N Leads
16
+
17
+ %td N Logs
18
+ %tbody
19
+ - tags.each do |tag|
20
+ %tr
21
+ %td
22
+ = link_to '[~]', edit_tag_path(tag)
23
+ = link_to tag.slug, tag_path(tag)
24
+ %td= tag.conversations.length
25
+ %td= tag.message_stubs.length
26
+ %td= tag.headlines.length
27
+ %td= tag.galleries.length
28
+ %td= tag.reports.length
29
+ %td= tag.videos.length
30
+ %td= tag.leads.length
31
+ %td= tag.logs.length
@@ -1,9 +1,9 @@
1
1
 
2
- .tags-index.maxwidth
2
+ .tags-index.padded
3
3
  .header
4
4
  %h5.title Tags (#{@tags.length})
5
5
 
6
- = render 'index', tags: @tags
6
+ = render 'index_table', tags: @tags
7
7
 
8
8
  %hr
9
9
 
@@ -16,15 +16,15 @@
16
16
 
17
17
  %li.d-flex
18
18
  <b>Galleries (#{@galleries.length}):&nbsp;</b>
19
- = render 'wco/galleries/index', galleries: @galleries, config: { skip_tags: true }
19
+ = render '/wco/galleries/index', galleries: @galleries, config: { skip_tags: true }
20
20
  %li.d-flex
21
21
  <b>Headlines (#{@tag.headlines.length}):&nbsp;</b>
22
22
  = render '/wco/headlines/index', headlines: @tag.headlines
23
23
 
24
24
  %li.d-flex
25
25
  <b>Leads (#{@tag.leads.length}):&nbsp;</b>
26
- = render 'wco/leads/list', leads: @tag.leads
26
+ = render '/wco/leads/index', leads: @tag.leads
27
27
 
28
28
  %li.d-flex
29
29
  <b>Reports (#{@reports.length}):&nbsp;</b>
30
- = render 'wco/reports/index', reports: @reports, config: { skip_tags: true }
30
+ = render '/wco/reports/index', reports: @reports, config: { skip_tags: true }
@@ -3,20 +3,17 @@
3
3
  .row
4
4
  .col-sm-6
5
5
  .field
6
- = f.label :youtube_id
6
+ %label youtube_id
7
7
  = f.text_field :youtube_id
8
8
  .field
9
- = f.label :name
9
+ %label Title (name)
10
10
  = f.text_field :name
11
- -# .input-group
12
- -# = f.label :premium_tier
13
- -# = f.number_field :premium_tier
14
- -# .input-group
15
- -# = f.check_box :is_trash
16
- -# = f.label :is_trash
17
- -# .field
18
- -# %label Lead
19
- -# = f.select :lead_id, options_for_select(@leads_list, selected: video.lead_id), {}, class: :select2
11
+ .field
12
+ %label Lead
13
+ = f.select :lead_id, options_for_select(@leads_list, selected: video.lead_id), {}, class: :select2
14
+ .field
15
+ %label Tags
16
+ = f.select :tag_ids, options_for_select(@tags_list, selected: video.tag_ids), { }, { class: :select2, multiple: 'multiple' }
20
17
  .col-sm-6
21
18
  .field
22
19
  = f.label :video
@@ -30,9 +27,8 @@
30
27
 
31
28
  .row
32
29
  .col-md-6
33
- .field
34
- = f.label :descr
35
- = f.text_area :descr, class: :tinymce
30
+ %label descr
31
+ = f.text_area :descr, class: :tinymce
36
32
 
37
33
 
38
34
  .action
@@ -1,19 +1,5 @@
1
1
 
2
- - videos ||= @videos
3
- - this_videos_path ||= videos_path
4
-
5
2
  .videos--index.container-fluid
6
- .videos--menu
7
- = link_to "Videos (#{videos.count})", this_videos_path
8
-
9
- -# = render 'search', path: this_videos_path
10
- .inline-search
11
- = form_tag this_videos_path, method: :get do
12
- = text_field_tag :q
13
-
14
- = link_to '[+]', new_video_path
15
- %hr
16
-
17
3
  = paginate videos, param_name: :videos_page, views_prefix: 'wco'
18
4
 
19
5
  .row
@@ -0,0 +1,11 @@
1
+
2
+ .videos-index.container-fluid
3
+ .d-flex
4
+ = link_to "Videos (#{@videos.count})", videos_path
5
+
6
+ .inline-search
7
+ = form_tag videos_path, method: :get do
8
+ = text_field_tag :q
9
+
10
+ = link_to '[+]', new_video_path
11
+ = render '/wco/videos/index', videos: @videos
data/config/routes.rb CHANGED
@@ -5,7 +5,8 @@ Wco::Engine.routes.draw do
5
5
  namespace :api do
6
6
  get 'leads/index_hash', to: 'leads#index_hash'
7
7
 
8
- get '/obf/:id', to: 'obfuscared_redirects#show'
8
+ get 'obf', to: 'obfuscated_redirects#show' ## testing only.
9
+ get 'obf/:id', to: 'obfuscared_redirects#show'
9
10
  end
10
11
 
11
12
  get 'application/tinymce', to: 'application#tinymce'
@@ -2,19 +2,20 @@
2
2
 
3
3
  namespace :migrate do
4
4
 
5
- desc 'obf to->to_link'
6
- task :obf_to_to_link => :environment do
7
- Wco::ObfuscatedRedirect.all.map do |obf|
8
- if !obf[:to_link] && obf[:to]
9
- obf[:to_link] = obf[:to]
10
- if obf.save
11
- print '^'
12
- else
13
- puts obf.errors.full_messages
14
- end
15
- end
16
- end
17
- puts 'ok'
18
- end
5
+ ## 2024-05-15 Done.
6
+ # desc 'obf to->to_link'
7
+ # task :obf_to_to_link => :environment do
8
+ # Wco::ObfuscatedRedirect.all.map do |obf|
9
+ # if !obf[:to_link] && obf[:to]
10
+ # obf[:to_link] = obf[:to]
11
+ # if obf.save
12
+ # print '^'
13
+ # else
14
+ # puts obf.errors.full_messages
15
+ # end
16
+ # end
17
+ # end
18
+ # puts 'ok'
19
+ # end
19
20
 
20
21
  end
@@ -6,7 +6,8 @@ class Wco::ScrapeWsj
6
6
  def initialize site: nil, max_count: 2
7
7
  site ||= Wco::Site.find_by slug: 'wsj'
8
8
 
9
- out = HTTParty.get( site.origin ).response.body
9
+ # out = HTTParty.get( site.origin ).response.body
10
+ # out = `curl #{site.origin}`
10
11
  out = Nokogiri::HTML(out)
11
12
  out.css('h3').each_with_index do |headline, idx|
12
13
  if idx < max_count
@@ -23,6 +24,7 @@ class Wco::ScrapeWsj
23
24
  end
24
25
  end
25
26
  end
27
+
26
28
  end
27
29
 
28
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wco_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0.159
4
+ version: 3.1.0.161
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Pudeyev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-15 00:00:00.000000000 Z
11
+ date: 2024-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ahoy_matey
@@ -639,6 +639,7 @@ files:
639
639
  - app/views/wco/tags/_header.haml
640
640
  - app/views/wco/tags/_index.haml
641
641
  - app/views/wco/tags/_index_chips.haml
642
+ - app/views/wco/tags/_index_table.haml
642
643
  - app/views/wco/tags/_list_chips.haml
643
644
  - app/views/wco/tags/_menuitem.haml
644
645
  - app/views/wco/tags/edit.haml
@@ -651,6 +652,7 @@ files:
651
652
  - app/views/wco/videos/_header.haml
652
653
  - app/views/wco/videos/_index.haml
653
654
  - app/views/wco/videos/edit.haml
655
+ - app/views/wco/videos/index.haml
654
656
  - app/views/wco/videos/new.haml
655
657
  - app/views/wco/videos/show.haml
656
658
  - app/views/wco_email/application_mailer/_footer_unsubscribe.html.erb