wco_hosting 0.0.0.4 → 0.0.0.5

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: 8f0b58b867b5892b387e86f64a985030cafcf66e4f69249ba1489f1fd6b156ce
4
- data.tar.gz: 97e32482d3c0283241f1b179b8c0e07544e6d3c3b9588a8c30a76613a4e18d59
3
+ metadata.gz: 3bc806f95a42fc25f895128a2c07bbf2d443c12688ad3b938d67f6fe39506df1
4
+ data.tar.gz: e1e4e8d5c60a4eaf04cd710efe01616782949fc0b317a058b283132e0f13f44c
5
5
  SHA512:
6
- metadata.gz: 3ad9e34cbb40487eb7f1ead61e62c46702e2462778774109d953b3d91dcdbd658d1f3e86ab5d5ded31e3697529e02d85b2cb73049ca13819ebbd7ac256a0a76b
7
- data.tar.gz: 9888d34d89214a5e735ea43427f498d87dc716ee25ce14e1380a6922054f1e9d17bdd847233bacce784f28bde77c4f5e2178f2a5f3b3039acf95ad8999f923d3
6
+ metadata.gz: bb1f61cde4d1b87922cf4ca1c244b9927f9c707a1c2ad6a00359fba46aecd72d5e8d6824620c552f450b3fee81f7bf63cb5cae8f41d1e4f7afd7946f70563e17
7
+ data.tar.gz: fa2777f315eae9ae27ef5d9d063131c9aeffeade11eed3ff1a519ca3d2dc86f45d9c376f94d89e9551313de76ad238b1aa6ca28ad6499c5b0de057658c3ad6cd
@@ -0,0 +1,2 @@
1
+
2
+ console.log('Loaded wco_hosting/application.js')
@@ -4,9 +4,11 @@ class WcoHosting::ApplianceTmplsController < WcoHosting::ApplicationController
4
4
  before_action :set_lists
5
5
 
6
6
  def create
7
- @appliance_tmpl = WcoHosting::ApplianceTmpl.new params[:appliance].permit!
7
+ @appliance_tmpl = WcoHosting::ApplianceTmpl.new params[:tmpl].permit!
8
8
  authorize! :create, @appliance_tmpl
9
9
 
10
+ @appliance_tmpl.price_id = Wco::Price.find( params[:tmpl][:wco_price_id] ).price_id
11
+
10
12
  flag = @appliance_tmpl.save
11
13
  if flag
12
14
  flash[:notice] = 'Success.'
@@ -35,7 +37,15 @@ class WcoHosting::ApplianceTmplsController < WcoHosting::ApplicationController
35
37
  def update
36
38
  @appliance_tmpl = WcoHosting::ApplianceTmpl.find params[:id]
37
39
  authorize! :update, @appliance_tmpl
38
- flag = @appliance_tmpl.update params[:appliance].permit!
40
+
41
+ price = Wco::Price.find( params[:tmpl][:price] )
42
+ price.product = @appliance_tmpl
43
+ price.save
44
+
45
+ params[:tmpl][:price_id] = price.price_id
46
+ params[:tmpl][:price] = price
47
+
48
+ flag = @appliance_tmpl.update params[:tmpl].permit!
39
49
  if flag
40
50
  flash_notice 'success'
41
51
  else
@@ -50,6 +60,7 @@ class WcoHosting::ApplianceTmplsController < WcoHosting::ApplicationController
50
60
  private
51
61
 
52
62
  def set_lists
63
+ @prices_list = Wco::Price.list
53
64
  @new_appliance_tmpl = WcoHosting::ApplianceTmpl.new
54
65
  end
55
66
 
@@ -0,0 +1,11 @@
1
+
2
+ class WcoHosting::SubscriptionsController < WcoHosting::ApplicationController
3
+
4
+ def create
5
+ Stripe::Subscription.create({
6
+ customer: 'cus_Na6dX7aXxi11N4',
7
+ items: [{price: 'price_1MowQULkdIwHu7ixraBm864M'}],
8
+ })
9
+ end
10
+
11
+ end
@@ -5,15 +5,21 @@
5
5
  %title Wco Hosting
6
6
  = csrf_meta_tags
7
7
  = csp_meta_tag
8
+ -# = javascript_include_tag 'wco_hosting/application'
8
9
  = stylesheet_link_tag "wco_hosting/application", media: "all"
9
10
  %body
10
11
 
11
- %h1 Wco Hosting
12
- %nav
12
+ %h2 Wco Hosting
13
+ %nav.flex-row
14
+ %ul
15
+ %li= link_to 'ROOT', '/'
16
+ %li= link_to '/email', '/email'
17
+ %li= link_to '/wco', '/wco'
13
18
  %ul
14
19
  %li= link_to 'Wco::Leadsets', leadsets_path
15
20
  %li= link_to 'ApplianceTmpl`s', appliance_tmpls_path
16
21
  %li= link_to 'Appliances', appliances_path
22
+ -# %li= link_to 'Products', products_path
17
23
  %li= link_to 'Serverhosts', serverhosts_path
18
24
  %hr
19
25
 
@@ -2,7 +2,7 @@
2
2
  - url = appliance_tmpl.new_record? ? appliance_tmpls_path : appliance_tmpl_path( appliance_tmpl )
3
3
 
4
4
  .appliance-tmpls--form
5
- = form_for appliance_tmpl, as: :appliance, url: url do |f|
5
+ = form_for appliance_tmpl, as: :tmpl, url: url do |f|
6
6
  .field
7
7
  = f.label :kind
8
8
  = f.text_field :kind
@@ -18,6 +18,9 @@
18
18
  .field
19
19
  %label volume_zip
20
20
  = f.text_field :volume_zip, class: 'w-100'
21
+ .field
22
+ %label price
23
+ = f.select :price, options_for_select( @prices_list, selected: appliance_tmpl.price )
21
24
 
22
25
  .actions
23
26
  = f.submit 'Submit'
@@ -6,20 +6,25 @@
6
6
 
7
7
  %table.bordered
8
8
  %tr
9
- %th id
9
+ %th &nbsp;
10
10
  %th kind
11
11
  %th version
12
12
  %th image
13
13
  %th volume_zip
14
- -# %td &nbsp;
14
+ %th price
15
+ %td &nbsp;
15
16
 
16
17
  - @appliance_tmpls.each do |tmpl|
17
18
  %tr
18
- %td= tmpl.id
19
+ %td
20
+ = link_to '[~]', edit_appliance_tmpl_path(tmpl)
19
21
  %td= tmpl.kind
20
22
  %td= tmpl.version
21
23
  %td= tmpl.image
22
24
  %td= tmpl.volume_zip
23
- -# %td= tmpl.inspect
24
-
25
+ %td
26
+ = tmpl.price
27
+ %br
28
+ = tmpl.price_id
29
+ %td= tmpl.inspect
25
30
 
@@ -1,8 +1,6 @@
1
1
 
2
2
  - url = leadset.new_record? ? leadsets_path : leadset_path(leadset)
3
3
  .leadsets--form
4
- %ul
5
- %li <b>Next Serverhost:</b> #{leadset.next_serverhost}
6
4
 
7
5
  = form_for leadset, as: :leadset, url: url do |f|
8
6
  .field
@@ -2,12 +2,21 @@
2
2
  .leadsets-index
3
3
  %h5 Leadsets
4
4
 
5
- %ul
6
- - @leadsets.each do |leadset|
7
- %li.flex-row
8
- .gray= leadset.id.to_s
9
- &nbsp;&nbsp;
10
- = link_to "[view]", leadset_path(leadset)
11
- %ul
12
- %li <b>company_url:</b> #{leadset.company_url}
13
- %li <b>serverhosts:</b> #{leadset.serverhosts.map(&:name).join(",")}
5
+ %table.bordered
6
+ %tr
7
+ %th &nbsp;
8
+ %th company_url
9
+ %th serverhosts
10
+ %th customer_id
11
+ %td &nbsp;
12
+ - @leadsets.each do |item|
13
+ %tr
14
+ %td
15
+ = link_to '[~]', edit_leadset_path(item)
16
+ %td= link_to item.company_url, leadset_path(item)
17
+ %td= item.serverhosts.map(&:name).join(",")
18
+ %td= item.customer_id
19
+ %td
20
+ = item.inspect
21
+
22
+
@@ -1,5 +1,13 @@
1
1
 
2
2
  .leadsets-show
