wco_models 3.1.0.219 → 3.1.0.220

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: 0771e7abb2c028200fec0881fecde76c2e315226aff2ef2495736d6264018445
4
- data.tar.gz: bb24df8d57814e1888aad0cc4c17c9a7f60fbf9eb429fcd5e290b6c805621fd4
3
+ metadata.gz: 461981337b6a6f94df0581778032d46227f9e65ae4a2dcc129f67800fd44283b
4
+ data.tar.gz: a155d238218a1da0f1c0929334b4f83aa3fb55bbcc9316c207ce0e7d8153d478
5
5
  SHA512:
6
- metadata.gz: a76367c163c8f41036b8d62dfb3eae45bf2f6070c90c74825eaba8e073c0143e5a51a83c7f928060f245fd1b7acc44d03ab5196dfae5807224aa57fa83fa6f2b
7
- data.tar.gz: efcb62dd0cce5526aeeb4d682808728bd27acd2b460525f308959e166b44c53875c6e6bacd17678a2c78d227d0fa0a70584ad245027d2ea8ff399ae354aff0c4
6
+ metadata.gz: 3050697e8cf1bb209f3bd6361bda7f645522073e038acd0e238a9af8d6d83e20c9ce888ea8256558795e788fc39513b36606af2ee45b35e8a6367105d7064a49
7
+ data.tar.gz: 3797f701465b4cecf109d1e43aa7c40232cf95353e0135aeafe61ad5ca589e86a848d5a399d66a5c282b99ecbe2add1df826d396a4ab8013dde6b195c4d4371d
@@ -0,0 +1,24 @@
1
+
2
+ class Wco::Api::VideosController < Wco::ApiController
3
+
4
+ skip_before_action :decode_jwt
5
+ skip_before_action :verify_authenticity_token, only: [:create]
6
+ before_action :decode_simple_api_key
7
+
8
+ def create
9
+ puts! params, 'ze params'
10
+
11
+ @video = Wco::Video.new name: params[:name], video: params[:video]
12
+ authorize! :create, @video
13
+
14
+ if @video.save
15
+ puts! @video, 'Created @video.'
16
+ flash[:notice] = 'Success'
17
+ render json: { status: :ok, message: @video.attributes }
18
+ else
19
+ flash[:alert] = 'No luck'
20
+ render json: { status: :not_ok, message: 'Could not create video.' }
21
+ end
22
+ end
23
+
24
+ end
@@ -16,4 +16,12 @@ class Wco::ApiController < ActionController::Base
16
16
  sign_in user
17
17
  end
18
18
 
19
+ def decode_simple_api_key
20
+ if params[:api_key] === SIMPLE_API_KEY &&
21
+ params[:api_secret] === SIMPLE_API_SECRET
22
+ user = User.find_by({ email: 'piousbox@gmail.com' })
23
+ sign_in user
24
+ end
25
+ end
26
+
19
27
  end
@@ -63,10 +63,6 @@ class Wco::LeadsetsController < Wco::ApplicationController
63
63
  @leads = @leadset.leads.page( params[:leads_page] ).per( current_profile.per_page )
64
64
  @subscriptions = @leadset.subscriptions
65
65
  @invoices = @leadset.invoices
66
-
67
- @prices = @leadset.appliance_tmpls
68
- ## _TODO: can remove
69
- @all_prices = Wco::Price.all
70
66
  end
71
67
 
72
68
  def update
@@ -46,7 +46,7 @@ class Wco::Video
46
46
  :s3_credentials => ::S3_CREDENTIALS,
47
47
  :path => "videos/:style/:id/:filename",
48
48
  :s3_protocol => 'https',
49
- :s3_permissions => 'public-read',
49
+ # :s3_permissions => 'public-read',
50
50
  :validate_media_type => false,
51
51
  s3_region: ::S3_CREDENTIALS[:region]
52
52
  validates_attachment_content_type :video, content_type: /\Avideo\/.*\Z/
@@ -41,13 +41,13 @@
41
41
  %label Stripe customer_id
42
42
  = f.text_field :customer_id
43
43
 
44
- .field
45
- %label appliance tmpl prices
46
- .d-flex.flex-wrap
47
- - @appliance_tmpl_prices_list.each do |price|
48
- .descr
49
- = check_box_tag 'leadset[appliance_tmpl_ids][]', price.id, leadset.appliance_tmpls.include?(price)
50
- %label= price.product&.name
44
+ -# .field
45
+ -# %label appliance tmpl prices
46
+ -# .d-flex.flex-wrap
47
+ -# - @appliance_tmpl_prices_list.each do |price|
48
+ -# .descr
49
+ -# = check_box_tag 'leadset[appliance_tmpl_ids][]', price.id, leadset.appliance_tmpls.include?(price)
50
+ -# %label= price.product&.name
51
51
 
52
52
 
53
53
  .actions
@@ -26,12 +26,6 @@
26
26
 
27
27
  %hr
28
28
  .row
29
- -# appliance templates (prices)
30
- .col-md-6.border-right
31
- .header
32
- %h5.title Appliance Tmpls (prices) (#{@leadset.appliance_tmpls.length})
33
- = render 'wco/prices/form_table'
34
-
35
29
  -# environments
36
30
  .col-md-6
37
31
  - if defined?( wco_hosting )
data/config/routes.rb CHANGED
@@ -9,6 +9,8 @@ Wco::Engine.routes.draw do
9
9
  get 'obf/:id', to: 'obfuscared_redirects#show'
10
10
 
11
11
  get 'tags', to: 'tags#index'
12
+
13
+ post 'videos', to: 'videos#create'
12
14
  end
13
15
 
14
16
  get 'application/tinymce', to: 'application#tinymce'
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.219
4
+ version: 3.1.0.220
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Pudeyev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-12-12 00:00:00.000000000 Z
11
+ date: 2025-12-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ahoy_matey
@@ -430,6 +430,7 @@ files:
430
430
  - app/controllers/wco/api/leads_controller.rb
431
431
  - app/controllers/wco/api/obfuscated_redirects_controller.rb
432
432
  - app/controllers/wco/api/tags_controller.rb
433
+ - app/controllers/wco/api/videos_controller.rb
433
434
  - app/controllers/wco/api_controller.rb
434
435
  - app/controllers/wco/application_controller.rb
435
436
  - app/controllers/wco/galleries_controller.rb