effective_cpd 0.1.5 → 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c655d5b1c2e948affbfee9558e51b7e66ca5cfd0e43fbf2a58fecc7a3b2d885f
4
- data.tar.gz: 06fe0a9add6534d48e5b51055343018c75723fa288f9051666fd29767fab0f86
3
+ metadata.gz: 5b6ad81c90e8ba68f14d6975f449c71ebb20076f7b261f13548cd78eb57cab5b
4
+ data.tar.gz: 42bddd331a47d453bcad32a2fa904d7b5691040f4fb10790996b28c5a93ea73f
5
5
  SHA512:
6
- metadata.gz: bd95fa02fad56e41914ac568da4cdaf0b2413297a35fbccf4d8c32659d1e2e30c0e474871d33f124a03f7c962372a9136149cd587a520c6c41447e269692901a
7
- data.tar.gz: 212aaa715dcee4635d708a579fad03e18bdfd8b253515d2a3b3b2dcaf1419eb7237766c68260d83992c6520d802fc128ebd355537b820578ea823b9362101661
6
+ metadata.gz: 0e9a580dc39ed60934e761b3b9103168307db5e90f1b3143cb90b89ffc3d945a81f993f090837a1153dcbc053c6ad71d342fe24549e684cf659a08dd4ed259d5
7
+ data.tar.gz: d92f8ab5424cc5b1c4ef7ee9c341707742985876324d0f0c88766b62acec2c83b61cf717d4a87105a34a352d2bfdd8c8de6385aaaabb14fb8266794ad6b074c1
@@ -81,7 +81,7 @@ module Effective
81
81
  attributes = cycle.dup.attributes.except('title', 'token', 'start_at', 'end_at')
82
82
  assign_attributes(attributes)
83
83
 
84
- [:all_steps_content, :sidebar_content, :start_content, :activities_content, :submit_content, :complete_content].each do |rich_text|
84
+ [:all_steps_content, :sidebar_content, :start_content, :activities_content, :agreements_content, :submit_content, :complete_content].each do |rich_text|
85
85
  self.send("#{rich_text}=", cycle.send(rich_text))
86
86
  end
87
87
 
@@ -1,4 +1,5 @@
1
1
  - edit_path = effective_cpd.edit_admin_cpd_category_path(cpd_category)
2
+ - cpd_rule = cpd_cycle.rule_for(cpd_category)
2
3
 
3
4
  = effective_form_with(model: [:admin, cpd_cycle], engine: true) do |f|
4
5
  %h2= cpd_category
@@ -22,40 +23,42 @@
22
23
 
23
24
  = f.submit
24
25
 
25
- = effective_form_with(model: [:admin, cpd_cycle], engine: true) do |f|
26
- %h2 Activities
27
- - rules = cpd_category.cpd_activities.map { |activity| cpd_cycle.rule_for(activity) }
26
+ - unless cpd_rule.unavailable?
28
27
 
29
- = f.fields_for :cpd_rules, rules do |fa|
30
- - activity = fa.object.ruleable
28
+ = effective_form_with(model: [:admin, cpd_cycle], engine: true) do |f|
29
+ %h2 Activities
30
+ - rules = cpd_category.cpd_activities.map { |activity| cpd_cycle.rule_for(activity) }
31
31
 
32
- = card do
33
- .row
34
- .col
35
- %h5.card-title= activity
36
- - if activity.body.present?
37
- %p= activity.body
32
+ = f.fields_for :cpd_rules, rules do |fa|
33
+ - activity = fa.object.ruleable
38
34
 
39
- %p= link_to 'Edit Activity', edit_path, target: '_blank'
35
+ = card do
36
+ .row
37
+ .col
38
+ %h5.card-title= activity
39
+ - if activity.body.present?
40
+ %p= activity.body
40
41
 
41
- = f.static_field :amount_label, value: activity.amount_label.presence || '-'
42
- = f.static_field :amount2_label, value: activity.amount2_label.presence || '-'
43
- = f.static_field :requires_upload_file, value: (activity.requires_upload_file ? 'Yes' : '-')
42
+ %p= link_to 'Edit Activity', edit_path, target: '_blank'
44
43
 
45
- .col
46
- = fa.text_field :formula, hint: cpd_rule_formula_hint(activity)
44
+ = f.static_field :amount_label, value: activity.amount_label.presence || '-'
45
+ = f.static_field :amount2_label, value: activity.amount2_label.presence || '-'
46
+ = f.static_field :requires_upload_file, value: (activity.requires_upload_file ? 'Yes' : '-')
47
47
 
48
- = fa.text_field :credit_description, label: "#{cpd_credits_label.titleize} description",
49
- hint: "A simple description of the formula and its #{cpd_credits_label} calculation"
48
+ .col
49
+ = fa.text_field :formula, hint: cpd_rule_formula_hint(activity)
50
50
 
51
- = fa.number_field :max_credits_per_cycle,
52
- label: "Max #{cpd_credits_label} per #{cpd_cycle_label}",
53
- hint: 'leave blank for no limit'
51
+ = fa.text_field :credit_description, label: "#{cpd_credits_label.titleize} description",
52
+ hint: "A simple description of the formula and its #{cpd_credits_label} calculation"
54
53
 
55
- = fa.number_field :max_cycles_can_carry_forward,
56
- label: "Max #{cpd_cycles_label} can carry forward",
57
- hint: "leave blank for no limit. enter zero for no carry forward."
54
+ = fa.number_field :max_credits_per_cycle,
55
+ label: "Max #{cpd_credits_label} per #{cpd_cycle_label}",
56
+ hint: 'leave blank for no limit'
58
57
 
59
- = fa.check_box :unavailable, label: "Unavailable in this #{cpd_cycle_label}"
58
+ = fa.number_field :max_cycles_can_carry_forward,
59
+ label: "Max #{cpd_cycles_label} can carry forward",
60
+ hint: "leave blank for no limit. enter zero for no carry forward."
60
61
 
61
- = f.submit
62
+ = fa.check_box :unavailable, label: "Unavailable in this #{cpd_cycle_label}"
63
+
64
+ = f.submit
@@ -1,3 +1,3 @@
1
1
  module EffectiveCpd
2
- VERSION = '0.1.5'
2
+ VERSION = '0.1.6'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_cpd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
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: 2021-05-21 00:00:00.000000000 Z
11
+ date: 2021-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails