wco_models 3.1.0.37 → 3.1.0.38

Sign up to get free protection for your applications and to get access to all the features.
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 +15 -2
  178. metadata +241 -46
  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,107 @@
1
+
2
+ ##
3
+ ## Only object_key, no validations.
4
+ ## 2023-12-28 _vp_ Continue.
5
+ ## 2024-01-05 LFG
6
+ ##
7
+ class WcoEmail::MessageStub
8
+ include Mongoid::Document
9
+ include Mongoid::Timestamps
10
+ include Mongoid::Paranoia
11
+ store_in collection: 'wco_email_message_stub'
12
+
13
+ STATUS_PENDING = 'status_pending'
14
+ STATUS_PROCESSED = 'status_processed'
15
+ STATUS_FAILED = 'status_failed'
16
+ STATUSES = [ STATUS_PENDING, STATUS_PROCESSED ]
17
+ field :status, default: STATUS_PENDING
18
+ scope :pending, ->{ where( status: 'status_pending' ) }
19
+
20
+ field :object_key
21
+ validates :object_key, presence: true, uniqueness: true
22
+ index({ object_key: 1 }, { unique: true, name: "object_key_idx" })
23
+
24
+ has_one :message, class_name: 'WcoEmail::Message'
25
+
26
+ has_and_belongs_to_many :tags, class_name: 'Wco::Tag'
27
+
28
+ field :config, type: Object, default: <<~AOL
29
+ {}
30
+ AOL
31
+
32
+ ## This only saves a local messafe from mbox to s3.
33
+ def do_process message
34
+ the_mail = Mail.new(message)
35
+ key = the_mail.message_id || "no-key-#{Time.now.to_i}.#{rand(1000)}"
36
+
37
+ @stub = WcoEmail::MessageStub.create({
38
+ object_key: key,
39
+ status: WcoEmail::MessageStub::STATUS_PENDING,
40
+ tags: [ @tag ],
41
+ })
42
+ if @stub.persisted?
43
+ @client.put_object({ bucket: ::S3_CREDENTIALS[:bucket_ses],
44
+ key: key,
45
+ body: message,
46
+ })
47
+ else
48
+ msg = @stub.errors.full_messages.join(", ")
49
+ puts! msg
50
+ Wco::Log.create({
51
+ message: "Stub duplicate object_key: #{key}",
52
+ class_name: 'WcoEmail::MessageStub',
53
+ raw_json: @stub.attributes.to_json,
54
+ tags: [ @tag ],
55
+ })
56
+ end
57
+ end
58
+
59
+ def self.mbox2stubs mbox_path, tagname:, skip:
60
+ skip ||= 0
61
+ self.new.mbox2stubs mbox_path, tagname: tagname, skip: skip
62
+ end
63
+ def mbox2stubs mbox_path, tagname:, skip:
64
+ puts 'Starting...'
65
+ skip ||= 0
66
+
67
+ @count = 1
68
+ @client ||= Aws::S3::Client.new({
69
+ region: ::S3_CREDENTIALS[:region_ses],
70
+ access_key_id: ::S3_CREDENTIALS[:access_key_id_ses],
71
+ secret_access_key: ::S3_CREDENTIALS[:secret_access_key_ses],
72
+ })
73
+ @tag = Wco::Tag.find_or_create_by({ slug: tagname })
74
+
75
+ message = nil
76
+ File.readlines(mbox_path, encoding: "ISO8859-1" ).each do |line|
77
+ if (line.match(/\AFrom /))
78
+
79
+ if message
80
+ if skip < @count
81
+ do_process message
82
+ print "#{@count}."
83
+ else
84
+ print "s-#{@count}."
85
+ end
86
+ @count += 1
87
+ end
88
+ message = ''
89
+
90
+ else
91
+ message << line.sub(/^\>From/, 'From')
92
+ end
93
+ end
94
+
95
+ if message
96
+ if skip < @count
97
+ do_process message
98
+ print "#{@count}."
99
+ else
100
+ print "s-#{@count}."
101
+ end
102
+ @count += 1
103
+ end
104
+ message = ''
105
+ end
106
+
107
+ end
@@ -0,0 +1,13 @@
1
+
2
+ class WcoEmail::ObfuscatedRedirect
3
+ include Mongoid::Document
4
+ include Mongoid::Timestamps
5
+ store_in collection: 'office_obfuscated_redirects'
6
+
7
+ field :to, type: :string
8
+ validates :to, presence: true
9
+
10
+ field :visited_at, type: DateTime
11
+ field :visits, type: :array, default: []
12
+
13
+ end
@@ -0,0 +1,19 @@
1
+
2
+ class WcoEmail::Unsubscribe
3
+ include Mongoid::Document
4
+ include Mongoid::Timestamps
5
+ store_in collection: 'ish_email_unsubscribes'
6
+
7
+ field :email
8
+ validates :email, presence: true
9
+
10
+ field :reason
11
+ field :unsubscribed_at
12
+
13
+ belongs_to :campaign, class_name: 'WcoEmail::Campaign', optional: true
14
+ belongs_to :template, class_name: 'WcoEmail::EmailTemplate', optional: true
15
+ belongs_to :lead, class_name: 'Wco::Lead'
16
+
17
+
18
+ end
19
+
@@ -2,6 +2,7 @@
2
2
  class WcoHosting::Appliance
