effective_mentorships 0.0.1 → 0.1.0

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 (36) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/admin/mentorship_group_users_controller.rb +17 -0
  3. data/app/controllers/admin/mentorship_groups_controller.rb +18 -0
  4. data/app/controllers/admin/mentorship_registrations_controller.rb +19 -0
  5. data/app/controllers/effective/mentorship_groups_controller.rb +9 -0
  6. data/app/controllers/effective/mentorship_registrations_controller.rb +12 -0
  7. data/app/datatables/admin/effective_mentorship_cycles_datatable.rb +17 -4
  8. data/app/datatables/admin/effective_mentorship_group_users_datatable.rb +22 -0
  9. data/app/datatables/admin/effective_mentorship_groups_datatable.rb +37 -0
  10. data/app/datatables/admin/effective_mentorship_registrations_datatable.rb +42 -0
  11. data/app/datatables/effective_mentorships_available_cycles_datatable.rb +40 -0
  12. data/app/datatables/effective_mentorships_groups_datatable.rb +25 -0
  13. data/app/datatables/effective_mentorships_registrations_datatable.rb +25 -0
  14. data/app/helpers/effective_mentorships_helper.rb +45 -8
  15. data/app/models/concerns/effective_mentorships_group.rb +14 -6
  16. data/app/models/concerns/effective_mentorships_registration.rb +63 -7
  17. data/app/models/concerns/effective_mentorships_user.rb +21 -8
  18. data/app/models/effective/mentorship_cycle.rb +63 -39
  19. data/app/models/effective/mentorship_group_user.rb +43 -0
  20. data/app/views/admin/mentorship_cycles/_form_mentorship_cycle.html.haml +18 -5
  21. data/app/views/admin/mentorship_group_users/_form.html.haml +12 -0
  22. data/app/views/admin/mentorship_groups/_form.html.haml +8 -0
  23. data/app/views/admin/mentorship_groups/_form_mentorship_group.html.haml +27 -0
  24. data/app/views/admin/mentorship_registrations/_form.html.haml +8 -0
  25. data/app/views/admin/mentorship_registrations/_form_mentorship_registration.html.haml +14 -0
  26. data/app/views/effective/mentorship_groups/_mentorship_group.html.haml +21 -0
  27. data/app/views/effective/mentorship_registrations/_fields.html.haml +24 -0
  28. data/app/views/effective/mentorship_registrations/_form.html.haml +15 -0
  29. data/app/views/effective/mentorship_registrations/_mentorship_registration.html.haml +6 -0
  30. data/app/views/effective/mentorships/_dashboard.html.haml +26 -0
  31. data/config/locales/effective_mentorships.en.yml +4 -3
  32. data/config/routes.rb +15 -0
  33. data/db/migrate/101_create_effective_mentorships.rb +36 -1
  34. data/lib/effective_mentorships/version.rb +1 -1
  35. metadata +23 -3
  36. data/app/controllers/effective/mentorship_cycles_controller.rb +0 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d38ae69a59937ebf5e1c21dad2407001277481495e60af6a1d1870609c9c6fb
4
- data.tar.gz: a8d9c6644d62270c9f2c28662d94e3e833ecbf57ee1daa99b5ac2668f3dbc234
3
+ metadata.gz: af5b8d49906510d97169771e8f5985984e994bda968cabe721bb32a59ccf689b
4
+ data.tar.gz: 79c113198b921e58b0f1347765586681ff2a918286ddd323fda9a35261136139
5
5
  SHA512:
6
- metadata.gz: f99ac651786e4cbcc30363b4170ace9ba1d44537fe174a8dd67d35ff004a4bb7d2b0e5556015952c0a20450c9d4871b706f659a1cce42074b726233a3d958a0a
7
- data.tar.gz: 62124e0a9999292cc0d61e736d808c619f1e942a027edab3fc4c912dda2639fe605cb87bc8b82b87dca3ca8ead57b8b8c6a95c70f312713f752fd3cba3907be8
6
+ metadata.gz: 7b84f6d4bfc332fdd2c03e71b5a88c02715447f08ecb458e729b16f17f556e686720e7fa8e6d682d9be3d24424417007ea09359b22a64ed77a88316b7baff11c
7
+ data.tar.gz: df7d47bbfffd6e6916012dacfee9339bb193fd716721be7c722949fbf84ebfd48d56dbccc363621b265bdb3ddb76b92066e9c468cb7f81e4f526cc046a7c1247
@@ -0,0 +1,17 @@
1
+ module Admin
2
+ class MentorshipGroupUsersController < ApplicationController
3
+ before_action(:authenticate_user!) if defined?(Devise)
4
+ before_action { EffectiveResources.authorize!(self, :admin, :effective_mentorships) }
5
+
6
+ include Effective::CrudController
7
+
8
+ resource_scope -> { Effective::MentorshipGroupUser.deep.all }
9
+
10
+ private
11
+
12
+ def permitted_params
13
+ params.require(:effective_mentorship_group_user).permit!
14
+ end
15
+
16
+ end
17
+ end
@@ -0,0 +1,18 @@
1
+ module Admin
2
+ class MentorshipGroupsController < ApplicationController
3
+ before_action(:authenticate_user!) if defined?(Devise)
4
+ before_action { EffectiveResources.authorize!(self, :admin, :effective_mentorships) }
5
+
6
+ include Effective::CrudController
7
+
8
+ resource_scope -> { EffectiveMentorships.MentorshipGroup.deep.all }
9
+ datatable -> { EffectiveResources.best('Admin::EffectiveMentorshipGroupsDatatable').new }
10
+
11
+ private
12
+
13
+ def permitted_params
14
+ model = (params.key?(:effective_mentorship_group) ? :effective_mentorship_group : :mentorship_group)
15
+ params.require(model).permit!
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,19 @@
1
+ module Admin
2
+ class MentorshipRegistrationsController < ApplicationController
3
+ before_action(:authenticate_user!) if defined?(Devise)
4
+ before_action { EffectiveResources.authorize!(self, :admin, :effective_mentorships) }
5
+
6
+ include Effective::CrudController
7
+
8
+ resource_scope -> { EffectiveMentorships.MentorshipRegistration.deep.all }
9
+ datatable -> { EffectiveResources.best('Admin::EffectiveMentorshipRegistrationsDatatable').new }
10
+
11
+ private
12
+
13
+ def permitted_params
14
+ model = (params.key?(:effective_mentorship_registration) ? :effective_mentorship_registration : :mentorship_registration)
15
+ params.require(model).permit!
16
+ end
17
+
18
+ end
19
+ end
@@ -0,0 +1,9 @@
1
+ module Effective
2
+ class MentorshipGroupsController < ApplicationController
3
+ before_action(:authenticate_user!) if defined?(Devise)
4
+
5
+ include Effective::CrudController
6
+
7
+ resource_scope -> { EffectiveMentorships.MentorshipGroup.deep.all }
8
+ end
9
+ end
@@ -0,0 +1,12 @@
1
+ module Effective
2
+ class MentorshipRegistrationsController < ApplicationController
3
+ before_action(:authenticate_user!) if defined?(Devise)
4
+
5
+ include Effective::CrudController
6
+
7
+ resource_scope do
8
+ cycle = Effective::MentorshipCycle.find(params[:mentorship_cycle_id])
9
+ EffectiveMentorships.MentorshipRegistration.deep.where(mentorship_cycle: cycle)
10
+ end
11
+ end
12
+ end
@@ -1,5 +1,13 @@
1
1
  module Admin
