effective_learndash 0.1.3 → 0.1.6

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.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +16 -10
  3. data/app/assets/config/effective_learndash_manifest.js +0 -1
  4. data/app/controllers/admin/course_registrations_controller.rb +8 -0
  5. data/app/controllers/admin/learndash_courses_controller.rb +1 -1
  6. data/app/controllers/effective/course_registrations_controller.rb +13 -0
  7. data/app/controllers/effective/learndash_courses_controller.rb +32 -0
  8. data/app/datatables/admin/effective_course_registrations_datatable.rb +28 -0
  9. data/app/datatables/admin/effective_learndash_courses_datatable.rb +5 -1
  10. data/app/datatables/admin/effective_learndash_enrollments_datatable.rb +1 -2
  11. data/app/datatables/admin/effective_learndash_users_datatable.rb +1 -1
  12. data/app/datatables/effective_course_registrants_datatable.rb +24 -0
  13. data/app/datatables/effective_course_registrations_datatable.rb +35 -0
  14. data/app/datatables/effective_learndash_courses_datatable.rb +30 -0
  15. data/app/datatables/effective_learndash_enrollments_datatable.rb +7 -4
  16. data/app/models/concerns/effective_learndash_course_registration.rb +172 -0
  17. data/app/models/concerns/effective_learndash_owner.rb +1 -1
  18. data/app/models/effective/course_registrant.rb +53 -0
  19. data/app/models/effective/course_registration.rb +5 -0
  20. data/app/models/effective/learndash_api.rb +14 -5
  21. data/app/models/effective/learndash_course.rb +78 -3
  22. data/app/models/effective/learndash_enrollment.rb +7 -3
  23. data/app/models/effective/learndash_user.rb +5 -6
  24. data/app/views/admin/learndash_courses/_form.html.haml +25 -0
  25. data/app/views/admin/learndash_courses/_form_course_registration_content.html.haml +19 -0
  26. data/app/views/admin/learndash_courses/_form_learndash_course.html.haml +32 -0
  27. data/app/views/admin/learndash_courses/_learndash_course.html.haml +3 -3
  28. data/app/views/admin/learndash_owners/_form.html.haml +1 -1
  29. data/app/views/admin/learndash_users/_form.html.haml +1 -1
  30. data/app/views/admin/learndash_users/_learndash_user.html.haml +4 -4
  31. data/app/views/effective/course_registrations/_content.html.haml +10 -0
  32. data/app/views/effective/course_registrations/_course.html.haml +9 -0
  33. data/app/views/effective/course_registrations/_course_registration.html.haml +3 -0
  34. data/app/views/effective/course_registrations/_dashboard.html.haml +30 -0
  35. data/app/views/effective/course_registrations/_layout.html.haml +3 -0
  36. data/app/views/effective/course_registrations/_orders.html.haml +4 -0
  37. data/app/views/effective/course_registrations/_summary.html.haml +39 -0
  38. data/app/views/effective/course_registrations/billing.html.haml +15 -0
  39. data/app/views/effective/course_registrations/checkout.html.haml +6 -0
  40. data/app/views/effective/course_registrations/course.html.haml +20 -0
  41. data/app/views/effective/course_registrations/start.html.haml +25 -0
  42. data/app/views/effective/course_registrations/submitted.html.haml +15 -0
  43. data/app/views/effective/course_registrations/summary.html.haml +8 -0
  44. data/app/views/effective/learndash/_dashboard.html.haml +14 -16
  45. data/app/views/effective/learndash_courses/_learndash_course.html.haml +13 -0
  46. data/app/views/effective/learndash_courses/index.html.haml +5 -0
  47. data/app/views/effective/learndash_courses/show.html.haml +6 -0
  48. data/config/effective_learndash.rb +9 -0
  49. data/config/routes.rb +13 -3
  50. data/db/migrate/01_create_effective_learndash.rb.erb +98 -33
  51. data/lib/effective_learndash/engine.rb +1 -0
  52. data/lib/effective_learndash/version.rb +1 -1
  53. data/lib/effective_learndash.rb +6 -1
  54. data/lib/generators/effective_learndash/install_generator.rb +0 -1
  55. metadata +33 -4
@@ -1,48 +1,113 @@
1
1
  class CreateEffectiveLearndash < ActiveRecord::Migration[6.1]
2
- create_table :learndash_users do |t|
3
- t.integer :owner_id
4
- t.string :owner_type
2
+ def change
3
+ create_table :learndash_users do |t|
4
+ t.integer :owner_id
5
+ t.string :owner_type
5
6
 
6
- t.datetime :last_synced_at
7
+ t.datetime :last_synced_at
7
8
 
8
- # Wordpress
9
- t.integer :user_id
10
- t.string :email
11
- t.string :username
12
- t.string :password
9
+ # Wordpress
10
+ t.integer :user_id
11
+ t.string :email
12
+ t.string :username
13
+ t.string :password
13
14
 