3
- %h5 Leadset #{@leadset.inspect}
3
+ %h5 Leadset `#{@leadset.company_url}`
4
+
5
+ %ul
6
+ %li <b>Next Serverhost:</b> #{@leadset.next_serverhost}
7
+ %li
8
+ <b>Subscriptions (#{@leadset.subscriptions.length}):</b>
9
+ %ul
10
+ - @leadset.subscriptions.each do |item|
11
+ %li= item.inspect
4
12
 
5
13
  = render '/wco_hosting/leadsets/form', leadset: @leadset
@@ -0,0 +1,4 @@
1
+
2
+ Rails.application.config.assets.version = '1.0'
3
+
4
+ Rails.application.config.assets.precompile += %w( application.js application.css )
data/config/routes.rb CHANGED
@@ -9,7 +9,8 @@ WcoHosting::Engine.routes.draw do
9
9
  # get 'email_conversations/not-in/:tagname_not', to: '/wco/email_conversations#index', as: :email_conversations_in_not
10
10
  # resources :email_conversations
11
11
 
12
- resources :serverhosts
13
12
  resources :leadsets
14
13
 
14
+ resources :serverhosts
15
+
15
16
  end
data/lib/wco_hosting.rb CHANGED
@@ -7,7 +7,7 @@ require "wco_hosting/engine"
7
7
  ## From: https://github.com/rails/rails/issues/30701
8
8
  def logger; Rails.logger; end
9
9
 
10
- require 'ish_models'
10
+ # require 'ish_models'
11
11
 
12
12
  module Wco; end
13
13
  module WcoHosting; end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wco_hosting
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0.4
4
+ version: 0.0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Pudeyev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-23 00:00:00.000000000 Z
11
+ date: 2023-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -39,19 +39,19 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: 6.3.0
41
41
  - !ruby/object:Gem::Dependency
42
- name: cancancan
42
+ name: sass-rails
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 3.5.0
47
+ version: '5.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 3.5.0
54
+ version: '5.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: devise
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -67,7 +67,21 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: 4.9.3
69
69
  - !ruby/object:Gem::Dependency
70
- name: ish_models
70
+ name: cancancan
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 3.5.0
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 3.5.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: wco_models
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
87
  - - "~>"
@@ -179,19 +193,19 @@ dependencies:
179
193
  - !ruby/object:Gem::Version
180
194
  version: 4.0.0
181
195
  - !ruby/object:Gem::Dependency
182
- name: sass-rails
196
+ name: stripe
183
197
  requirement: !ruby/object:Gem::Requirement
184
198
  requirements:
185
199
  - - "~>"
186
200
  - !ruby/object:Gem::Version
187
- version: '5.0'
201
+ version: 10.4.0
188
202
  type: :runtime
189
203
  prerelease: false
190
204
  version_requirements: !ruby/object:Gem::Requirement
191
205
  requirements:
192
206
  - - "~>"
193
207
  - !ruby/object:Gem::Version
194
- version: '5.0'
208
+ version: 10.4.0
195
209
  description: https://wasya.co
196
210
  email:
197
211
  - victor@wasya.co
@@ -202,6 +216,7 @@ files:
202
216
  - README.txt
203
217
  - Rakefile
204
218
  - app/assets/config/wco_hosting_manifest.js
219
+ - app/assets/javascript/wco_hosting/application.js
205
220
  - app/assets/stylesheets/wco_hosting/application.css
206
221
  - app/assets/stylesheets/wco_hosting/main.scss
207
222
  - app/controllers/wco_hosting/appliance_tmpls_controller.rb
@@ -209,13 +224,12 @@ files:
209
224
  - app/controllers/wco_hosting/application_controller.rb
210
225
  - app/controllers/wco_hosting/leadsets_controller.rb
211
226
  - app/controllers/wco_hosting/serverhosts_controller.rb
212
- - app/controllers/wco_hosting/sessions_controller.rb-trash
227
+ - app/controllers/wco_hosting/subscriptions_controller.rb
213
228
  - app/helpers/wco_hosting/application_helper.rb
214
229
  - app/jobs/wco_hosting/application_job.rb
215
230
  - app/mailers/wco_hosting/application_mailer.rb
216
231
  - app/models/wco/ability.rb
217
232
  - app/views/layouts/wco_hosting/application.haml
218
- - app/views/wco/application/_alerts_notices.haml
219
233
  - app/views/wco_hosting/appliance_tmpls/_form.haml
220
234
  - app/views/wco_hosting/appliance_tmpls/edit.haml
221
235
  - app/views/wco_hosting/appliance_tmpls/index.haml
@@ -229,6 +243,7 @@ files:
229
243
  - app/views/wco_hosting/serverhosts/edit.haml
230
244
  - app/views/wco_hosting/serverhosts/index.haml
231
245
  - app/views/wco_hosting/serverhosts/new.haml
246
+ - config/initializers/assets.rb
232
247
  - config/routes.rb
233
248
  - lib/tasks/wco_hosting_tasks.rake
234
249
  - lib/wco_hosting.rb
@@ -1,19 +0,0 @@
1
-
2
- class WcoHosting::SessionsController < WcoHosting::ApplicationController
3
-
4
- skip_before_action :verify_authenticity_token, only: :create
5
-
6
- def new
7
- render :new
8
- end
9
-
10
- def create
11
- puts! params, '#create'
12
-
13
- user_info = request.env['omniauth.auth']
14
- puts! user_info, 'user_info'
15
-
16
- render json: { status: :ok }
17
- end
18
-
19
- end
@@ -1,22 +0,0 @@
1
-
2
- .row.max-width
3
- .col-sm-12
4
- - if notice&.class == String
5
- .notice
6
- = notice
7
- .close [x]
8
- - if notice&.class == Array
9
- - notice.each do |i|
10
- .notice
11
- = i
12
- .close [x]
13
- - if alert&.class == String
14
- .alert
15
- = alert
16
- .close [x]
17
- - if alert&.class == Array
18
- - alert.each do |i|
19
- .alert
20
- = i
21
- .close [x]
22
-