2
2
  class EffectiveMentorshipCyclesDatatable < Effective::Datatable
3
+ filters do
4
+ scope :all
5
+ scope :registrable
6
+ scope :available
7
+ scope :upcoming
8
+ scope :past
9
+ end
10
+
3
11
  datatable do
4
12
  order :start_at, :desc
5
13
 
@@ -8,15 +16,20 @@ module Admin
8
16
  col :updated_at, visible: false
9
17
 
10
18
  col :title
11
- col :start_at
12
- col :end_at
13
19
 
14
- col :registration_start_at
15
- col :registration_end_at
20
+ col :start_at, as: :date
21
+ col :end_at, as: :date
22
+ col :registration_start_at, as: :date
23
+ col :registration_end_at, as: :date
16
24
 
17
25
  col :max_pairings_mentor, label: "Max #{mentorships_mentors_label}"
18
26
  col :max_pairings_mentee, label: "Max #{mentorships_mentees_label}"
19
27
 
28
+ col :mentorship_registrations_count, label: mentorship_registrations_label
29
+ col :mentorship_groups_count, label: mentorship_groups_label
30
+
31
+ col :rich_text_registration_content, label: "#{mentorship_registration_label} opt-in content", visible: false
32
+
20
33
  actions_col
21
34
  end
22
35
 
@@ -0,0 +1,22 @@
1
+ module Admin
2
+ class EffectiveMentorshipGroupUsersDatatable < Effective::Datatable
3
+ datatable do
4
+ order :updated_at
5
+
6
+ col :updated_at, visible: false
7
+ col :created_at, visible: false
8
+ col :id, visible: false
9
+
10
+ col :mentorship_cycle
11
+ col :mentorship_group
12
+ col :mentorship_role
13
+ col :user
14
+
15
+ actions_col
16
+ end
17
+
18
+ collection do
19
+ Effective::MentorshipGroupUser.deep.all
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,37 @@
1
+ module Admin
2
+ class EffectiveMentorshipGroupsDatatable < Effective::Datatable
3
+ filters do
4
+ scope :all
5
+ scope :archived
6
+ end
7
+
8
+ datatable do
9
+ order :updated_at
10
+
11
+ col :updated_at, visible: false
12
+ col :created_at, visible: false
13
+ col :id, visible: false
14
+ col :token, visible: false
15
+
16
+ col :mentorship_cycle
17
+ col :title
18
+ col :rich_text_admin_notes, label: "Admin notes"
19
+
20
+ col :mentorship_group_users, search: :string do |mentorship_group|
21
+ mentorship_group.mentorship_group_users.map do |mentorship_group_user|
22
+ content_tag(:div, class: 'col-resource_item') do
23
+ mentorship_role_badge(mentorship_group_user.mentorship_role) + ' ' + mentorship_group_user.name
24
+ end
25
+ end.join.html_safe
26
+ end
27
+
28
+ col :archived
29
+
30
+ actions_col
31
+ end
32
+
33
+ collection do
34
+ EffectiveMentorships.MentorshipGroup.deep.all
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,42 @@
1
+ module Admin
2
+ class EffectiveMentorshipRegistrationsDatatable < Effective::Datatable
3
+ filters do
4
+ scope :all
5
+ scope :opt_in
6
+ scope :opt_out
7
+ end
8
+
9
+ datatable do
10
+ order :updated_at
11
+
12
+ col :updated_at, visible: false
13
+ col :created_at, visible: false
14
+ col :id, visible: false
15
+ col :token, visible: false
16
+
17
+ col :mentorship_cycle
18
+ col :user
19
+
20
+ col :opt_in
21
+
22
+ col :mentorship_role, search: mentorship_roles_collection() do |registration|
23
+ mentorship_role_label(registration.mentorship_role)
24
+ end
25
+
26
+ col :category, search: EffectiveMentorships.MentorshipRegistration.categories
27
+ col :venue, search: EffectiveMentorships.MentorshipRegistration.venues
28
+ col :location, search: EffectiveMentorships.MentorshipRegistration.locations
29
+ col :mentor_multiple_mentees, visible: false
30
+ col :mentor_multiple_mentees_limit, visible: false
31
+
32
+ col :parent, visible: false
33
+ col :rich_text_comments, label: "Comments", visible: false
34
+
35
+ actions_col
36
+ end
37
+
38
+ collection do
39
+ EffectiveMentorships.MentorshipRegistration.deep.all
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,40 @@
1
+ # Dashboard - the cycles we can register for
2
+ class EffectiveMentorshipsAvailableCyclesDatatable < Effective::Datatable
3
+ datatable do
4
+ order :start_at, :desc
5
+
6
+ col :title
7
+
8
+ col :registration, label: "Registration available" do |mentorship_cycle|
9
+ mentorship_cycle.registrable_date
10
+ end
11
+
12
+ col :available, label: "Schedule" do |mentorship_cycle|
13
+ mentorship_cycle.available_date
14
+ end
15
+
16
+ col :start_at, visible: false
17
+
18
+ actions_col(actions: []) do |cycle|
19
+ registration = current_user.mentorship_registration(mentorship_cycle: cycle)
20
+
21
+ if registration.blank?
22
+ if EffectiveResources.authorized?(self, :new, EffectiveMentorships.MentorshipRegistration)
23
+ dropdown_link_to('Register', effective_mentorships.new_mentorship_cycle_mentorship_registration_path(cycle))
24
+ end
25
+ else
26
+ if EffectiveResources.authorized?(self, :edit, registration)
27
+ dropdown_link_to('Edit', effective_mentorships.edit_mentorship_cycle_mentorship_registration_path(cycle, registration))
28
+ end
29
+
30
+ if EffectiveResources.authorized?(self, :destroy, registration)
31
+ dropdown_link_to('Delete', effective_mentorships.mentorship_cycle_mentorship_registration_path(cycle, registration), 'data-confirm': "Really delete #{registration}?", 'data-method': :delete)
32
+ end
33
+ end
34
+ end
35
+ end
36
+
37
+ collection do
38
+ Effective::MentorshipCycle.where(id: current_user.registrable_mentorship_cycles)
39
+ end
40
+ end
@@ -0,0 +1,25 @@
1
+ # Dashboard - My mentorship groups
2
+ class EffectiveMentorshipsGroupsDatatable < Effective::Datatable
3
+ datatable do
4
+ order :mentorship_cycle
5
+
6
+ col :mentorship_cycle
7
+ col :title
8
+
9
+ col :mentorship_group_users, search: :string do |mentorship_group|
10
+ mentorship_group.mentorship_group_users.map do |mentorship_group_user|
11
+ user = mentorship_group_user.user
12
+
13
+ content_tag(:div, class: 'col-resource_item') do
14
+ mentorship_role_badge(mentorship_group_user.mentorship_role) + ' ' + link_to(user, "mailto:#{user.try(:public_email).presence || user.email}")
15
+ end
16
+ end.join.html_safe
17
+ end
18
+
19
+ actions_col
20
+ end
21
+
22
+ collection do
23
+ EffectiveMentorships.MentorshipGroup.deep.unarchived.where(id: current_user.mentorship_groups)
24
+ end
25
+ end
@@ -0,0 +1,25 @@
1
+ # Dashboard - the cycles we have registered for but aren't in a group for yet
2
+ class EffectiveMentorshipsRegistrationsDatatable < Effective::Datatable
3
+ datatable do
4
+ col :mentorship_cycle
5
+
6
+ col :available, label: "Schedule" do |mentorship_registration|
7
+ mentorship_registration.mentorship_cycle.available_date
8
+ end
9
+
10
+ col :opt_in
11
+ col :mentorship_role do |mentorship_registration|
12
+ if mentorship_registration.opt_in?
13
+ badge(mentorship_registration.mentorship_role)
14
+ else
15
+ '-'
16
+ end
17
+ end
18
+
19
+ actions_col
20
+ end
21
+
22
+ collection do
23
+ current_user.mentorship_registrations_without_groups
24
+ end
25
+ end
@@ -4,6 +4,38 @@ module EffectiveMentorshipsHelper
4
4
  et('effective_mentorships.name')