14
- t.timestamps
15
- end
15
+ t.timestamps
16
+ end
16
17
 
17
- create_table :learndash_courses do |t|
18
- # Wordpress
19
- t.integer :course_id
20
- t.string :status
21
- t.string :title
22
- t.string :link
18
+ create_table :learndash_courses do |t|
19
+ # Wordpress
20
+ t.integer :course_id
21
+ t.string :status
22
+ t.string :title
23
+ t.string :link
23
24
 
24
- t.timestamps
25
- end
25
+ # Our attributes
26
+ t.string :slug
27
+
28
+ t.integer :roles_mask
29
+ t.boolean :authenticate_user, default: false
30
+
31
+ # Course Purchases
32
+ t.boolean :can_register, default: false
33
+
34
+ t.integer :regular_price
35
+ t.integer :member_price
36
+
37
+ t.string :qb_item_name
38
+ t.boolean :tax_exempt, default: false
39
+
40
+ t.timestamps
41
+ end
42
+
43
+ create_table :learndash_enrollments do |t|
44
+ t.integer :owner_id
45
+ t.string :owner_type
46
+
47
+ t.integer :learndash_course_id
48
+ t.integer :learndash_user_id
49
+
50
+ t.datetime :last_synced_at
51
+
52
+ # Wordpress
53
+ t.string :progress_status
54
+
55
+ t.integer :last_step
56
+ t.integer :steps_completed
57
+ t.integer :steps_total
58
+
59
+ t.datetime :date_started
60
+ t.datetime :date_completed
61
+
62
+ t.timestamps
63
+ end
64
+
65
+ create_table :course_registrants do |t|
66
+ t.integer :owner_id
67
+ t.string :owner_type
68
+
69
+ t.integer :course_registration_id
70
+ t.string :course_registration_type
71
+
72
+ t.integer :learndash_course_id
73
+
74
+ # Acts as purchasable
75
+ t.integer :purchased_order_id
76
+ t.integer :price
77
+ t.boolean :tax_exempt, default: false
78
+ t.string :qb_item_name
79
+
80
+ t.timestamps
81
+ end
82
+
83
+ create_table :course_registrations do |t|
84
+ t.string :token
85
+
86
+ t.integer :owner_id
87
+ t.string :owner_type
88
+
89
+ t.integer :user_id
90
+ t.string :user_type
26
91
 
27
- create_table :learndash_enrollments do |t|
28
- t.integer :owner_id
29
- t.string :owner_type
92
+ t.integer :learndash_course_id
30
93
 
31
- t.integer :learndash_course_id
32
- t.integer :learndash_user_id
94
+ # Acts as Statused
95
+ t.string :status
96
+ t.text :status_steps
33
97
 
34
- t.datetime :last_synced_at
98
+ # Acts as Wizard
99
+ t.text :wizard_steps
35
100
 
36
- # Wordpress
37
- t.string :progress_status
101
+ # Dates
102
+ t.datetime :submitted_at
38
103
 
39
- t.integer :last_step
40
- t.integer :steps_completed
41
- t.integer :steps_total
104
+ t.datetime :updated_at
105
+ t.datetime :created_at
106
+ end
42
107
 
43
- t.datetime :date_started
44
- t.datetime :date_completed
108
+ add_index :course_registrations, [:owner_id, :owner_type]
109
+ add_index :course_registrations, :status
110
+ add_index :course_registrations, :token
45
111
 
46
- t.timestamps
47
112
  end
48
113
  end
@@ -15,6 +15,7 @@ module EffectiveLearndash
15
15
  initializer 'effective_learndash.active_record' do |app|
16
16
  ActiveSupport.on_load :active_record do
17
17
  ActiveRecord::Base.extend(EffectiveLearndashOwner::Base)
18
+ ActiveRecord::Base.extend(EffectiveLearndashCourseRegistration::Base)
18
19
  end
19
20
  end
20
21
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveLearndash
2
- VERSION = '0.1.3'.freeze
2
+ VERSION = '0.1.6'.freeze
3
3
  end
@@ -11,7 +11,8 @@ module EffectiveLearndash
11
11
  [
12
12
  :learndash_url, :learndash_username, :learndash_password,
13
13
  :wp_username, :wp_password,
14
- :layout
14
+ :layout, :per_page, :use_effective_roles,
15
+ :course_registration_class_name
15
16
  ]
16
17
  end
17
18
 
@@ -49,4 +50,8 @@ module EffectiveLearndash
49
50
  owner.instance_exec(owner, &wp_password)
50
51
  end
51
52
 
53
+ def self.CourseRegistration
54
+ course_registration_class_name&.constantize || Effective::CourseRegistration
55
+ end
56
+
52
57
  end
