effective_mentorships 0.1.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/datatables/admin/effective_mentorship_registrations_datatable.rb +0 -1
- data/app/models/concerns/effective_mentorships_registration.rb +2 -3
- data/app/views/effective/mentorship_registrations/_fields.html.haml +7 -7
- data/app/views/effective/mentorship_registrations/_form.html.haml +0 -3
- data/app/views/effective/mentorships/_dashboard.html.haml +0 -6
- data/db/migrate/101_create_effective_mentorships.rb +1 -2
- data/lib/effective_mentorships/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 569706e1dab213ee7cb6102a5242270b5b7586ffdb8d12ce5997635eb2e589dd
|
4
|
+
data.tar.gz: 28d54e0d12f669d3f376496c40605d00e979d29c981737416c17455e53ca0989
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2372c9a3629dc4b2258309dc6b2353e930e3a2f804c9332a038154d2bbeca0189b76f79b52a5419c0d2216dcc4798ae2269c5b1d3eb08264e73dc679c9efc7aa
|
7
|
+
data.tar.gz: 58dd46785e9737b00690408040bdbdbbf04b194d0b34da1479647eb0aee8b4eed68a001f453c922c1acdbf7ae93d7147f018002633968564446839b7b7a18a07
|
@@ -26,7 +26,6 @@ module Admin
|
|
26
26
|
col :category, search: EffectiveMentorships.MentorshipRegistration.categories
|
27
27
|
col :venue, search: EffectiveMentorships.MentorshipRegistration.venues
|
28
28
|
col :location, search: EffectiveMentorships.MentorshipRegistration.locations
|
29
|
-
col :mentor_multiple_mentees, visible: false
|
30
29
|
col :mentor_multiple_mentees_limit, visible: false
|
31
30
|
|
32
31
|
col :parent, visible: false
|
@@ -29,7 +29,7 @@ module EffectiveMentorshipsRegistration
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def venues
|
32
|
-
['
|
32
|
+
['Virtual', 'In-person', 'Either']
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
@@ -61,7 +61,6 @@ module EffectiveMentorshipsRegistration
|
|
61
61
|
location :string # Closest city of residence
|
62
62
|
|
63
63
|
# Mentor only fields
|
64
|
-
mentor_multiple_mentees :boolean
|
65
64
|
mentor_multiple_mentees_limit :integer
|
66
65
|
|
67
66
|
# Mentee only fields
|
@@ -84,7 +83,7 @@ module EffectiveMentorshipsRegistration
|
|
84
83
|
validates :accept_declaration, acceptance: true
|
85
84
|
end
|
86
85
|
|
87
|
-
validates :mentor_multiple_mentees_limit, numericality: { greater_than: 0 }, if: -> { opt_in? &&
|
86
|
+
validates :mentor_multiple_mentees_limit, numericality: { greater_than: 0 }, if: -> { opt_in? && mentor? }
|
88
87
|
|
89
88
|
scope :deep, -> { includes(:rich_texts, :user, :mentorship_cycle) }
|
90
89
|
scope :sorted, -> { order(:id) }
|
@@ -1,19 +1,20 @@
|
|
1
1
|
- unless local_assigns[:namespace] == :admin
|
2
2
|
= f.hidden_field :mentorship_cycle_id
|
3
3
|
|
4
|
-
= f.radios :opt_in, :boolean, label: "Do you wish to register in the #{f.object.mentorship_cycle || et('effective_mentorships.name')}?"
|
4
|
+
= f.radios :opt_in, :boolean, label: "Do you wish to register in the #{f.object.mentorship_cycle || et('effective_mentorships.name')}?"
|
5
5
|
|
6
6
|
= f.hide_if(:opt_in, false) do
|
7
|
-
= f.radios :mentorship_role, mentorship_roles_collection(), label: "Register as", required: true
|
7
|
+
= f.radios :mentorship_role, mentorship_roles_collection(), label: "Register as a:", required: true
|
8
8
|
|
9
9
|
= f.show_if(:mentorship_role, 'mentor') do
|
10
|
-
=
|
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
|
10
|
+
= f.radios :mentor_multiple_mentees_limit, [1, 2, 3, 4, 5], label: "How many #{mentorships_mentee_label.downcase.pluralize} are you willing to #{mentorships_mentor_label.downcase}?"
|
13
11
|
|
14
12
|
= f.select :category, f.object.class.categories(), required: true
|
15
13
|
= f.select :location, f.object.class.locations(), required: true
|
16
|
-
= f.radios :venue, f.object.class.venues(), required: true
|
14
|
+
= f.radios :venue, f.object.class.venues(), required: true
|
15
|
+
|
16
|
+
- if mentorship_cycle.rich_text_registration_content.present?
|
17
|
+
.my-4= mentorship_cycle.rich_text_registration_content
|
17
18
|
|
18
19
|
= f.check_box :accept_declaration, label: "Yes, I accept the #{et('effective_mentorships.name')} agreement", required: true
|
19
20
|
|
@@ -21,4 +22,3 @@
|
|
21
22
|
= f.article_editor :rich_text_comments, label: "Comments"
|
22
23
|
- else
|
23
24
|
= f.rich_text_area :rich_text_comments, label: "Comments"
|
24
|
-
|
@@ -6,9 +6,6 @@
|
|
6
6
|
= card do
|
7
7
|
%h2= et('effective_mentorships.name')
|
8
8
|
|
9
|
-
- if mentorship_cycle.rich_text_registration_content.present?
|
10
|
-
.mt-4= mentorship_cycle.rich_text_registration_content
|
11
|
-
|
12
9
|
= effective_form_with(model: mentorship_registration, url: url) do |f|
|
13
10
|
= f.hidden_field :user_id, value: current_user.id
|
14
11
|
= render('effective/mentorship_registrations/fields', f: f)
|
@@ -6,21 +6,15 @@
|
|
6
6
|
- if groups.present?
|
7
7
|
%p You are a member of the following #{mentorship_groups_label.downcase}:
|
8
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
9
|
|
14
10
|
-# Available Registrations
|
15
11
|
- registered = EffectiveResources.best('EffectiveMentorshipsRegistrationsDatatable').new(self, namespace: :effective)
|
16
12
|
- available = EffectiveResources.best('EffectiveMentorshipsAvailableCyclesDatatable').new(self, namespace: :effective)
|
17
13
|
|
18
14
|
- if registered.present?
|
19
|
-
%p You have registered for the following #{etsd(Effective::MentorshipCycle)}:
|
20
15
|
= render_datatable(registered, simple: true)
|
21
16
|
|
22
17
|
- if available.present?
|
23
|
-
%p You can register for the following #{etsd(Effective::MentorshipCycle)}:
|
24
18
|
= render_datatable(available, simple: true)
|
25
19
|
|
26
20
|
- if available.blank? && registered.blank?
|
@@ -59,7 +59,7 @@ class CreateEffectiveMentorships < ActiveRecord::Migration[6.0]
|
|
59
59
|
|
60
60
|
t.string :title
|
61
61
|
|
62
|
-
t.boolean :opt_in
|
62
|
+
t.boolean :opt_in, default: false
|
63
63
|
t.boolean :accept_declaration, default: false
|
64
64
|
|
65
65
|
t.string :mentorship_role
|
@@ -68,7 +68,6 @@ class CreateEffectiveMentorships < ActiveRecord::Migration[6.0]
|
|
68
68
|
t.string :venue
|
69
69
|
t.string :location
|
70
70
|
|
71
|
-
t.boolean :mentor_multiple_mentees
|
72
71
|
t.integer :mentor_multiple_mentees_limit
|
73
72
|
|
74
73
|
t.string :token
|
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.1
|
4
|
+
version: 0.2.1
|
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-
|
11
|
+
date: 2024-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|