5
5
  end
6
6
 
7
+ def mentorship_cycle_label
8
+ et(Effective::MentorshipCycle)
9
+ end
10
+
11
+ def mentorship_cycles_label
12
+ ets(Effective::MentorshipCycle)
13
+ end
14
+
15
+ def mentorship_registration_label
16
+ et(EffectiveMentorships.MentorshipRegistration)
17
+ end
18
+
19
+ def mentorship_registrations_label
20
+ ets(EffectiveMentorships.MentorshipRegistration)
21
+ end
22
+
23
+ def mentorship_group_label
24
+ et(EffectiveMentorships.MentorshipGroup)
25
+ end
26
+
27
+ def mentorship_groups_label
28
+ ets(EffectiveMentorships.MentorshipGroup)
29
+ end
30
+
31
+ def mentorship_group_user_label
32
+ ets(Effective::MentorshipGroupUser)
33
+ end
34
+
35
+ def mentorship_group_users_label
36
+ ets(Effective::MentorshipGroupUser)
37
+ end
38
+
7
39
  def mentorships_mentee_label
8
40
  et('effective_mentorships.mentee')
9
41
  end
@@ -20,20 +52,25 @@ module EffectiveMentorshipsHelper
20
52
  ets('effective_mentorships.mentor')
21
53
  end
22
54
 
23
- def mentorship_cycle_label
24
- et(Effective::MentorshipCycle)
55
+ def mentorship_roles_collection
56
+ EffectiveMentorships.MentorshipRegistration.mentorship_roles.map { |role| [mentorship_role_label(role), role] }
25
57
  end
26
58
 
27
- def mentorship_cycles_label
28
- ets(Effective::MentorshipCycle)
59
+ def mentorship_categories_collection
60
+ EffectiveMentorships.MentorshipRegistration.mentorship_categories
29
61
  end
30
62
 
31
- def mentorship_group_label
32
- et(EffectiveMentorships.MentorshipGroup)
63
+ def mentorship_role_label(role)
64
+ case role.to_s
65
+ when 'mentor' then et('effective_mentorships.mentor')
66
+ when 'mentee' then et('effective_mentorships.mentee')
67
+ else
68
+ raise("unexpected mentorship role: #{role}")
69
+ end
33
70
  end
34
71
 
35
- def mentorship_groups_label
36
- ets(EffectiveMentorships.MentorshipGroup)
72
+ def mentorship_role_badge(mentorship_role)
73
+ badge(mentorship_role_label(mentorship_role))
37
74
  end
38
75
 
39
76
  end
@@ -18,29 +18,33 @@ module EffectiveMentorshipsGroup
18
18
  end
19
19
 
20
20
  included do
21
- log_changes if respond_to?(:log_changes)
22
21
  acts_as_archived
23
22
  acts_as_tokened
24
23
 
25
- # rich_text_body
24
+ log_changes if respond_to?(:log_changes)
25
+
26
26
  has_many_rich_texts
27
+ # rich_text_admin_notes
27
28
 
28
29
  # Effective Scoped
29
30
  belongs_to :mentorship_cycle, class_name: 'Effective::MentorshipCycle', counter_cache: true
30
31
 
31
- # App Scoped
32
- belongs_to :user
32
+ has_many :mentorship_group_users, class_name: 'Effective::MentorshipGroupUser', dependent: :delete_all
33
+ accepts_nested_attributes_for :mentorship_group_users, allow_destroy: true
33
34
 
34
35
  effective_resource do
35
- archived :boolean
36
+ title :string
36
37
 
38
+ archived :boolean
37
39
  token :string
38
40
 
39
41
  timestamps
40
42
  end
41
43
 
42
- scope :deep, -> { includes(:rich_texts) }
44
+ scope :deep, -> { includes(:mentorship_cycle, :rich_texts, mentorship_group_users: [:user]) }
43
45
  scope :sorted, -> { order(:id) }
46
+
47
+ validates :title, presence: true, uniqueness: true
44
48
  end
45
49
 
46
50
  # Instance Methods
@@ -48,4 +52,8 @@ module EffectiveMentorshipsGroup
48
52
  model_name.human
49
53
  end
50
54
 
55
+ def mentorship_group_user(user:)
56
+ mentorship_group_users.find { |mgu| mgu.user == user }
57
+ end
58
+
51
59
  end
@@ -17,7 +17,19 @@ module EffectiveMentorshipsRegistration
17
17
  def effective_mentorships_registration?; true; end
18
18
 
19
19
  def mentorship_roles