@@ -20,7 +20,6 @@ module EffectiveLearndash
20
20
  end
21
21
 
22
22
  def create_migration_file
23
- @learndash_courses_table_name = ':' + EffectiveLearndash.learndash_courses_table_name.to_s
24
23
  migration_template ('../' * 3) + 'db/migrate/01_create_effective_learndash.rb.erb', 'db/migrate/create_effective_learndash.rb'
25
24
  end
26
25
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_learndash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-30 00:00:00.000000000 Z
11
+ date: 2022-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -164,7 +164,7 @@ dependencies:
164
164
  - - ">="
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
- description: Create Wordpress users and read Learndash course progress
167
+ description: Create Wordpress users and read LearnDash course progress
168
168
  email:
169
169
  - info@codeandeffect.com
170
170
  executables: []
@@ -179,25 +179,54 @@ files:
179
179
  - app/assets/javascripts/effective_learndash/base.js
180
180
  - app/assets/stylesheets/effective_learndash.scss
181
181
  - app/assets/stylesheets/effective_learndash/base.scss
182
+ - app/controllers/admin/course_registrations_controller.rb
182
183
  - app/controllers/admin/learndash_courses_controller.rb
183
184
  - app/controllers/admin/learndash_enrollments_controller.rb
184
185
  - app/controllers/admin/learndash_users_controller.rb
186
+ - app/controllers/effective/course_registrations_controller.rb
187
+ - app/controllers/effective/learndash_courses_controller.rb
188
+ - app/datatables/admin/effective_course_registrations_datatable.rb
185
189
  - app/datatables/admin/effective_learndash_courses_datatable.rb
186
190
  - app/datatables/admin/effective_learndash_enrollments_datatable.rb
187
191
  - app/datatables/admin/effective_learndash_users_datatable.rb
192
+ - app/datatables/effective_course_registrants_datatable.rb
193
+ - app/datatables/effective_course_registrations_datatable.rb
194
+ - app/datatables/effective_learndash_courses_datatable.rb
188
195
  - app/datatables/effective_learndash_enrollments_datatable.rb
189
196
  - app/helpers/effective_learndash_helper.rb
197
+ - app/models/concerns/effective_learndash_course_registration.rb
190
198
  - app/models/concerns/effective_learndash_owner.rb
199
+ - app/models/effective/course_registrant.rb
200
+ - app/models/effective/course_registration.rb
191
201
  - app/models/effective/learndash_api.rb
192
202
  - app/models/effective/learndash_course.rb
193
203
  - app/models/effective/learndash_enrollment.rb
194
204
  - app/models/effective/learndash_user.rb
205
+ - app/views/admin/learndash_courses/_form.html.haml
206
+ - app/views/admin/learndash_courses/_form_course_registration_content.html.haml
207
+ - app/views/admin/learndash_courses/_form_learndash_course.html.haml
195
208
  - app/views/admin/learndash_courses/_learndash_course.html.haml
196
209
  - app/views/admin/learndash_enrollments/_form.html.haml
197
210
  - app/views/admin/learndash_owners/_form.html.haml
198
211
  - app/views/admin/learndash_users/_form.html.haml
199
212
  - app/views/admin/learndash_users/_learndash_user.html.haml
213
+ - app/views/effective/course_registrations/_content.html.haml
214
+ - app/views/effective/course_registrations/_course.html.haml
215
+ - app/views/effective/course_registrations/_course_registration.html.haml
216
+ - app/views/effective/course_registrations/_dashboard.html.haml
217
+ - app/views/effective/course_registrations/_layout.html.haml
218
+ - app/views/effective/course_registrations/_orders.html.haml
219
+ - app/views/effective/course_registrations/_summary.html.haml
220
+ - app/views/effective/course_registrations/billing.html.haml
221
+ - app/views/effective/course_registrations/checkout.html.haml
222
+ - app/views/effective/course_registrations/course.html.haml
223
+ - app/views/effective/course_registrations/start.html.haml
224
+ - app/views/effective/course_registrations/submitted.html.haml
225
+ - app/views/effective/course_registrations/summary.html.haml
200
226
  - app/views/effective/learndash/_dashboard.html.haml
227
+ - app/views/effective/learndash_courses/_learndash_course.html.haml
228
+ - app/views/effective/learndash_courses/index.html.haml
229
+ - app/views/effective/learndash_courses/show.html.haml
201
230
  - config/effective_learndash.rb
202
231
  - config/routes.rb
203
232
  - db/migrate/01_create_effective_learndash.rb.erb
@@ -230,5 +259,5 @@ requirements: []
230
259
  rubygems_version: 3.1.2
231
260
  signing_key:
232
261
  specification_version: 4
233
- summary: Create Wordpress users and read Learndash course progress
262
+ summary: Create Wordpress users and read LearnDash course progress
234
263
  test_files: []