3
3
  include Mongoid::Document
4
4
  include Mongoid::Timestamps
5
+ include Mongoid::Paranoia
5
6
  store_in collection: 'wco_appliances'
6
7
 
7
8
  belongs_to :leadset, class_name: 'Wco::Leadset', inverse_of: :appliances
@@ -3,6 +3,7 @@
3
3
  class WcoHosting::ApplianceTmpl
4
4
  include Mongoid::Document
5
5
  include Mongoid::Timestamps
6
+ include Mongoid::Paranoia
6
7
  store_in collection: 'wco_appliance_tmpls'
7
8
 
8
9
  field :kind
@@ -2,6 +2,7 @@
2
2
  class WcoHosting::Domain
3
3
  include Mongoid::Document
4
4
  include Mongoid::Timestamps
5
+ include Mongoid::Paranoia
5
6
  store_in collection: 'wco_dns_domains'
6
7
 
7
8
  field :name
@@ -7,6 +7,7 @@ class WcoHosting::Serverhost
7
7
  include Mongoid::Document
8
8
  include Mongoid::Timestamps
9
9
  # include Mongoid::Autoinc
10
+ include Mongoid::Paranoia
10
11
  store_in collection: 'wco_serverhosts'
11
12
 
12
13
  WORKDIR = "/opt/projects/docker"
@@ -3,30 +3,43 @@
3
3
  %head
4
4
  %meta{content: "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}
5
5
  %title Wco Models
6
- = csrf_meta_tags
7
- = csp_meta_tag
6
+
7
+ = javascript_include_tag "//code.jquery.com/jquery-3.3.1.min.js"
8
+
9
+ %script{ :src => "//cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js" }
10
+ = stylesheet_link_tag "//cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css"
11
+
12
+ = stylesheet_link_tag "//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css", :media => 'all'
13
+ = stylesheet_link_tag "//fonts.googleapis.com/icon?family=Material+Icons"
14
+
15
+ = stylesheet_link_tag "//cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/css/bootstrap.min.css"
16
+ = javascript_include_tag "//cdn.jsdelivr.net/npm/popper.js@1.14.7/dist/umd/popper.min.js"
17
+ = javascript_include_tag "//cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/js/bootstrap.min.js"
18
+
19
+ = stylesheet_link_tag "//cdn.jsdelivr.net/npm/select2@4.0.0/dist/css/select2.min.css"
20
+ = javascript_include_tag "//cdn.jsdelivr.net/npm/select2@4.0.0/dist/js/select2.min.js"
21
+
22
+ = stylesheet_link_tag "//cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote.min.css"
23
+ = javascript_include_tag "//cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote.min.js"
24
+
8
25
  = javascript_include_tag "wco/application"
9
26
  = stylesheet_link_tag "wco/application", media: "all"
10
- %body
11
-
12
- %h2 Wco Models
13
- %nav.flex-row
14
- %ul
15
- %li= link_to 'ROOT', '/'
16
- %li= link_to '/hosting', '/hosting'
17
- %li= link_to '/email', '/email'
18
- %ul
19
- -# %li= link_to 'ApplianceTmpl`s', appliance_tmpls_path
20
- -# %li= link_to 'Appliances', appliances_path
21
- %li= link_to 'Products', products_path
22
- -# %li= link_to 'Serverhosts', serverhosts_path
23
- %hr
24
27
 
25
- = render '/wco/application/alerts_notices'
28
+ = csrf_meta_tags
29
+ = csp_meta_tag
30
+ %body
31
+ = render 'wco/main_header'
32
+ = render '/wco/alerts_notices'
26
33
  %hr
27
34
 
28
35
  = yield
29
36
  %hr
37
+ = render '/wco/main_footer'
38
+ = render 'analytics' if Rails.env.production?
39
+
40
+ %script{:src => "https://js.stripe.com/v3/"}
41
+ :javascript
42
+ stripe = Stripe('#{::STRIPE_PK}', { apiVersion: '2020-08-27' });
30
43
 
31
44
  -# = render '/wco/application/auth_widget'
32
45
 
@@ -0,0 +1,43 @@
1
+
2
+ #Config{ data: { jwt_token: @jwt_token } }
3
+ :javascript
4
+ localStorage.setItem('jwt_token', $("#Config").data('jwt-token') )
5
+
6
+ .application--main-footer.main-footer
7
+ .max-width
8
+
9
+ %i.fa.fa-compress.collapse-expand#mainFooter
10
+ Account & Session
11
+ .a
12
+ .row
13
+ .col-sm-4
14
+ %ul
15
+ %li <b>Email:</b> #{@current_profile.email}
16
+ %li= link_to 'sidekiq', '/sidekiq', target: :_blank
17
+ %li= link_to 'Iron Warbler', '/iron_warbler'
18
+
19
+ .col-sm-4
20
+ %ul
21
+ %li ~__^ &nbsp; &nbsp; v#{@version}
22
+ -# %li= Time.now.in_time_zone.to_s
23
+ %li
24
+ = pp_date Time.now
25
+ = pp_time Time.now
26
+ -# <pre>#{@changelog}</pre>
27
+
28
+ .col-sm-4
29
+ = button_to 'Logout', main_app.destroy_user_session_path, :method => :delete, data: { confirm: 'Are you sure?' }
30
+
31
+ -# .set-jwt-token
32
+ -# = button_tag 'Set JWT', class: 'set-jwt-token'
33
+ -# .jwt-token
34
+
35
+ = form_for @current_profile, url: wco.profile_path(@current_profile), as: :profile do |f|
36
+ .flex-row
37
+ = f.label :per_page
38
+ = f.select :per_page, options_for_select([ 10, 25, 50, 100, 250, 500, 1000], selected: @current_profile.per_page)
39
+ = f.submit 'Go'
40
+ = link_to 'RTEditor', application_tinymce_path, target: :_blank
41
+
42
+ .c
43
+ = render 'wco/application/debug' if !Rails.env.production?
@@ -0,0 +1,37 @@
1
+
2
+ .application--main-header.main-header{ class: "#{ENV['RAILS_ENV']} #{ENV['RAILS_ENV'][0...3]=="dev" ? "development" : ''}" }
3
+
4
+ -# %i.fa.fa-compress.collapse-expand#collapseHeaderMain
5
+ -# Wco Suite
6
+ .maxwidth
7
+
8
+ %i.fa.fa-compress.collapse-expand#collapseHeaderEmail
9
+ Wco Suite
10
+ .flex-row
11
+ %ul
12
+ %li= link_to 'ROOT', '/'
13
+ %li= link_to '/email', '/email'
14
+ %li= link_to '/hosting', '/hosting'
15
+ %li= link_to '/trading', '/trading'
16
+
17
+ %ul
18
+ %li= render '/wco/invoices/header'
19
+ %li= render '/wco/products/header'
20
+ %li= render '/wco/tags/header'
21
+ %li= render '/wco/logs/header'
22
+
23
+ %ul
24
+ %li= render '/wco/leadsets/header'
25
+ %li= render '/wco/leads/header'
26
+ %li= render '/wco/office_action_templates/header'
27
+ %li= render '/wco/office_actions/header'
28
+
29
+ %ul
30
+ %li= render '/wco/sites/header'
31
+ %li= render '/wco/headlines/header'
32
+ %li= render '/wco/publishers/header'
33
+ %li= render '/wco/galleries/header'
34
+ %li= render '/wco/reports/header'
35
+
36
+
37
+ .c
@@ -0,0 +1,109 @@
1
+
2
+ .application--main-header.main-header{ class: "#{ENV['RAILS_ENV']} #{ENV['RAILS_ENV'][0...3]=="dev" ? "development" : ''}" }
3
+
4
+ %i.fa.fa-compress.collapse-expand#collapseHeaderMain
5
+ Wco Suite
6
+ .container
7
+
8
+ %i.fa.fa-compress.collapse-expand#collapseHeaderOffice
9
+ Wco Email & CRM
10
+ .a
11
+ %ul
12
+ %li= link_to 'Tags', tags_path
13
+ -# %li
14
+ -# = link_to "#{WpTag::INBOX} (#{Office::EmailConversation.in_emailtag(WpTag::INBOX).length})", email_conversations_in_path(WpTag::INBOX), class: 'chip'
15
+ -# = link_to '[+]', new_email_context_path
16
+ %li
17
+ = link_to "Tmpls (#{WcoEmail::EmailTemplate.all.length})", email_templates_path
18
+ = link_to '[+]', new_email_template_path
19
+ %li
20
+ = link_to "Companies (#{Leadset.kept.length})", leadsets_path
21
+ .inline-search
22
+ = form_tag leadsets_path, method: :get do
23
+ = text_field_tag :q
24
+ = link_to '[+]', new_leadset_path
25
+ %li
26
+ = link_to "EActions", email_actions_path
27
+ = link_to '[+]', new_email_action_path
28
+ %ul
29
+ %li
30
+ = link_to "Filters (#{Office::EmailFilter.active.length})", email_filters_path
31
+ = link_to '[+]', new_email_filter_path
32
+ %li
33
+ = link_to "Ctxs (#{Ctx.notsent.length})", email_contexts_path({ sent: false })
34
+ = link_to '[+]', new_email_context_path
35
+ %br
36
+ = link_to 'summary', email_contexts_summary_path( format: :html )
37
+ = link_to '[csv]', email_contexts_summary_path( format: :csv )
38
+
39
+ %li
40
+ = link_to "Leads (#{Lead.kept.length})", leads_path
41
+ .inline-search
42
+ = form_tag leads_path, method: :get do
43
+ = text_field_tag :q
44
+ = link_to '[+]', new_lead_path
45
+ %li
46
+ = link_to "Schs (#{Sch.active.length})", scheduled_email_actions_path
47
+ = link_to '[+]', new_scheduled_email_action_path
48
+
49
+ %ul
50
+ %li
51
+ = link_to 'OLATs', lead_action_templates_path
52
+ = link_to '[+]', new_lead_action_template_path
53
+ = link_to 'Lead Actions', lead_actions_path
54
+
55
+
56
+ %li
57
+ = link_to "Campaigns (#{Ish::EmailCampaign.all.length})", email_campaigns_path
58
+ = link_to '[+]', new_email_campaign_path
59
+ %li
60
+ = link_to "OActions (#{Office::Action.all.length})", office_actions_path
61
+ = link_to '[+]', new_office_action_path
62
+ %li
63
+ = link_to 'Unsubs', unsubscribes_path
64
+ = link_to 'Analytics', analytics_path
65
+
66
+ .c
67
+
68
+ %i.fa.fa-compress.collapse-expand#collapseHeaderWco
69
+ Wasya Co Rb
70
+ .a
71
+ %ul
72
+ %li
73
+ = link_to 'ApplianceTmpl\'s', appliance_tmpls_path
74
+ %li
75
+ = link_to 'Appliance\'s', appliances_path
76
+ %li
77
+ = link_to 'Serverhost\'s', serverhosts_path
78
+ %ul
79
+ %li
80
+ = link_to 'Products & Prices', products_path
81
+ %li
82
+ = link_to 'Subscriptions', subscriptions_path
83
+ = link_to '[+]', new_wco_subscription_path
84
+ %li
85
+ = link_to 'Wco::Leadset\'s', wco_leadsets_path
86
+
87
+
88
+ .c
89
+
90
+
91
+
92
+ -# %i.fa.fa-compress.collapse-expand#collapseHeaderIro Iro Wor
93
+ -# .a
94
+ -# %ul
95
+ -# %li
96
+ -# = link_to 'Alerts', iro_alerts_path
97
+ -# = link_to 'Watchers', iro_watchers_path
98
+ -# %li
99
+ -# = link_to 'Plots', 'http://localhost:3000/iron_warbler/NOPE-1', target: '_blank'
100
+ -# %li
101
+ -# = link_to 'Purses', iro_purses_path
102
+ -# - Iro::Purse.all.map do |p|
103
+ -# = "[#{p.id}"
104
+ -# = link_to "show", iro_purse_path(p)
105
+ -# = link_to "gui", iro_purse_path({ id: p.id, kind: 'show_gameui' })
106
+ -# = "]"
107
+ -# = link_to '[+]', new_iro_purse_path
108
+ -# .c
109
+
@@ -0,0 +1,8 @@
1
+
2
+
3
+ - param_name ||= resource.klass::PAGE_PARAM_NAME
4
+
5
+ - if resource.respond_to? :total_pages
6
+ = paginate resource, param_name: param_name, views_prefix: 'wco'
7
+ - else
8
+ -# %label Not paginated.
@@ -0,0 +1,8 @@
1
+
2
+ -# - path ||= "#{resource.name.downcase.pluralize}"
3
+ - path ||= resource
4
+ .application--search
5
+ = form_tag path, :method => :get, :class => :search do
6
+ .field.search_words
7
+ = text_field_tag 'q', nil, :placeholder => 'Search'
8
+ .c
File without changes
@@ -0,0 +1,24 @@
1
+
2
+ - url ||= gallery.new_record? ? galleries_path : gallery_path( gallery )
3
+ = form_for gallery, :url => url do |f|
4
+ .actions
5
+ = f.submit 'Submit'
6
+ .field
7
+ = f.label :name
8
+ = f.text_field :name
9
+ = f.label :slug
10
+ = f.text_field :slug
11
+ -# .col-md-2
12
+ -# .field
13
+ -# = f.label :premium_tier
14
+ -# = f.number_field :premium_tier
15
+
16
+ .row
17
+ .col-md-4
18
+ = f.label :subhead
19
+ = f.text_area :subhead
20
+ .col-md-4
21
+ = f.label :descr
22
+ = f.text_area :descr, class: :tinymce
23
+ .actions
24
+ = f.submit 'Submit'
@@ -0,0 +1,8 @@
1
+
2
+ - galleries ||= Wco::Gallery.all
3
+
4
+ = link_to "Galleries (#{galleries.length})", wco.galleries_path
5
+ .d-inline-block
6
+ = form_tag wco.galleries_path, method: :get do
7
+ = text_field_tag :q
8
+ = link_to '[+]', wco.new_gallery_path
@@ -0,0 +1,40 @@
1
+ -#
2
+ -# wco / galleries / _index.haml
3
+ -#
4
+ -# _vp_ 2022-09-25 :: Small styling revision
5
+ -#
6
+
7
+ - n_thumbs ||= 12
8
+ - galleries ||= @galleries
9
+
10
+ .galleries--index.maxwidth
11
+ = render 'header', galleries: galleries
12
+
13
+ .padded
14
+ - if galleries.length > 0
15
+
16
+ - if galleries.respond_to? :total_pages
17
+ = paginate galleries, :param_name => :galleries_page, :views_prefix => 'wco'
18
+
19
+ .row
20
+ - galleries.each do |g|
21
+ .col-sm-12.col-md-6
22
+ .Card
23
+ %h5
24
+ = link_to '[~]', edit_gallery_path( g )
25
+ = link_to g.name, gallery_path(g.slug)
26
+ (#{g.photos.length})
27
+ = render 'meta', item: g
28
+ - if g.photos.length == 0
29
+ No Photos
30
+ - else
31
+ .flex-row
32
+ - g.photos.limit( n_thumbs ).each do |photo|
33
+ = link_to image_tag(photo.photo.url(:thumb), :alt => g.name), gallery_path(g.slug)
34
+
35
+ - if galleries.respond_to? :total_pages
36
+ = paginate galleries, :param_name => :galleries_page, :views_prefix => 'wco'
37
+
38
+ - else
39
+ %h5 No Galleries
40
+
@@ -0,0 +1,10 @@
1
+
2
+ .galleries--menu
3
+
4
+ = link_to "Galleries (#{Wco::Gallery.all.length})", galleries_path
5
+
6
+ .inline-search
7
+ = form_tag galleries_path, method: :get do
8
+ = text_field_tag :q
9
+
10
+ = link_to '[+]', new_gallery_path
@@ -0,0 +1,12 @@
1
+
2
+ .galleries--menu-secondary
3
+ %ul
4
+ %li{ class: "#{params[:render_type] == 'index_titles' ? 'active' : ''}" }
5
+ = link_to 'titles list', galleries_index_titles_path( :render_type => Gallery::RENDER_THUMBS )
6
+ %li{ class: "#{params[:render_type] == 'index_thumbs' ? 'active' : ''}" }
7
+ = link_to 'thumbs list', galleries_index_thumbs_path( :render_type => Gallery::RENDER_TITLES )
8
+ %li{ class: "#{params[:render_type] == 'index_thumbs' ? 'active' : ''}" }
9
+ = link_to 'shared with me (thumbs)', galleries_shared_path( :render_type => Gallery::RENDER_THUMBS )
10
+ %li{ class: "#{params[:render_type] == 'index_titles' ? 'active' : ''}" }
11
+ = link_to 'shared with me (titles)', galleries_shared_titles_path
12
+
@@ -0,0 +1,9 @@
1
+
2
+ %hr
3
+ .row
4
+ - gallery.photos.each do |photo|
5
+ .col.s3
6
+ %br
7
+ = button_to '[x]', photo_path( photo ), :method => :delete, :data => { :confirm => 'Are you sure?' }
8
+ .thumb= image_tag( photo.photo.url( :thumb ), :alt => '' )
9
+ %hr
@@ -0,0 +1,16 @@
1
+
2
+ .galleries--title
3
+ %h2
4
+ Gallery
5
+ = link_to gallery.name, gallery_path(gallery)
6
+ (#{gallery.photos.length})
7
+ = link_to '[~]', edit_gallery_path( gallery )
8
+ .d-inline-block= button_to 'x', gallery_path(gallery), method: :delete, data: { confirm: 'Are you sure?' }
9
+ - if gallery.is_public && !gallery.is_trash && !gallery.is_done
10
+ %i.material-icons visibility
11
+ - else
12
+ %i.material-icons visibility_off
13
+ %ul
14
+ %li slug :: #{gallery.slug}
15
+ %li subhead :: #{gallery.subhead}
16
+ %li= render 'meta', :item => gallery
@@ -0,0 +1,6 @@
1
+
2
+ .galleries-edit.max-width
3
+ = render 'title', :gallery => @gallery
4
+ = render 'form', :gallery => @gallery, :url => gallery_path( @gallery )
5
+ = render 'thumbs', :gallery => @gallery
6
+ = render 'wco/photos/multinew', :gallery => @gallery
@@ -0,0 +1,6 @@
1
+
2
+ .galleries-new.maxwidth
3
+ .header
4
+ %h5.title New Gallery
5
+
6
+ = render 'form', :gallery => @gallery
@@ -0,0 +1,43 @@
1
+ -#
2
+ -# wco / galleries / show
3
+ -#
4
+
5
+ .galleries-show.padded
6
+ .row
7
+ .col-md-6
8
+ = render 'title', gallery: @gallery
9
+ .col-md-6
10
+ = render 'wco/photos/multinew', gallery: @gallery
11
+
12
+ .row-deleted
13
+ %p.collapse-expand#rowDeleted Deleted
14
+ = render 'wco/photos/index_thumbs', photos: @deleted_photos
15
+
16
+ .row-mini
17
+ %p.collapse-expand#rowMinis Mini's
18
+ .flex-row
19
+ - @photos.each do |photo|
20
+ .item
21
+ = link_to image_tag(photo.photo.url( :mini ), :alt => ''), "#large_#{photo.id}"
22
+
23
+ .row-thumbs
24
+ %p.collapse-expand#rowThumbs Thumbs
25
+ .orderable-items{ data: { id: @gallery.id.to_s, slug: @gallery.slug, token: form_authenticity_token } }
26
+ .flex-row.items
27
+ - @photos.each do |photo|
28
+ .itemW
29
+ %a.mvLeft &lt;
30
+ %a.mvRight &gt;
31
+ .item{ data: { id: photo.id.to_s } }
32
+ = render 'wco/photos/meta_manager', photo: photo
33
+ = image_tag photo.photo.url( :thumb )
34
+ = button_tag 'Save ordering', class: 'save-ordering'
35
+
36
+ .row-large
37
+ %p.collapse-expand#rowLarge Large
38
+ .a
39
+ - @photos.each do |photo|
40
+ .item
41
+ %a{id: "large_#{photo.id}" }
42
+ = render 'wco/photos/meta_manager', photo: photo
43
+ .wrapper{ style: "background-image: url('#{photo.photo.url( :large )}')" }
@@ -0,0 +1,17 @@
1
+
2
+ .headlines--form
3
+ = form_for headline do |f|
4
+ .field
5
+ %label Name
6
+ = f.text_field :name
7
+
8
+ .field
9
+ %label Site
10
+ = f.select :site, options_for_select( @sites_list, selected: headline.site_id ), {}, class: 'select2'
11
+
12
+ .field
13
+ %label Tags
14
+ = f.select :tag_ids, options_for_select( @tags_list, selected: headline.tag_ids ), { }, { class: 'select2', multiple: true }
15
+
16
+ .actions
17
+ = f.submit
@@ -0,0 +1,6 @@
1
+
2
+ = link_to "Headlines (#{Wco::Headline.all.length})", wco.headlines_path
3
+ .inline-search
4
+ = form_tag wco.headlines_path, method: :get do
5
+ = text_field_tag :q
6
+ = link_to '[+]', wco.new_headline_path