effective_mentorships 0.2.4 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/admin/mentorship_bulk_groups_controller.rb +19 -0
- data/app/datatables/admin/effective_mentorship_bulk_group_mentees_datatable.rb +65 -0
- data/app/datatables/admin/effective_mentorship_bulk_group_mentors_datatable.rb +66 -0
- data/app/datatables/admin/effective_mentorship_bulk_groups_datatable.rb +32 -0
- data/app/datatables/admin/effective_mentorship_cycles_datatable.rb +0 -1
- data/app/datatables/admin/effective_mentorship_groups_datatable.rb +59 -7
- data/app/datatables/admin/effective_mentorship_registrations_datatable.rb +18 -3
- data/app/datatables/effective_mentorships_available_cycles_datatable.rb +1 -1
- data/app/datatables/effective_mentorships_groups_datatable.rb +1 -1
- data/app/datatables/effective_mentorships_registrations_datatable.rb +1 -0
- data/app/jobs/effective/mentorships_bulk_create_groups_job.rb +10 -0
- data/app/jobs/effective/mentorships_bulk_notify_groups_job.rb +10 -0
- data/app/mailers/effective/mentorships_mailer.rb +41 -3
- data/app/models/concerns/effective_mentorships_bulk_group.rb +368 -0
- data/app/models/concerns/effective_mentorships_group.rb +80 -5
- data/app/models/concerns/effective_mentorships_registration.rb +69 -8
- data/app/models/concerns/effective_mentorships_user.rb +42 -0
- data/app/models/effective/mentorship_bulk_group.rb +6 -0
- data/app/models/effective/mentorship_cycle.rb +1 -1
- data/app/models/effective/mentorship_group_user.rb +15 -0
- data/app/views/admin/mentorship_bulk_groups/_content.html.haml +1 -0
- data/app/views/admin/mentorship_bulk_groups/_creation.html.haml +9 -0
- data/app/views/admin/mentorship_bulk_groups/_layout.html.haml +3 -0
- data/app/views/admin/mentorship_bulk_groups/_selection.html.haml +24 -0
- data/app/views/admin/mentorship_bulk_groups/finished.html.haml +35 -0
- data/app/views/admin/mentorship_bulk_groups/group.html.haml +31 -0
- data/app/views/admin/mentorship_bulk_groups/grouping.html.haml +10 -0
- data/app/views/admin/mentorship_bulk_groups/notify.html.haml +49 -0
- data/app/views/admin/mentorship_bulk_groups/notifying.html.haml +10 -0
- data/app/views/admin/mentorship_bulk_groups/publish.html.haml +30 -0
- data/app/views/admin/mentorship_bulk_groups/review.html.haml +49 -0
- data/app/views/admin/mentorship_bulk_groups/start.html.haml +8 -0
- data/app/views/admin/mentorship_cycles/_form_mentorship_cycle.html.haml +0 -4
- data/app/views/admin/mentorship_groups/_form_mentorship_group.html.haml +11 -4
- data/app/views/effective/mentorship_registrations/_fields.html.haml +2 -2
- data/app/views/effective/mentorships/_dashboard.html.haml +1 -1
- data/app/views/effective/mentorships_mailer/mentorship_group_created_to_mentee.liquid +14 -0
- data/app/views/effective/mentorships_mailer/mentorship_group_created_to_mentor.liquid +14 -0
- data/config/effective_mentorships.rb +1 -0
- data/config/locales/effective_mentorships.en.yml +1 -0
- data/config/routes.rb +12 -5
- data/db/migrate/101_create_effective_mentorships.rb +26 -2
- data/lib/effective_mentorships/engine.rb +1 -0
- data/lib/effective_mentorships/version.rb +1 -1
- data/lib/effective_mentorships.rb +6 -2
- metadata +24 -2
@@ -5,6 +5,9 @@ module Effective
|
|
5
5
|
|
6
6
|
# App scoped
|
7
7
|
belongs_to :mentorship_group
|
8
|
+
|
9
|
+
# Polymorphic app scoped
|
10
|
+
belongs_to :mentorship_registration, polymorphic: true, optional: true
|
8
11
|
belongs_to :user, polymorphic: true
|
9
12
|
|
10
13
|
effective_resource do
|
@@ -28,6 +31,11 @@ module Effective
|
|
28
31
|
self.mentorship_cycle = mentorship_group.mentorship_cycle
|
29
32
|
end
|
30
33
|
|
34
|
+
# Assign registration, if present
|
35
|
+
before_validation(if: -> { user.present? && mentorship_cycle.present? }) do
|
36
|
+
self.mentorship_registration ||= user.mentorship_registrations.find { |mentorship_registration| mentorship_registration.mentorship_cycle_id == mentorship_cycle.id }
|
37
|
+
end
|
38
|
+
|
31
39
|
# Denormalized data for searching
|
32
40
|
before_validation(if: -> { user.present? }) do
|
33
41
|
assign_attributes(name: user.to_s, email: user.email)
|
@@ -39,5 +47,12 @@ module Effective
|
|
39
47
|
user.to_s.presence || model_name.human
|
40
48
|
end
|
41
49
|
|
50
|
+
def mentor?
|
51
|
+
mentorship_role.to_s == 'mentor'
|
52
|
+
end
|
53
|
+
|
54
|
+
def mentee?
|
55
|
+
mentorship_role.to_s == 'mentee'
|
56
|
+
end
|
42
57
|
end
|
43
58
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
-# Intentionally blank
|
@@ -0,0 +1,24 @@
|
|
1
|
+
%h3 Selection Criteria
|
2
|
+
|
3
|
+
- cycle = resource.mentorship_cycle
|
4
|
+
|
5
|
+
%p
|
6
|
+
= mentorships_mentors_label
|
7
|
+
and
|
8
|
+
= mentorships_mentees_label
|
9
|
+
with
|
10
|
+
= link_to(mentorship_registrations_label, effective_mentorships.admin_mentorship_registrations_path, target: '_blank')
|
11
|
+
that opted-in to the
|
12
|
+
= link_to(cycle, effective_mentorships.edit_admin_mentorship_cycle_path(cycle), target: '_blank')
|
13
|
+
will be selected.
|
14
|
+
|
15
|
+
%p
|
16
|
+
= succeed('.') do
|
17
|
+
Each of the new
|
18
|
+
= link_to(mentorship_groups_label, effective_mentorships.admin_mentorship_groups_path, target: '_blank')
|
19
|
+
will be created with a maximum of
|
20
|
+
= pluralize(resource.max_pairings_mentee, mentorships_mentee_label)
|
21
|
+
|
22
|
+
%p
|
23
|
+
Members already in
|
24
|
+
#{mentorship_groups_label.downcase} for #{cycle} will not be selected.
|
@@ -0,0 +1,35 @@
|
|
1
|
+
= render 'layout' do
|
2
|
+
= render 'admin/mentorship_bulk_groups/content', resource: resource
|
3
|
+
|
4
|
+
= card do
|
5
|
+
- cycle = resource.mentorship_cycle
|
6
|
+
|
7
|
+
- groups_datatable = EffectiveResources.best('Admin::EffectiveMentorshipGroupsDatatable').new(self, mentorship_bulk_group: resource)
|
8
|
+
- opt_in_without_groups_registrations_datatable = EffectiveResources.best('Admin::EffectiveMentorshipRegistrationsDatatable').new(self, mentorship_cycle: cycle, opt_in_without_groups: true)
|
9
|
+
|
10
|
+
%h3 #{mentorship_groups_label}
|
11
|
+
%p
|
12
|
+
The following
|
13
|
+
= pluralize(resource.mentorship_groups.count, mentorship_group_label.downcase)
|
14
|
+
for
|
15
|
+
= link_to(cycle, effective_mentorships.edit_admin_mentorship_cycle_path(cycle), target: '_blank')
|
16
|
+
have been created:
|
17
|
+
|
18
|
+
= collapse("Show all #{mentorship_groups_label.downcase}...", card_class: '', show: true) do
|
19
|
+
= render_datatable(groups_datatable, filters: false)
|
20
|
+
|
21
|
+
.my-4
|
22
|
+
|
23
|
+
%h3 Ungrouped #{mentorship_registrations_label}
|
24
|
+
%p
|
25
|
+
There are
|
26
|
+
= pluralize(opt_in_without_groups_registrations_datatable.collection.mentors.count, mentorships_mentors_label.downcase).html_safe
|
27
|
+
and
|
28
|
+
= pluralize(opt_in_without_groups_registrations_datatable.collection.mentees.count, mentorships_mentees_label.downcase).html_safe
|
29
|
+
who opted-in but were not placed into #{mentorship_groups_label.downcase}.
|
30
|
+
|
31
|
+
- # Mentorship Registrations
|
32
|
+
= collapse("Show ungrouped opt-in #{mentorship_registrations_label.downcase}...", card_class: '') do
|
33
|
+
= render_datatable(opt_in_without_groups_registrations_datatable, inline: true, filters: false)
|
34
|
+
|
35
|
+
|
@@ -0,0 +1,31 @@
|
|
1
|
+
= render 'layout' do
|
2
|
+
= render 'admin/mentorship_bulk_groups/content', resource: resource
|
3
|
+
|
4
|
+
= card do
|
5
|
+
= render('admin/mentorship_bulk_groups/selection', resource: resource)
|
6
|
+
|
7
|
+
%h3 Eligible #{mentorships_mentors_label}
|
8
|
+
- datatable = EffectiveResources.best('Admin::EffectiveMentorshipBulkGroupMentorsDatatable').new(self, mentorship_bulk_group: resource)
|
9
|
+
- raise('expected a mentors datatable') if datatable.nil?
|
10
|
+
|
11
|
+
%p The following #{pluralize(datatable.collection.count, mentorships_mentor_label)} will be grouped:
|
12
|
+
= collapse("Show #{mentorships_mentors_label}...", card_class: '') do
|
13
|
+
= render_datatable(datatable)
|
14
|
+
|
15
|
+
.my-4
|
16
|
+
|
17
|
+
%h3 Eligible #{mentorships_mentees_label}
|
18
|
+
- datatable = EffectiveResources.best('Admin::EffectiveMentorshipBulkGroupMenteesDatatable').new(self, mentorship_bulk_group: resource)
|
19
|
+
- raise('expected a mentees datatable') if datatable.nil?
|
20
|
+
|
21
|
+
%p The following #{pluralize(datatable.collection.count, mentorships_mentee_label)} will be grouped:
|
22
|
+
= collapse("Show #{mentorships_mentees_label}...", card_class: '') do
|
23
|
+
= render_datatable(datatable)
|
24
|
+
|
25
|
+
.my-4
|
26
|
+
|
27
|
+
= render('admin/mentorship_bulk_groups/creation', resource: resource)
|
28
|
+
|
29
|
+
= effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
|
30
|
+
= f.hidden_field :id
|
31
|
+
= f.submit "Create #{mentorship_groups_label}", center: true
|
@@ -0,0 +1,10 @@
|
|
1
|
+
= render 'layout' do
|
2
|
+
= render 'admin/mentorship_bulk_groups/content', resource: resource
|
3
|
+
|
4
|
+
= card do
|
5
|
+
= render('effective/acts_as_job_status/wizard_step', resource: resource)
|
6
|
+
|
7
|
+
- if resource.job_status == 'completed'
|
8
|
+
= effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
|
9
|
+
= f.hidden_field :id
|
10
|
+
= f.submit 'Save and Continue', center: true
|
@@ -0,0 +1,49 @@
|
|
1
|
+
= render 'layout' do
|
2
|
+
= render 'admin/mentorship_bulk_groups/content', resource: resource
|
3
|
+
|
4
|
+
= card do
|
5
|
+
- groups_datatable = EffectiveResources.best('Admin::EffectiveMentorshipGroupsDatatable').new(self, mentorship_bulk_group: resource)
|
6
|
+
|
7
|
+
%h3 #{mentorship_groups_label}
|
8
|
+
%p
|
9
|
+
There are
|
10
|
+
= pluralize(resource.mentorship_groups.published.not_notified.count, badge(:published) + ' and not yet notified ' + mentorship_group_label.downcase).html_safe
|
11
|
+
ready to be notified.
|
12
|
+
|
13
|
+
- # Mentorship Groups
|
14
|
+
= collapse("Show #{mentorship_groups_label.downcase}...", card_class: '') do
|
15
|
+
= render_datatable(groups_datatable, inline: true, filters: false)
|
16
|
+
|
17
|
+
.my-4
|
18
|
+
|
19
|
+
= effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
|
20
|
+
= f.hidden_field :id
|
21
|
+
|
22
|
+
%h3 Email to send
|
23
|
+
= f.check_box :email_form_skip, label: 'Do not send email'
|
24
|
+
|
25
|
+
= f.show_if :email_form_skip, true do
|
26
|
+
%p
|
27
|
+
No emails will be sent.
|
28
|
+
Notifications can be sent from the
|
29
|
+
= link_to(mentorship_groups_label, effective_mentorships.admin_mentorship_groups_path, target: '_blank')
|
30
|
+
page at any time.
|
31
|
+
|
32
|
+
= f.submit "Skip notifying the #{mentorship_groups_label.downcase}", center: true
|
33
|
+
|
34
|
+
= f.hide_if :email_form_skip, true do
|
35
|
+
%p
|
36
|
+
The
|
37
|
+
- email = Effective::EmailTemplate.where(template_name: :mentorship_group_created_to_mentor).first!
|
38
|
+
= link_to('mentorship_group_created_to_mentor email', effective_email_templates.edit_admin_email_template_path(email), target: '_blank')
|
39
|
+
email will be sent to each #{mentorships_mentor_label.downcase}.
|
40
|
+
|
41
|
+
%p
|
42
|
+
The
|
43
|
+
- email = Effective::EmailTemplate.where(template_name: :mentorship_group_created_to_mentee).first!
|
44
|
+
= link_to('mentorship_group_created_to_mentee email', effective_email_templates.edit_admin_email_template_path(email), target: '_blank')
|
45
|
+
email will be sent to each #{mentorships_mentee_label.downcase}.
|
46
|
+
|
47
|
+
%p Only #{badge(:published)} #{mentorship_groups_label.downcase} that have not been previously notified will be sent an email.
|
48
|
+
|
49
|
+
= f.submit "Yes, notify the #{mentorship_groups_label.downcase}", center: true
|
@@ -0,0 +1,10 @@
|
|
1
|
+
= render 'layout' do
|
2
|
+
= render 'admin/mentorship_bulk_groups/content', resource: resource
|
3
|
+
|
4
|
+
= card do
|
5
|
+
= render('effective/acts_as_job_status/wizard_step', resource: resource)
|
6
|
+
|
7
|
+
- if resource.job_status == 'completed'
|
8
|
+
= effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
|
9
|
+
= f.hidden_field :id
|
10
|
+
= f.submit 'Save and Continue', center: true
|
@@ -0,0 +1,30 @@
|
|
1
|
+
= render 'layout' do
|
2
|
+
= render 'admin/mentorship_bulk_groups/content', resource: resource
|
3
|
+
|
4
|
+
= card do
|
5
|
+
- groups_datatable = EffectiveResources.best('Admin::EffectiveMentorshipGroupsDatatable').new(self, mentorship_bulk_group: resource)
|
6
|
+
|
7
|
+
%h3 #{mentorship_groups_label}
|
8
|
+
%p
|
9
|
+
There are
|
10
|
+
= pluralize(resource.mentorship_groups.draft.count, badge(:draft) + ' ' + mentorship_group_label.downcase).html_safe
|
11
|
+
ready to be published.
|
12
|
+
|
13
|
+
- # Mentorship Groups
|
14
|
+
= collapse("Show #{mentorship_groups_label.downcase}...", card_class: '') do
|
15
|
+
= render_datatable(groups_datatable, inline: true, filters: false)
|
16
|
+
|
17
|
+
.my-4
|
18
|
+
|
19
|
+
%h3 Publish #{mentorship_groups_label}
|
20
|
+
|
21
|
+
%p
|
22
|
+
Upon clicking the button below, the above draft
|
23
|
+
= mentorship_groups_label.downcase
|
24
|
+
will be marked published.
|
25
|
+
|
26
|
+
%p Members will be able to access them from their dashboard.
|
27
|
+
|
28
|
+
= effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
|
29
|
+
= f.hidden_field :id
|
30
|
+
= f.submit "Yes, publish the #{mentorship_groups_label.downcase}", center: true
|
@@ -0,0 +1,49 @@
|
|
1
|
+
= render 'layout' do
|
2
|
+
= render 'admin/mentorship_bulk_groups/content', resource: resource
|
3
|
+
|
4
|
+
= card do
|
5
|
+
- cycle = resource.mentorship_cycle
|
6
|
+
|
7
|
+
- groups_datatable = EffectiveResources.best('Admin::EffectiveMentorshipGroupsDatatable').new(self, mentorship_bulk_group: resource)
|
8
|
+
- all_registrations_datatable = EffectiveResources.best('Admin::EffectiveMentorshipRegistrationsDatatable').new(self, mentorship_cycle: cycle)
|
9
|
+
- opt_in_without_groups_registrations_datatable = EffectiveResources.best('Admin::EffectiveMentorshipRegistrationsDatatable').new(self, mentorship_cycle: cycle, opt_in_without_groups: true)
|
10
|
+
|
11
|
+
%h3 All #{mentorship_registrations_label}
|
12
|
+
|
13
|
+
- # Mentorship Registrations
|
14
|
+
= collapse("Show all #{mentorship_registrations_label.downcase}...", card_class: '') do
|
15
|
+
= render_datatable(all_registrations_datatable, inline: true, filters: false)
|
16
|
+
|
17
|
+
.my-4
|
18
|
+
|
19
|
+
%h3 Ungrouped #{mentorship_registrations_label}
|
20
|
+
%p
|
21
|
+
There are
|
22
|
+
= pluralize(opt_in_without_groups_registrations_datatable.collection.mentors.count, mentorships_mentors_label.downcase).html_safe
|
23
|
+
and
|
24
|
+
= pluralize(opt_in_without_groups_registrations_datatable.collection.mentees.count, mentorships_mentees_label.downcase).html_safe
|
25
|
+
who opted-in but were not placed into #{mentorship_groups_label.downcase}.
|
26
|
+
|
27
|
+
- # Mentorship Registrations
|
28
|
+
= collapse("Show ungrouped opt-in #{mentorship_registrations_label.downcase}...", card_class: '') do
|
29
|
+
= render_datatable(opt_in_without_groups_registrations_datatable, inline: true, filters: false)
|
30
|
+
|
31
|
+
.my-4
|
32
|
+
|
33
|
+
%h3 Created #{mentorship_groups_label}
|
34
|
+
%p
|
35
|
+
Based on the above
|
36
|
+
= link_to(cycle, effective_mentorships.edit_admin_mentorship_cycle_path(cycle), target: '_blank')
|
37
|
+
= mentorship_registrations_label.downcase
|
38
|
+
the following
|
39
|
+
= pluralize(groups_datatable.collection.count, badge(:draft) + ' ' + mentorship_groups_label.downcase).html_safe
|
40
|
+
have been created.
|
41
|
+
|
42
|
+
%p Please edit, delete or create additional #{mentorship_groups_label.downcase} as needed.
|
43
|
+
|
44
|
+
-# Mentorship Groups
|
45
|
+
= render_datatable(groups_datatable, inline: true, filters: false)
|
46
|
+
|
47
|
+
= effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
|
48
|
+
= f.hidden_field :id
|
49
|
+
= f.submit 'Save and Continue', center: true
|
@@ -0,0 +1,8 @@
|
|
1
|
+
= render 'layout' do
|
2
|
+
= render 'admin/mentorship_bulk_groups/content', resource: resource
|
3
|
+
|
4
|
+
= card do
|
5
|
+
= effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
|
6
|
+
= f.hidden_field :id
|
7
|
+
= f.select :mentorship_cycle_id, Effective::MentorshipCycle.all
|
8
|
+
= f.save 'Save and Continue'
|
@@ -8,10 +8,6 @@
|
|
8
8
|
|
9
9
|
.row
|
10
10
|
.col-md-6
|
11
|
-
= f.number_field :max_pairings_mentor,
|
12
|
-
label: "Max #{mentorships_mentors_label} per #{mentorship_group_label}",
|
13
|
-
hint: "The maximum number of #{mentorships_mentors_label} that will be assigned to a #{mentorship_group_label}. Leave blank for no maximum."
|
14
|
-
|
15
11
|
= f.number_field :max_pairings_mentee, label: "Max #{mentorships_mentees_label} per #{mentorship_group_label}",
|
16
12
|
hint: "The maximum number of #{mentorships_mentees_label} that will be assigned to a #{mentorship_group_label}. Leave blank for no maximum."
|
17
13
|
|
@@ -1,14 +1,21 @@
|
|
1
1
|
= effective_form_with(model: [:admin, mentorship_group], engine: true) do |f|
|
2
|
-
|
3
|
-
|
2
|
+
- if f.object.persisted?
|
3
|
+
= f.static_field :title
|
4
|
+
|
5
|
+
- if inline_datatable? && inline_datatable.attributes[:mentorship_bulk_group_id].present?
|
6
|
+
= f.hidden_field :mentorship_bulk_group_id
|
7
|
+
= f.hidden_field :save_as_draft, value: true
|
8
|
+
|
9
|
+
= f.static_field :mentorship_cycle, value: f.object.mentorship_bulk_group.mentorship_cycle
|
10
|
+
- else
|
11
|
+
= f.select :mentorship_cycle_id, Effective::MentorshipCycle.sorted.all
|
12
|
+
= acts_as_published_fields(f)
|
4
13
|
|
5
14
|
- if defined?(EffectiveArticleEditor)
|
6
15
|
= f.article_editor :rich_text_admin_notes, label: "Admin Notes"
|
7
16
|
- else
|
8
17
|
= f.rich_text_area :rich_text_admin_notes, label: "Admin Notes"
|
9
18
|
|
10
|
-
= f.check_box :archived, label: "Yes, this #{mentorship_group_label} is archived"
|
11
|
-
|
12
19
|
%hr
|
13
20
|
|
14
21
|
%h4= mentorship_group_users_label
|
@@ -1,7 +1,7 @@
|
|
1
1
|
- unless local_assigns[:namespace] == :admin
|
2
2
|
= f.hidden_field :mentorship_cycle_id
|
3
3
|
|
4
|
-
- if f.object.mentorship_cycle
|
4
|
+
- if f.object.mentorship_cycle&.rich_text_registration_content.present?
|
5
5
|
= f.object.mentorship_cycle.rich_text_registration_content
|
6
6
|
|
7
7
|
= f.radios :opt_in, :boolean, label: "Do you wish to register in the #{f.object.mentorship_cycle || et('effective_mentorships.name')}?"
|
@@ -16,7 +16,7 @@
|
|
16
16
|
= f.select :location, f.object.class.locations(), required: true
|
17
17
|
= f.radios :venue, f.object.class.venues(), required: true
|
18
18
|
|
19
|
-
- if f.object.mentorship_cycle
|
19
|
+
- if f.object.mentorship_cycle&.rich_text_agreement_content.present?
|
20
20
|
= card do
|
21
21
|
= f.object.mentorship_cycle.rich_text_agreement_content
|
22
22
|
|
@@ -17,5 +17,5 @@
|
|
17
17
|
- if available.present?
|
18
18
|
= render_datatable(available, simple: true)
|
19
19
|
|
20
|
-
- if available.blank? && registered.blank?
|
20
|
+
- if available.blank? && registered.blank? && groups.blank?
|
21
21
|
%p There are no #{'additional ' if groups.present? || registered.present?}#{etsd(Effective::MentorshipCycle)} available for registration. When there are, we'll show them here.
|
@@ -0,0 +1,14 @@
|
|
1
|
+
---
|
2
|
+
subject: 'You have been selected for a mentorship group'
|
3
|
+
---
|
4
|
+
Hello {{ user.name }},
|
5
|
+
|
6
|
+
You have been selected as a {{ user.mentorship_role }} in the following mentorship group:
|
7
|
+
|
8
|
+
{{ group.mentorship_cycle }} - {{ group.title }}
|
9
|
+
|
10
|
+
To access the group please click below
|
11
|
+
|
12
|
+
{{ url }}
|
13
|
+
|
14
|
+
Thank you
|
@@ -0,0 +1,14 @@
|
|
1
|
+
---
|
2
|
+
subject: 'You have been selected for a mentorship group'
|
3
|
+
---
|
4
|
+
Hello {{ user.name }},
|
5
|
+
|
6
|
+
You have been selected as a {{ user.mentorship_role }} in the following mentorship group:
|
7
|
+
|
8
|
+
{{ group.mentorship_cycle }} - {{ group.title }}
|
9
|
+
|
10
|
+
To access the group please click below
|
11
|
+
|
12
|
+
{{ url }}
|
13
|
+
|
14
|
+
Thank you
|
@@ -9,6 +9,7 @@ EffectiveMentorships.setup do |config|
|
|
9
9
|
# Mentorship Class Settings
|
10
10
|
# Configure the class responsible for the mentorships
|
11
11
|
# config.mentorship_group_class_name = 'Effective::MentorshipGroup'
|
12
|
+
# config.mentorship_bulk_group_class_name = 'Effective::MentorshipBulkGroup'
|
12
13
|
# config.mentorship_registration_class_name = 'Effective::MentorshipRegistration'
|
13
14
|
|
14
15
|
# Mailer Settings
|
@@ -10,6 +10,7 @@ en:
|
|
10
10
|
# Application namespace
|
11
11
|
app/mentorship_group: 'Mentorship group'
|
12
12
|
app/mentorship_registration: 'Mentorship registration'
|
13
|
+
app/mentorship_bulk_group: 'Bulk Create Mentorship groups'
|
13
14
|
|
14
15
|
# Effective namespace
|
15
16
|
effective/mentorship_cycle: 'Mentorship cycle'
|
data/config/routes.rb
CHANGED
@@ -13,13 +13,20 @@ EffectiveMentorships::Engine.routes.draw do
|
|
13
13
|
|
14
14
|
namespace :admin do
|
15
15
|
resources :mentorship_cycles, except: [:show]
|
16
|
-
resources :mentorship_registrations,
|
16
|
+
resources :mentorship_registrations, only: [:index, :edit, :update, :delete]
|
17
|
+
|
18
|
+
resources :mentorship_bulk_groups, only: [:index, :new, :show, :destroy] do
|
19
|
+
resources :build, controller: :mentorship_bulk_groups, only: [:show, :update]
|
20
|
+
end
|
17
21
|
|
18
22
|
resources :mentorship_groups, except: [:show] do
|
19
|
-
post :
|
20
|
-
post :
|
21
|
-
post :
|
22
|
-
|
23
|
+
post :publish, on: :member
|
24
|
+
post :draft, on: :member
|
25
|
+
post :notify, on: :member
|
26
|
+
|
27
|
+
post :bulk_notify, on: :collection
|
28
|
+
post :bulk_publish, on: :collection
|
29
|
+
post :bulk_draft, on: :collection
|
23
30
|
end
|
24
31
|
|
25
32
|
resources :mentorship_group_users, except: [:show]
|
@@ -9,7 +9,6 @@ class CreateEffectiveMentorships < ActiveRecord::Migration[6.0]
|
|
9
9
|
t.datetime :registration_start_at
|
10
10
|
t.datetime :registration_end_at
|
11
11
|
|
12
|
-
t.integer :max_pairings_mentor
|
13
12
|
t.integer :max_pairings_mentee
|
14
13
|
|
15
14
|
t.integer :mentorship_groups_count, default: 0
|
@@ -21,10 +20,13 @@ class CreateEffectiveMentorships < ActiveRecord::Migration[6.0]
|
|
21
20
|
|
22
21
|
create_table :mentorship_groups do |t|
|
23
22
|
t.integer :mentorship_cycle_id
|
23
|
+
t.integer :mentorship_bulk_group_id
|
24
24
|
|
25
25
|
t.string :title
|
26
26
|
|
27
|
-
t.
|
27
|
+
t.datetime :published_start_at
|
28
|
+
t.datetime :published_end_at
|
29
|
+
t.datetime :last_notified_at
|
28
30
|
|
29
31
|
t.string :token
|
30
32
|
|
@@ -36,6 +38,9 @@ class CreateEffectiveMentorships < ActiveRecord::Migration[6.0]
|
|
36
38
|
t.integer :mentorship_cycle_id
|
37
39
|
t.integer :mentorship_group_id
|
38
40
|
|
41
|
+
t.string :mentorship_registration_type
|
42
|
+
t.integer :mentorship_registration_id
|
43
|
+
|
39
44
|
t.string :user_type
|
40
45
|
t.integer :user_id
|
41
46
|
|
@@ -75,5 +80,24 @@ class CreateEffectiveMentorships < ActiveRecord::Migration[6.0]
|
|
75
80
|
t.datetime :updated_at
|
76
81
|
t.datetime :created_at
|
77
82
|
end
|
83
|
+
|
84
|
+
create_table :mentorship_bulk_groups do |t|
|
85
|
+
t.integer :mentorship_cycle_id
|
86
|
+
t.integer :mentorship_groups_count, default: 0
|
87
|
+
|
88
|
+
t.boolean :email_form_skip, default: false
|
89
|
+
t.text :wizard_steps
|
90
|
+
|
91
|
+
t.string :token
|
92
|
+
|
93
|
+
t.string :job_status
|
94
|
+
t.datetime :job_started_at
|
95
|
+
t.datetime :job_ended_at
|
96
|
+
t.text :job_error
|
97
|
+
|
98
|
+
t.datetime :updated_at
|
99
|
+
t.datetime :created_at
|
100
|
+
end
|
101
|
+
|
78
102
|
end
|
79
103
|
end
|
@@ -12,6 +12,7 @@ module EffectiveMentorships
|
|
12
12
|
app.config.to_prepare do
|
13
13
|
ActiveRecord::Base.extend(EffectiveMentorshipsUser::Base)
|
14
14
|
ActiveRecord::Base.extend(EffectiveMentorshipsGroup::Base)
|
15
|
+
ActiveRecord::Base.extend(EffectiveMentorshipsBulkGroup::Base)
|
15
16
|
ActiveRecord::Base.extend(EffectiveMentorshipsRegistration::Base)
|
16
17
|
end
|
17
18
|
end
|
@@ -7,8 +7,8 @@ module EffectiveMentorships
|
|
7
7
|
|
8
8
|
def self.config_keys
|
9
9
|
[
|
10
|
-
:mentorship_cycles_table_name, :mentorship_groups_table_name, :mentorship_registrations_table_name,
|
11
|
-
:mentorship_group_class_name, :mentorship_registration_class_name,
|
10
|
+
:mentorship_cycles_table_name, :mentorship_bulk_groups_table_name, :mentorship_groups_table_name, :mentorship_registrations_table_name,
|
11
|
+
:mentorship_group_class_name, :mentorship_registration_class_name, :mentorship_bulk_group_class_name,
|
12
12
|
:layout,
|
13
13
|
:mailer, :parent_mailer, :deliver_method, :mailer_layout, :mailer_sender, :mailer_froms, :mailer_admin, :mailer_subject,
|
14
14
|
]
|
@@ -20,6 +20,10 @@ module EffectiveMentorships
|
|
20
20
|
mailer&.constantize || Effective::MentorshipsMailer
|
21
21
|
end
|
22
22
|
|
23
|
+
def self.MentorshipBulkGroup
|
24
|
+
mentorship_bulk_group_class_name&.constantize || Effective::MentorshipBulkGroup
|
25
|
+
end
|
26
|
+
|
23
27
|
def self.MentorshipGroup
|
24
28
|
mentorship_group_class_name&.constantize || Effective::MentorshipGroup
|
25
29
|
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.
|
4
|
+
version: 0.3.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:
|
11
|
+
date: 2025-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -205,12 +205,16 @@ files:
|
|
205
205
|
- app/assets/config/effective_mentorships_manifest.js
|
206
206
|
- app/assets/javascripts/effective_mentorships.js
|
207
207
|
- app/assets/stylesheets/effective_mentorships.scss
|
208
|
+
- app/controllers/admin/mentorship_bulk_groups_controller.rb
|
208
209
|
- app/controllers/admin/mentorship_cycles_controller.rb
|
209
210
|
- app/controllers/admin/mentorship_group_users_controller.rb
|
210
211
|
- app/controllers/admin/mentorship_groups_controller.rb
|
211
212
|
- app/controllers/admin/mentorship_registrations_controller.rb
|
212
213
|
- app/controllers/effective/mentorship_groups_controller.rb
|
213
214
|
- app/controllers/effective/mentorship_registrations_controller.rb
|
215
|
+
- app/datatables/admin/effective_mentorship_bulk_group_mentees_datatable.rb
|
216
|
+
- app/datatables/admin/effective_mentorship_bulk_group_mentors_datatable.rb
|
217
|
+
- app/datatables/admin/effective_mentorship_bulk_groups_datatable.rb
|
214
218
|
- app/datatables/admin/effective_mentorship_cycles_datatable.rb
|
215
219
|
- app/datatables/admin/effective_mentorship_group_users_datatable.rb
|
216
220
|
- app/datatables/admin/effective_mentorship_groups_datatable.rb
|
@@ -219,14 +223,30 @@ files:
|
|
219
223
|
- app/datatables/effective_mentorships_groups_datatable.rb
|
220
224
|
- app/datatables/effective_mentorships_registrations_datatable.rb
|
221
225
|
- app/helpers/effective_mentorships_helper.rb
|
226
|
+
- app/jobs/effective/mentorships_bulk_create_groups_job.rb
|
227
|
+
- app/jobs/effective/mentorships_bulk_notify_groups_job.rb
|
222
228
|
- app/mailers/effective/mentorships_mailer.rb
|
229
|
+
- app/models/concerns/effective_mentorships_bulk_group.rb
|
223
230
|
- app/models/concerns/effective_mentorships_group.rb
|
224
231
|
- app/models/concerns/effective_mentorships_registration.rb
|
225
232
|
- app/models/concerns/effective_mentorships_user.rb
|
233
|
+
- app/models/effective/mentorship_bulk_group.rb
|
226
234
|
- app/models/effective/mentorship_cycle.rb
|
227
235
|
- app/models/effective/mentorship_group.rb
|
228
236
|
- app/models/effective/mentorship_group_user.rb
|
229
237
|
- app/models/effective/mentorship_registration.rb
|
238
|
+
- app/views/admin/mentorship_bulk_groups/_content.html.haml
|
239
|
+
- app/views/admin/mentorship_bulk_groups/_creation.html.haml
|
240
|
+
- app/views/admin/mentorship_bulk_groups/_layout.html.haml
|
241
|
+
- app/views/admin/mentorship_bulk_groups/_selection.html.haml
|
242
|
+
- app/views/admin/mentorship_bulk_groups/finished.html.haml
|
243
|
+
- app/views/admin/mentorship_bulk_groups/group.html.haml
|
244
|
+
- app/views/admin/mentorship_bulk_groups/grouping.html.haml
|
245
|
+
- app/views/admin/mentorship_bulk_groups/notify.html.haml
|
246
|
+
- app/views/admin/mentorship_bulk_groups/notifying.html.haml
|
247
|
+
- app/views/admin/mentorship_bulk_groups/publish.html.haml
|
248
|
+
- app/views/admin/mentorship_bulk_groups/review.html.haml
|
249
|
+
- app/views/admin/mentorship_bulk_groups/start.html.haml
|
230
250
|
- app/views/admin/mentorship_cycles/_form.html.haml
|
231
251
|
- app/views/admin/mentorship_cycles/_form_mentorship_cycle.html.haml
|
232
252
|
- app/views/admin/mentorship_group_users/_form.html.haml
|
@@ -240,6 +260,8 @@ files:
|
|
240
260
|
- app/views/effective/mentorship_registrations/_mentorship_registration.html.haml
|
241
261
|
- app/views/effective/mentorships/_dashboard.html.haml
|
242
262
|
- app/views/effective/mentorships_mailer/README.md
|
263
|
+
- app/views/effective/mentorships_mailer/mentorship_group_created_to_mentee.liquid
|
264
|
+
- app/views/effective/mentorships_mailer/mentorship_group_created_to_mentor.liquid
|
243
265
|
- config/effective_mentorships.rb
|
244
266
|
- config/locales/effective_mentorships.en.yml
|
245
267
|
- config/routes.rb
|