20
- ['A Mentor', 'A Protege', 'Both']
20
+ [:mentor, :mentee]
21
+ end
22
+
23
+ def categories
24
+ ['General', 'Industry Specific']
25
+ end
26
+
27
+ def locations
28
+ ['Canada', 'United States']
29
+ end
30
+
31
+ def venues
32
+ ['virtual', 'in person', 'either']
21
33
  end
22
34
  end
23
35
 
@@ -25,34 +37,78 @@ module EffectiveMentorshipsRegistration
25
37
  log_changes if respond_to?(:log_changes)
26
38
  acts_as_tokened
27
39
 
28
- # rich_text_body
29
40
  has_many_rich_texts
41
+ # rich_text_comments
30
42
 
31
43
  # Effective Scoped
32
44
  belongs_to :mentorship_cycle, class_name: 'Effective::MentorshipCycle', counter_cache: true
33
45
 
34
46
  # App Scoped
35
47
  belongs_to :user
48
+ belongs_to :parent, polymorphic: true, optional: true # A FeePayment if this was done through a fee payment
36
49
 
37
50
  effective_resource do
38
- # Preferences
39
- mentorship_role :string
51
+ title :string # Auto generated
40
52
 
41
- token :string
53
+ # Registration
54
+ opt_in :boolean # Opt in to this mentorship cycle
55
+ accept_declaration :boolean
56
+ mentorship_role :string
57
+
58
+ # Pairing info
59
+ category :string # Professional category interests
60
+ venue :string # Preferred venue virtual or in person
61
+ location :string # Closest city of residence
62
+
63
+ # Mentor only fields
64
+ mentor_multiple_mentees :boolean
65
+ mentor_multiple_mentees_limit :integer
42
66
 
67
+ # Mentee only fields
68
+ # None
69
+
70
+ token :string
43
71
  timestamps
44
72
  end
45
73
 
74
+ # Always assign title
75
+ before_validation do
76
+ self.title = [user, (opt_in ? mentorship_role : 'Opt Out')].compact.join(' - ')
77
+ end
78
+
79
+ with_options(if: -> { opt_in? }) do
80
+ validates :mentorship_role, presence: true
81
+ validates :category, presence: true
82
+ validates :venue, presence: true
83
+ validates :location, presence: true
84
+ validates :accept_declaration, acceptance: true
85
+ end
86
+
87
+ validates :mentor_multiple_mentees_limit, numericality: { greater_than: 0 }, if: -> { opt_in? && mentor_multiple_mentees? }
88
+
46
89
  scope :deep, -> { includes(:rich_texts, :user, :mentorship_cycle) }
47
90
  scope :sorted, -> { order(:id) }
48
91
 
92
+ scope :mentors, -> { where(mentorship_role: :mentor) }
93
+ scope :mentees, -> { where(mentorship_role: :mentee) }
94
+ scope :opt_in, -> { where(opt_in: true) }
95
+ scope :opt_out, -> { where(opt_in: false) }
96
+
49
97
  # User
50
98
  validates :user_id, uniqueness: { scope: [:mentorship_cycle_id] }
51
- validates :mentorship_role, presence: true, inclusion: { in: mentorship_roles }
52
99
  end
53
100
 
54
101
  # Instance Methods
55
102
  def to_s
56
- mentorship_role.presence || model_name.human
103
+ title.presence || model_name.human
57
104
  end
105
+
106
+ def mentor?
107
+ mentorship_role == 'mentor'
108
+ end
109
+
110
+ def mentee?
111
+ mentorship_role == 'mentee'
112
+ end
113
+
58
114
  end
@@ -17,37 +17,50 @@ module EffectiveMentorshipsUser
17
17
  end
18
18
 
19
19
  included do
20
- # App Scoped
21
- has_many :mentorship_groups, -> { order(:mentorship_cycle_id) }, inverse_of: :user, dependent: :destroy
22
- accepts_nested_attributes_for :mentorship_groups, allow_destroy: true
20
+ # Effective Scoped
21
+ has_many :mentorship_group_users, -> { order(:mentorship_cycle_id).order(:id) }, class_name: 'Effective::MentorshipGroupUser', inverse_of: :user, dependent: :destroy
23
22
 
24
- has_many :mentorship_registrations, -> { order(:mentorship_cycle_id) }, inverse_of: :user, dependent: :destroy
23
+ # App Scoped
24
+ has_many :mentorship_registrations, -> { order(:mentorship_cycle_id).order(:id) }, inverse_of: :user, dependent: :destroy
25
25
  accepts_nested_attributes_for :mentorship_registrations, allow_destroy: true
26
26
 
27
+ has_many :mentorship_groups, through: :mentorship_group_users
28
+
27
29
  scope :deep_effective_mentorships_user, -> { all }
28
30
  end
29
31
 
32
+ # Used for the dashboard datatables. Which cycles can we register for?
33
+ def registrable_mentorship_cycles
34
+ Effective::MentorshipCycle.registrable
35
+ .where.not(id: mentorship_group_users.select(:mentorship_cycle_id))
36
+ .where.not(id: mentorship_registrations.select(:mentorship_cycle_id))
37
+ end
38
+
39
+ def mentorship_registrations_without_groups
40
+ mentorship_registrations.where.not(mentorship_cycle_id: mentorship_group_users.select(:mentorship_cycle_id))
41
+ end
42
+
30
43
  # Find
31
44
  def mentorship_group(mentorship_cycle:)
32
- raise('expected an MentorshipCycle') unless mentorship_cycle.class.respond_to?(:effective_mentorships_mentorship_cycle?)
45
+ raise('expected an MentorshipCycle') unless mentorship_cycle.class.respond_to?(:effective_mentorships_cycle?)
33
46
  mentorship_groups.find { |mentorship_group| mentorship_group.mentorship_cycle_id == mentorship_cycle.id }
34
47
  end
35
48
 
36
49
  # Find or build
37
50
  def build_mentorship_group(mentorship_cycle:)
38
- raise('expected an MentorshipCycle') unless mentorship_cycle.class.respond_to?(:effective_mentorships_mentorship_cycle?)
51
+ raise('expected an MentorshipCycle') unless mentorship_cycle.class.respond_to?(:effective_mentorships_cycle?)
39
52
  mentorship_group(mentorship_cycle: mentorship_cycle) || mentorship_groups.build(mentorship_cycle: mentorship_cycle)
40
53
  end
41
54
 
42
55
  # Find
43
56
  def mentorship_registration(mentorship_cycle:)
44
- raise('expected an MentorshipCycle') unless mentorship_cycle.class.respond_to?(:effective_mentorships_mentorship_cycle?)
57
+ raise('expected an MentorshipCycle') unless mentorship_cycle.class.respond_to?(:effective_mentorships_cycle?)
45
58
  mentorship_registrations.find { |mentorship_registration| mentorship_registration.mentorship_cycle_id == mentorship_cycle.id }
46
59
  end
47
60
 
48
61
  # Find or build
49
62
  def build_mentorship_registration(mentorship_cycle:)
50
- raise('expected an MentorshipCycle') unless mentorship_cycle.class.respond_to?(:effective_mentorships_mentorship_cycle?)
63
+ raise('expected an MentorshipCycle') unless mentorship_cycle.class.respond_to?(:effective_mentorships_cycle?)
51
64
  mentorship_registration(mentorship_cycle: mentorship_cycle) || mentorship_registrations.build(mentorship_cycle: mentorship_cycle)
52
65
  end
53
66
 
@@ -1,12 +1,13 @@
1
1
  module Effective
2
2
  class MentorshipCycle < ActiveRecord::Base
3
3
  has_many_rich_texts
4
+ # rich_text_registration_content
5
+ # rich_text_group_content
4
6
 
5
7
  has_many :mentorship_groups
8
+ has_many :mentorship_registrations
6
9
 
7
- if respond_to?(:log_changes)
8
- log_changes(except: [:mentorship_groups])
9
- end
10
+ log_changes(except: [:mentorship_groups, :mentorship_registrations]) if respond_to?(:log_changes)
10
11
 
11
12
  effective_resource do
12
13
  title :string # 2021 Mentorship Program
@@ -21,6 +22,9 @@ module Effective
21
22
  max_pairings_mentor :integer
22
23
  max_pairings_mentee :integer
23
24
 
25
+ mentorship_groups_count :integer
26
+ mentorship_registrations_count :integer
27
+
24
28
  timestamps
25
29
  end
26
30
 
@@ -30,10 +34,12 @@ module Effective
30
34
  scope :sorted, -> { order(:id) }
31
35
 
32
36
  scope :upcoming, -> { where('start_at > ?', Time.zone.now) }
37
+ scope :past, -> { where('end_at < ?', Time.zone.now) }
38
+
33
39
  scope :available, -> { where('start_at <= ? AND (end_at > ? OR end_at IS NULL)', Time.zone.now, Time.zone.now) }
34
- scope :completed, -> { where('end_at < ?', Time.zone.now) }
40
+ scope :registrable, -> { where('registration_start_at <= ? AND (registration_end_at > ? OR registration_end_at IS NULL)', Time.zone.now, Time.zone.now) }
35
41
 
36
- validates :title, presence: true
42
+ validates :title, presence: true, uniqueness: true
37
43
  validates :start_at, presence: true
38
44
 
39
45
  validate(if: -> { start_at.present? && end_at.present? }) do
@@ -44,18 +50,17 @@ module Effective
44
50
  errors.add(:registration_end_at, 'must be after the registration start date') unless registration_end_at > registration_start_at
45
51
  end
46
52
 
47
- # before_destroy do
48
- # if (count = mentorship_groups.length) > 0
49
- # raise("#{count} groups belong to this cycle")
50
- # end
51
- # end
53
+ before_destroy do
54
+ raise("cannot destroy mentorship cycle with mentorship groups") if mentorship_groups.length > 0
55
+ raise("cannot destroy mentorship cycle with mentorship registrations") if mentorship_registrations.length > 0
56
+ end
52
57
 
53
- def self.effective_mentorships_mentorship_cycle?
58
+ def self.effective_mentorships_cycle?
54
59
  true
55
60
  end
56
61
 
57
62
  def self.latest_cycle
58
- order(id: :desc).first
63
+ order(start_at: :desc).first
59
64
  end
60
65
 
61
66
  def to_s
@@ -64,41 +69,60 @@ module Effective
64
69
 
65
70
  # Returns a duplicated event object, or throws an exception
66
71
  def duplicate
67
- MentorshipCycle.new(attributes.except('id', 'updated_at', 'created_at', 'token')).tap do |mentorship|
68
- mentorship.start_at = mentorship.start_at.advance(years: 1) if mentorship.start_at.present?
69
- mentorship.end_at = mentorship.end_at.advance(years: 1) if mentorship.end_at.present?
70
- mentorship.registration_start_at = mentorship.registration_start_at.advance(years: 1) if mentorship.registration_start_at.present?
71
- mentorship.registration_end_at = mentorship.registration_end_at.advance(years: 1) if mentorship.registration_end_at.present?
72
+ MentorshipCycle.new(attributes.except('id', 'updated_at', 'created_at', 'token')).tap do |resource|
73
+ # Duplicate mentorship cycle
74
+ resource.title = title + ' (Copy)'
75
+
76
+ # Duplicate all date fields and move them ahead 1-year
77
+ resource.start_at = start_at&.advance(years: 1)
78
+ resource.end_at = end_at&.advance(years: 1)
79
+ resource.registration_start_at = registration_start_at&.advance(years: 1)
80
+ resource.registration_end_at = registration_end_at&.advance(years: 1)
81
+
82
+ # Duplicate all rich texts
83
+ rich_texts.each { |rt| resource.send("rich_text_#{rt.name}=", rt.body) }
84
+ end
85
+ end
72
86
 
73
- mentorship.title = mentorship.title + ' (Copy)'
87
+ def available?
88
+ started? && !ended?
89
+ end
74
90
 
75
- mentorship.rich_texts.each { |rt| self.send("rich_text_#{rt.name}=", rt.body) }
76
- end
91
+ def started?
92
+ start_at.present? && Time.zone.now >= start_at
77
93
  end
78
94
 
79
- # def available?
80
- # started? && !ended?
81
- # end
95
+ def ended?
96
+ end_at.present? && end_at < Time.zone.now
97
+ end
82
98
 
83
- # def unavailable?
84
- # !available?
85
- # end
99
+ def registrable?
100
+ registration_started? && !registration_ended?
101
+ end
102
+
103
+ def registration_started?
104
+ registration_start_at.present? && Time.zone.now >= registration_start_at
105
+ end
86
106
 
87
- # def started?
88
- # start_at.present? && Time.zone.now >= start_at
89
- # end
107
+ def registration_ended?
108
+ registration_end_at.present? && registration_end_at < Time.zone.now
109
+ end
90
110
 
91
- # def ended?
92
- # end_at.present? && end_at < Time.zone.now
93
- # end
111
+ def available_date
112
+ if start_at && end_at
113
+ "#{start_at.strftime('%F')} to #{end_at.strftime('%F')}"
114
+ elsif start_at
115
+ "#{start_at.strftime('%F')}"
116
+ end
117
+ end
94
118
 
95
- # def available_date
96
- # if start_at && end_at
97
- # "#{start_at.strftime('%F')} to #{end_at.strftime('%F')}"
98
- # elsif start_at
99
- # "#{start_at.strftime('%F')}"
100
- # end
101
- # end
119
+ def registrable_date
120
+ if registration_start_at && registration_end_at
121
+ "#{registration_start_at.strftime('%F')} to #{registration_end_at.strftime('%F')}"
122
+ elsif registration_start_at
123
+ "#{registration_start_at.strftime('%F')}"
124
+ end
125
+ end
102
126
 
103
127
  end
104
128
  end
@@ -0,0 +1,43 @@
1
+ module Effective
2
+ class MentorshipGroupUser < ActiveRecord::Base
3
+ # Effective scoped
4
+ belongs_to :mentorship_cycle, class_name: 'Effective::MentorshipCycle'
5
+
6
+ # App scoped
7
+ belongs_to :mentorship_group
8
+ belongs_to :user, polymorphic: true
9
+
10
+ effective_resource do
11
+ mentorship_role :string
12
+
13
+ # Copied from user
14
+ name :string
15
+ email :string
16
+
17
+ position :integer
18
+
19
+ timestamps
20
+ end
21
+
22
+ scope :deep, -> { includes(:mentorship_cycle, :mentorship_group, :user) }
23
+ scope :sorted, -> { order(:mentorship_cycle_id).order(:position) }
24
+
25
+ # Assign position and cycle
26
+ before_validation(if: -> { mentorship_group.present? }) do
27
+ self.position ||= (mentorship_group.mentorship_group_users.map(&:position).compact.max || -1) + 1
28
+ self.mentorship_cycle = mentorship_group.mentorship_cycle
29
+ end
30
+
31
+ # Denormalized data for searching
32
+ before_validation(if: -> { user.present? }) do
33
+ assign_attributes(name: user.to_s, email: user.email)
34
+ end
35
+
36
+ validates :user_id, uniqueness: { scope: [:mentorship_group_id] }
37
+
38
+ def to_s
39
+ user.to_s.presence || model_name.human
40
+ end
41
+
42
+ end
43
+ end
@@ -17,12 +17,25 @@
17
17
 
18
18
  %hr
19
19
 
20
+ %h2 #{mentorship_registration_label}
21
+ %p The online #{mentorship_registration_label.downcase} opt-in will be available between:
22
+
20
23
  .row
21
- .col-md-6
22
- %h2 Registration Opt-In
23
- %p The online registration opt-in will be available between:
24
- = f.datetime_field :registration_start_at, label: "Registration start", hint: "The first day that #{mentorships_mentors_label} and #{mentorships_mentees_label} can register for this #{mentorship_cycle_label}"
25
- = f.datetime_field :registration_end_at, label: "Registration end", hint: "The last day that #{mentorships_mentors_label} and #{mentorships_mentees_label} can register for this #{mentorship_cycle_label}"
24
+ .col-md-6= f.datetime_field :registration_start_at, label: "Registration start", hint: "The first day that #{mentorships_mentors_label} and #{mentorships_mentees_label} can register for this #{mentorship_cycle_label}"
25
+ .col-md-6= f.datetime_field :registration_end_at, label: "Registration end", hint: "The last day that #{mentorships_mentors_label} and #{mentorships_mentees_label} can register for this #{mentorship_cycle_label}"
26
+
27
+ %h2 Content
28
+
29
+ - if defined?(EffectiveArticleEditor)
30
+ = f.article_editor :rich_text_registration_content, label: "#{mentorship_registration_label} opt-in content", hint: "Will be displayed to the user when registering for this #{mentorship_cycle_label.downcase}"
31
+ - else
32
+ = f.rich_text_area :rich_text_registration_content, label: "#{mentorship_registration_label} opt-in content", hint: "Will be displayed to the user when registering for this #{mentorship_cycle_label.downcase}"
33
+
34
+ - if defined?(EffectiveArticleEditor)
35
+ = f.article_editor :rich_text_group_content, label: "#{mentorship_group_label} content", hint: "Will be displayed to the user when viewing their #{mentorship_group_label.downcase} for this #{mentorship_cycle_label.downcase}"
36
+ - else
37
+ = f.rich_text_area :rich_text_group_content, label: "#{mentorship_group_label} opt-in content", hint: "Will be displayed to the user when viewing their #{mentorship_group_label.downcase} for this #{mentorship_cycle_label.downcase}"
38
+
26
39
 
27
40
  = f.submit do
28
41
  = f.save 'Save'
@@ -0,0 +1,12 @@
1
+ = effective_form_with(model: [:admin, mentorship_group_user], engine: true) do |f|
2
+ = f.select :mentorship_cycle_id, Effective::MentorshipCycle.sorted.all
3
+ = f.select :mentorship_group_id, EffectiveMentorships.MentorshipGroup.sorted.all
4
+
5
+ = f.select :mentorship_role, mentorship_roles_collection(), required: true, inline: true
6
+
7
+ = f.hidden_field :user_type, value: current_user.class.name
8
+
9
+ - ajax_url = (effective_resources.users_effective_ajax_index_path) unless Rails.env.test?
10
+ = f.select :user_id, current_user.class.all, ajax_url: ajax_url
11
+
12
+ = effective_submit(f)
@@ -0,0 +1,8 @@
1
+ = tabs do
2
+ = tab(EffectiveResources.et(mentorship_group.class)) do
3
+ = render '/admin/mentorship_groups/form_mentorship_group', mentorship_group: mentorship_group
4
+
5
+ - if mentorship_group.persisted?
6
+ - if mentorship_group.respond_to?(:logs_datatable)
7
+ = tab 'Logs' do
8
+ = render_datatable(mentorship_group.logs_datatable, inline: true)
@@ -0,0 +1,27 @@
1
+ = effective_form_with(model: [:admin, mentorship_group], engine: true) do |f|
2
+ = f.select :mentorship_cycle_id, Effective::MentorshipCycle.sorted.all
3
+ = f.text_field :title
4
+
5
+ - if defined?(EffectiveArticleEditor)
6
+ = f.article_editor :rich_text_admin_notes, label: "Admin Notes"
7
+ - else
8
+ = f.rich_text_area :rich_text_admin_notes, label: "Admin Notes"
9
+
10
+ = f.check_box :archived, label: "Yes, this #{mentorship_group_label} is archived"
11
+
12
+ %hr
13
+
14
+ %h4= mentorship_group_users_label
15
+ - ajax_url = (effective_resources.users_effective_ajax_index_path) unless Rails.env.test?
16
+
17
+ = f.has_many :mentorship_group_users do |fu|
18
+ = card do
19
+ .row
20
+ .col-md-3
21
+ = fu.select :mentorship_role, mentorship_roles_collection(), required: true, label: false
22
+
23
+ .col-md-9
24
+ = fu.hidden_field :user_type, value: current_user.class.name
25
+ = fu.select :user_id, current_user.class.all, label: false, ajax_url: ajax_url
26
+
27
+ = effective_submit(f)
@@ -0,0 +1,8 @@
1
+ = tabs do
2
+ = tab(et(mentorship_registration)) do
3
+ = render '/admin/mentorship_registrations/form_mentorship_registration', mentorship_registration: mentorship_registration
4
+
5
+ - if mentorship_registration.persisted?
6
+ - if mentorship_registration.respond_to?(:logs_datatable)
7
+ = tab 'Logs' do
8
+ = render_datatable(mentorship_registration.logs_datatable, inline: true)
@@ -0,0 +1,14 @@
1
+ = effective_form_with(model: [:admin, mentorship_registration], engine: true) do |f|
2
+ - # Admin only fields
3
+ = f.select :mentorship_cycle_id, Effective::MentorshipCycle.sorted.all
4
+
5
+ - if inline_datatable?
6
+ = f.hidden_field :user_id
7
+ - else
8
+ - ajax_url = (effective_resources.users_effective_ajax_index_path) unless Rails.env.test?
9
+ = f.select :user_id, current_user.class.all, label: 'User', ajax_url: ajax_url
10
+
11
+ - # Same fields user sees
12
+ = render('effective/mentorship_registrations/fields', f: f, namespace: :admin)
13
+
14
+ = effective_submit(f)
@@ -0,0 +1,21 @@
1
+ - mentorship_cycle = mentorship_group.mentorship_cycle
2
+ - raise('expected a mentorship cycle') unless mentorship_cycle.present?
3
+
4
+ - if mentorship_cycle.rich_text_group_content.present?
5
+ .mt-4= mentorship_cycle.rich_text_group_content
6
+
7
+ = effective_table_with(mentorship_group) do |f|
8
+ = f.static_field :mentorship_cycle
9
+ = f.static_field :title
10
+
11
+ %h3= mentorship_group_users_label
12
+
13
+ %table.table.table-sm
14
+ %tbody
15
+ - mentorship_group.mentorship_group_users.each do |mentorship_group_user|
16
+ - user = mentorship_group_user.user
17
+
18
+ %tr
19
+ %td= mentorship_role_badge(mentorship_group_user.mentorship_role)
20
+ %td= user
21
+ %td= mail_to(user.email)
@@ -0,0 +1,24 @@
1
+ - unless local_assigns[:namespace] == :admin
2
+ = f.hidden_field :mentorship_cycle_id
3
+
4
+ = f.radios :opt_in, :boolean, label: "Do you wish to register in the #{f.object.mentorship_cycle || et('effective_mentorships.name')}?", inline: true
5
+
6
+ = f.hide_if(:opt_in, false) do
7
+ = f.radios :mentorship_role, mentorship_roles_collection(), label: "Register as", required: true, inline: true
8
+
9
+ = f.show_if(:mentorship_role, 'mentor') do
10
+ = card(mentorships_mentor_label) do
11
+ = f.radios :mentor_multiple_mentees, :boolean, label: "Are you willing to #{mentorships_mentor_label.downcase} more than one #{mentorships_mentee_label.downcase}?", required: true, inline: true
12
+ = f.number_field :mentor_multiple_mentees_limit, label: "Please indicate how many #{mentorships_mentee_label.downcase.pluralize} you could accommodate", required: true
13
+
14
+ = f.select :category, f.object.class.categories(), required: true
15
+ = f.select :location, f.object.class.locations(), required: true
16
+ = f.radios :venue, f.object.class.venues(), required: true, inline: true
17
+
18
+ = f.check_box :accept_declaration, label: "Yes, I accept the #{et('effective_mentorships.name')} agreement", required: true
19
+
20
+ - if defined?(EffectiveArticleEditor)
21
+ = f.article_editor :rich_text_comments, label: "Comments"
22
+ - else
23
+ = f.rich_text_area :rich_text_comments, label: "Comments"
24
+
@@ -0,0 +1,15 @@
1
+ - mentorship_cycle = mentorship_registration.mentorship_cycle
2
+ - raise('expected a mentorship cycle') unless mentorship_cycle.present?
3
+
4
+ - url = (mentorship_registration.persisted? ? effective_mentorships.mentorship_cycle_mentorship_registration_path(mentorship_cycle, mentorship_registration) : effective_mentorships.mentorship_cycle_mentorship_registrations_path(mentorship_cycle, mentorship_registration))
5
+
6
+ = card do
7
+ %h2= et('effective_mentorships.name')
8
+
9
+ - if mentorship_cycle.rich_text_registration_content.present?
10
+ .mt-4= mentorship_cycle.rich_text_registration_content
11
+
12
+ = effective_form_with(model: mentorship_registration, url: url) do |f|
13
+ = f.hidden_field :user_id, value: current_user.id
14
+ = render('effective/mentorship_registrations/fields', f: f)
15
+ = f.submit
@@ -0,0 +1,6 @@
1
+ - if mentorship_registration.present?
2
+ - mentorship_cycle = mentorship_registration.mentorship_cycle
3
+ - raise('expected a mentorship cycle') unless mentorship_cycle.present?
4
+
5
+ = effective_table_with(mentorship_registration) do |f|
6
+ = render('effective/mentorship_registrations/fields', f: f)
@@ -1 +1,27 @@
1
1
  %h2 #{mentorships_name_label}
2
+
3
+ - # My Groups
4
+ - groups = EffectiveResources.best('EffectiveMentorshipsGroupsDatatable').new(self, namespace: :effective)
5
+
6
+ - if groups.present?
7
+ %p You are a member of the following #{mentorship_groups_label.downcase}:
8
+ = render_datatable(groups, simple: true)
9
+ - else
10
+ %p You are not a member of any #{mentorship_groups_label.downcase}. When you are, we'll show them here.
11
+
12
+ %hr
13
+
14
+ -# Available Registrations
15
+ - registered = EffectiveResources.best('EffectiveMentorshipsRegistrationsDatatable').new(self, namespace: :effective)
16
+ - available = EffectiveResources.best('EffectiveMentorshipsAvailableCyclesDatatable').new(self, namespace: :effective)
17
+
18
+ - if registered.present?
19
+ %p You have registered for the following #{etsd(Effective::MentorshipCycle)}:
20
+ = render_datatable(registered, simple: true)
21
+
22
+ - if available.present?
23
+ %p You can register for the following #{etsd(Effective::MentorshipCycle)}:
24
+ = render_datatable(available, simple: true)
25
+
26
+ - if available.blank? && registered.blank?
27
+ %p There are no #{'additional ' if groups.present? || registered.present?}#{etsd(Effective::MentorshipCycle)} available for registration. When there are, we'll show them here.
@@ -8,8 +8,9 @@ en:
8
8
  activerecord:
9
9
  models:
10
10
  # Application namespace
11
- mentorship_group: 'Mentorship Group'
12
- mentorship_registration: 'Mentorship Registration'
11
+ app/mentorship_group: 'Mentorship group'
12
+ app/mentorship_registration: 'Mentorship registration'
13
13
 
14
14
  # Effective namespace
15
- effective/mentorship_cycle: 'Mentorship Cycle'
15
+ effective/mentorship_cycle: 'Mentorship cycle'
16
+ effective/mentorship_group_user: 'Mentorship group user'
data/config/routes.rb CHANGED
@@ -4,9 +4,24 @@ end
4
4
 
5
5
  EffectiveMentorships::Engine.routes.draw do
6
6
  scope module: 'effective' do
7
+ resources :mentorship_cycles, only: [] do
8
+ resources :mentorship_registrations, except: [:index, :show]
9
+ end
10
+
11
+ resources :mentorship_groups, only: [:show]
7
12
  end
8
13
 
9
14
  namespace :admin do
10
15
  resources :mentorship_cycles, except: [:show]
16
+ resources :mentorship_registrations, except: [:show]
17
+
18
+ resources :mentorship_groups, except: [:show] do
19
+ post :archive, on: :member
20
+ post :unarchive, on: :member
21
+ post :bulk_archive, on: :collection
22
+ post :bulk_unarchive, on: :collection
23
+ end
24
+
25
+ resources :mentorship_group_users, except: [:show]
11
26
  end
12
27
  end
@@ -21,21 +21,56 @@ class CreateEffectiveMentorships < ActiveRecord::Migration[6.0]
21
21
 
22
22
  create_table :mentorship_groups do |t|
23
23
  t.integer :mentorship_cycle_id
24
- t.integer :user_id
24
+
25
+ t.string :title
25
26
 
26
27
  t.boolean :archived, default: false
28
+
27
29
  t.string :token
28
30
 
29
31
  t.datetime :updated_at
30
32
  t.datetime :created_at
31
33
  end
32
34
 
35
+ create_table :mentorship_group_users do |t|
36
+ t.integer :mentorship_cycle_id
37
+ t.integer :mentorship_group_id
38
+
39
+ t.string :user_type
40
+ t.integer :user_id
41
+
42
+ t.string :mentorship_role
43
+
44
+ t.string :name
45
+ t.string :email
46
+
47
+ t.integer :position
48
+
49
+ t.datetime :updated_at
50
+ t.datetime :created_at
51
+ end
52
+
33
53
  create_table :mentorship_registrations do |t|
34
54
  t.integer :mentorship_cycle_id
35
55
  t.integer :user_id
36
56
 
57
+ t.string :parent_type
58
+ t.integer :parent_id
59
+
60
+ t.string :title
61
+
62
+ t.boolean :opt_in
63
+ t.boolean :accept_declaration, default: false
64
+
37
65
  t.string :mentorship_role
38
66
 
67
+ t.string :category
68
+ t.string :venue
69
+ t.string :location
70
+
71
+ t.boolean :mentor_multiple_mentees
72
+ t.integer :mentor_multiple_mentees_limit
73
+
39
74
  t.string :token
40
75
 
41
76
  t.datetime :updated_at
@@ -1,3 +1,3 @@
1
1
  module EffectiveMentorships
2
- VERSION = '0.0.1'
2
+ VERSION = '0.1.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_mentorships
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
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: 2024-11-14 00:00:00.000000000 Z
11
+ date: 2024-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -206,8 +206,18 @@ files:
206
206
  - app/assets/javascripts/effective_mentorships.js
207
207
  - app/assets/stylesheets/effective_mentorships.scss
208
208
  - app/controllers/admin/mentorship_cycles_controller.rb
209
- - app/controllers/effective/mentorship_cycles_controller.rb
209
+ - app/controllers/admin/mentorship_group_users_controller.rb
210
+ - app/controllers/admin/mentorship_groups_controller.rb
211
+ - app/controllers/admin/mentorship_registrations_controller.rb
212
+ - app/controllers/effective/mentorship_groups_controller.rb
213
+ - app/controllers/effective/mentorship_registrations_controller.rb
210
214
  - app/datatables/admin/effective_mentorship_cycles_datatable.rb
215
+ - app/datatables/admin/effective_mentorship_group_users_datatable.rb
216
+ - app/datatables/admin/effective_mentorship_groups_datatable.rb
217
+ - app/datatables/admin/effective_mentorship_registrations_datatable.rb
218
+ - app/datatables/effective_mentorships_available_cycles_datatable.rb
219
+ - app/datatables/effective_mentorships_groups_datatable.rb
220
+ - app/datatables/effective_mentorships_registrations_datatable.rb
211
221
  - app/helpers/effective_mentorships_helper.rb
212
222
  - app/mailers/effective/mentorships_mailer.rb
213
223
  - app/models/concerns/effective_mentorships_group.rb
@@ -215,9 +225,19 @@ files:
215
225
  - app/models/concerns/effective_mentorships_user.rb
216
226
  - app/models/effective/mentorship_cycle.rb
217
227
  - app/models/effective/mentorship_group.rb
228
+ - app/models/effective/mentorship_group_user.rb
218
229
  - app/models/effective/mentorship_registration.rb
219
230
  - app/views/admin/mentorship_cycles/_form.html.haml
220
231
  - app/views/admin/mentorship_cycles/_form_mentorship_cycle.html.haml
232
+ - app/views/admin/mentorship_group_users/_form.html.haml
233
+ - app/views/admin/mentorship_groups/_form.html.haml
234
+ - app/views/admin/mentorship_groups/_form_mentorship_group.html.haml
235
+ - app/views/admin/mentorship_registrations/_form.html.haml
236
+ - app/views/admin/mentorship_registrations/_form_mentorship_registration.html.haml
237
+ - app/views/effective/mentorship_groups/_mentorship_group.html.haml
238
+ - app/views/effective/mentorship_registrations/_fields.html.haml
239
+ - app/views/effective/mentorship_registrations/_form.html.haml
240
+ - app/views/effective/mentorship_registrations/_mentorship_registration.html.haml
221
241
  - app/views/effective/mentorships/_dashboard.html.haml
222
242
  - app/views/effective/mentorships_mailer/README.md
223
243
  - config/effective_mentorships.rb
@@ -1,9 +0,0 @@
1
- module Effective
2
- class MentorshipCyclesController < ApplicationController
3
- before_action(:authenticate_user!) if defined?(Devise)
4
-
5
- include Effective::CrudController
6
-
7
- resource_scope -> { Effective::MentorshipCycle.deep.all }
8
- end
9
- end