effective_mentorships 0.2.0 → 0.2.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 171010bae5f93974f5ba6044bd82f880f2b552bd913c7ca0137122b362859262
4
- data.tar.gz: cffbb49649eff6aba7a73456241ef7a8e86e3521225144230534bdbba6955b31
3
+ metadata.gz: f5d908c2df40071246bda994a3d01f59dd7ffe19d8d049a49c2b919c27f1da5f
4
+ data.tar.gz: 8711f45d78bf283c55925e4e407e83d9980426339d704f7c71e8df410921bd05
5
5
  SHA512:
6
- metadata.gz: e6e1290b4d9b47a3518db1d17e22cb003ffe6bb1e5fdb5e3453671c2fe006b4d0c32f239f6df299b88932b2f30884c9a2e5e24a21c78282effa16ef805784d9b
7
- data.tar.gz: 599848b64d0f1c77f2141a6de91d748443c9f00c18531fb2c27c0e9fa86236e92280842394013da0d41b37e1578addaab5162f23fde71ab485430900568be1ab
6
+ metadata.gz: 90da1bb4d514e38e396f06cbd1cc621cdd9576cb390e2b8af151b49a71dbd500db3ccc2ebf4e08acab60f01412c4ed982ccf696f239d33da8981677725a73638
7
+ data.tar.gz: 4dcbfa64d08ccc64903eedd2f585310a3301ff13376d60dd83472afeaac7a26d89807936b98301e44ed6601c4382a23b1ee4c2fbc59bcdd2f73964852fccc0b0
@@ -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
@@ -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? && mentor_multiple_mentees? }
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) }
@@ -27,15 +27,19 @@
27
27
  %h2 Content
28
28
 
29
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}"
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
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}"
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
33
 
34
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}"
35
+ = f.article_editor :rich_text_agreement_content, label: "#{mentorship_registration_label} agreement", hint: "Will be displayed to the user above a checkbox to accept."
36
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}"
37
+ = f.rich_text_area :rich_text_agreement_content, label: "#{mentorship_registration_label} agreement", hint: "Will be displayed to the user above a checkbox to accept."
38
38
 
39
+ - if defined?(EffectiveArticleEditor)
40
+ = 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}."
41
+ - else
42
+ = 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} and after opt-in."
39
43
 
40
44
  = f.submit do
41
45
  = f.save 'Save'
@@ -1,6 +1,9 @@
1
1
  - unless local_assigns[:namespace] == :admin
2
2
  = f.hidden_field :mentorship_cycle_id
3
3
 
4
+ - if f.object.mentorship_cycle.rich_text_registration_content.present?
5
+ = f.object.mentorship_cycle.rich_text_registration_content
6
+
4
7
  = f.radios :opt_in, :boolean, label: "Do you wish to register in the #{f.object.mentorship_cycle || et('effective_mentorships.name')}?"
5
8
 
6
9
  = f.hide_if(:opt_in, false) do
@@ -13,8 +16,9 @@
13
16
  = f.select :location, f.object.class.locations(), required: true
14
17
  = f.radios :venue, f.object.class.venues(), required: true
15
18
 
16
- - if mentorship_cycle.rich_text_registration_content.present?
17
- .my-4= mentorship_cycle.rich_text_registration_content
19
+ - if f.object.mentorship_cycle.rich_text_agreement_content.present?
20
+ = card do
21
+ = f.object.mentorship_cycle.rich_text_agreement_content
18
22
 
19
23
  = f.check_box :accept_declaration, label: "Yes, I accept the #{et('effective_mentorships.name')} agreement", required: true
20
24
 
@@ -3,9 +3,14 @@
3
3
 
4
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
5
 
6
- = card do
7
- %h2= et('effective_mentorships.name')
6
+ %h1= et('effective_mentorships.name')
7
+
8
+ - if mentorship_registration.persisted?
9
+ - if mentorship_registration.mentorship_cycle.rich_text_group_content.present?
10
+ = card do
11
+ = mentorship_registration.mentorship_cycle.rich_text_group_content
8
12
 
13
+ = card do
9
14
  = effective_form_with(model: mentorship_registration, url: url) do |f|
10
15
  = f.hidden_field :user_id, value: current_user.id
11
16
  = render('effective/mentorship_registrations/fields', f: f)
@@ -1,3 +1,3 @@
1
1
  module EffectiveMentorships
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.2'
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.2.0
4
+ version: 0.2.2
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-26 00:00:00.000000000 Z
11
+ date: 2024-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails