effective_cpd 1.6.3 → 1.6.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 922313bd91077ecfcc7021a812ef4b90bc3872b79827b4347a2d6e75a0edf483
4
- data.tar.gz: 309a23f429945e56441cbe20f60f279c31bd62326aabe0d2fa4bf8762c1dd26e
3
+ metadata.gz: cd0911046fcabd42cad5f51a9d1839bb13da67a67276d78bc4c0a3414a1d0e85
4
+ data.tar.gz: 1f16f8296435282c808e2fb1e5e4aeff7e0aa1ba40c252c478ff1dd955a930e6
5
5
  SHA512:
6
- metadata.gz: fe546f711f3899bd5bfd5354d248fcfa5e1a8e82fcf5271c365b24d99902c9bf2c5618032d781d12852263c231d615ecfefb468128f829bc2b991181a0ee93c0
7
- data.tar.gz: 3bf62bf5078dfb8a6eb6bc448f44f2542af644eb9ddc145b2a35a612047ce9631d2a8442df40606ebd26c1d9b7cf8cf197ad8668f03cc536ebe74a323a9d3a13
6
+ metadata.gz: 3bf52660128e824a470059d1399cc8321038a87d67bd56c101d4f57b959c9ecf58e577e0fb0d9e31abe5f3a5cb5c1c2cf88ebf134043fffd5570eeea67d7f7d9
7
+ data.tar.gz: e242876c24636b77819f64835edc02c187776532389be838658999e2cd1136a93f67d24ea7a4e8181d1346f250989647ab58208f13a77c7884f151159d68e12f
@@ -25,9 +25,8 @@ class EffectiveCpdAvailableCyclesDatatable < Effective::Datatable
25
25
  end
26
26
 
27
27
  collection do
28
- raise('expected a current_user') unless current_user.present?
29
-
30
- completed = EffectiveCpd.CpdStatement.completed.where(user: current_user)
31
- Effective::CpdCycle.available.where.not(id: completed.select('cpd_cycle_id as id'))
28
+ completed = EffectiveCpd.CpdStatement.completed.where(user: attributes[:user] || current_user)
29
+ Effective::CpdCycle.available.where.not(id: completed.select(:cpd_cycle_id))
32
30
  end
31
+
33
32
  end
@@ -26,10 +26,7 @@ class EffectiveCpdCompletedStatementsDatatable < Effective::Datatable
26
26
  end
27
27
 
28
28
  collection do
29
- raise('expected a current_user') unless current_user.present?
30
- user = (current_user.class.find(attributes[:user_id]) if attributes[:user_id])
31
-
32
- EffectiveCpd.CpdStatement.completed.where(user: user || current_user).includes(:cpd_cycle)
29
+ EffectiveCpd.CpdStatement.completed.where(user: attributes[:user] || current_user).includes(:cpd_cycle)
33
30
  end
34
31
 
35
32
  end
@@ -33,6 +33,7 @@ module EffectiveCpdStatement
33
33
  log_changes(except: :wizard_steps) if respond_to?(:log_changes)
34
34
 
35
35
  has_many_attached :files
36
+ has_many_purgable :files
36
37
 
37
38
  attr_accessor :current_user
38
39
  attr_accessor :current_step
@@ -3,7 +3,8 @@ module Effective
3
3
  attr_accessor :max_score
4
4
  attr_accessor :importing
5
5
 
6
- belongs_to :cpd_statement
6
+ belongs_to :cpd_statement # This works just fine without the polymorphic
7
+
7
8
  belongs_to :cpd_category
8
9
  belongs_to :cpd_activity
9
10
 
@@ -4,7 +4,7 @@
4
4
  %p
5
5
  #{cpd_targets_label} set the requirements checked when submitting a #{cpd_statement_label}
6
6
 
7
- %table.table
7
+ %table.table.table-striped.table-hover.table-sm
8
8
  %thead
9
9
  %th= cpd_cycle_label
10
10
  %th Default Requirements
@@ -29,11 +29,10 @@
29
29
  %tr
30
30
  %td= link_to(cpd_cycle, effective_cpd.edit_admin_cpd_cycle_path(cpd_cycle), target: '_blank')
31
31
  %td
32
- %p
33
- = pluralize(default_target, cpd_credit_label.downcase)
34
- = default_required_to_submit ? 'required' : 'targeted'
35
- and
36
- = collection.find { |value| value.last == default_required_to_submit }.first.downcase
32
+ = pluralize(default_target, cpd_credit_label.downcase)
33
+ = default_required_to_submit ? 'required' : 'targeted'
34
+ and
35
+ = collection.find { |value| value.last == default_required_to_submit }.first.downcase
37
36
 
38
37
  %td
39
38
  .row
@@ -0,0 +1,6 @@
1
+ %h2 Agreements
2
+ = f.check_box :confirm_read, label: "Yes, I have read the above content and agreements"
3
+ = f.check_box :confirm_factual, label: "Yes, I declare all provided information to be factual and complete"
4
+
5
+ %h2 Resume
6
+ = f.file_field :files, label: 'Attach resume', hint: "Please attach your resume or other #{cpd_name_label} related documents"
@@ -1,20 +1,3 @@
1
1
  = card('Agreements') do
2
- %table.table
3
- %tbody
4
- %tr
5
- %th Read all contents and agreements
6
- %td= cpd_statement.confirm_read ? 'Yes' : 'No'
7
-
8
- %tr
9
- %th Declared all information factual
10
- %td= cpd_statement.confirm_factual ? 'Yes' : 'No'
11
-
12
- %tr
13
- %th Attachments
14
- %td
15
- - if cpd_statement.files.blank?
16
- None
17
- - else
18
- %ul
19
- - cpd_statement.files.each do |file|
20
- = link_to(file.filename, url_for(file), target: '_blank')
2
+ = effective_table_with(cpd_statement) do |f|
3
+ = render('effective/cpd_statements/agreement_fields', f: f)
@@ -10,11 +10,6 @@
10
10
  = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
11
11
  = f.hidden_field :current_step
12
12
 
13
- %h2 Agreements
14
- = f.check_box :confirm_read, label: "Yes, I have read the above content and agreements"
15
- = f.check_box :confirm_factual, label: "Yes, I declare all provided information to be factual and complete"
16
-
17
- %h2 Resume
18
- = f.file_field :files, label: 'Attach resume', hint: "Please attach your resume or other #{cpd_name_label} related documents"
13
+ = render('effective/cpd_statements/agreement_fields', f: f)
19
14
 
20
15
  = f.submit 'Save and Continue', center: true
@@ -20,6 +20,7 @@ en:
20
20
  effective/cpd_statement_activity: 'CPD Statement Activity'
21
21
  effective/cpd_category: 'CPD Category'
22
22
  effective/cpd_target: 'CPD Target'
23
+ effective/cpd_rule: 'CPD Rule'
23
24
 
24
25
  attributes:
25
26
  # Application namespace
@@ -37,3 +38,6 @@ en:
37
38
  # Effective namespace
38
39
  effective/cpd_statement_activity:
39
40
  cpd_cycle: 'CPD Period'
41
+
42
+ effective/cpd_rule:
43
+ cpd_cycle: 'CPD Period'
@@ -1,3 +1,3 @@
1
1
  module EffectiveCpd
2
- VERSION = '1.6.3'
2
+ VERSION = '1.6.5'
3
3
  end
data/lib/effective_cpd.rb CHANGED
@@ -33,6 +33,10 @@ module EffectiveCpd
33
33
  cpd_statement_class_name&.constantize || Effective::CpdStatement
34
34
  end
35
35
 
36
+ def self.CpdCycle
37
+ Effective::CpdCycle
38
+ end
39
+
36
40
  def self.CpdAudit
37
41
  cpd_audit_class_name&.constantize || Effective::CpdAudit
38
42
  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: 1.6.3
4
+ version: 1.6.5
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: 2023-04-12 00:00:00.000000000 Z
11
+ date: 2023-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -441,6 +441,7 @@ files:
441
441
  - app/views/effective/cpd_statements/_activities_edit.html.haml
442
442
  - app/views/effective/cpd_statements/_activities_new.html.haml
443
443
  - app/views/effective/cpd_statements/_activities_table.html.haml
444
+ - app/views/effective/cpd_statements/_agreement_fields.html.haml
444
445
  - app/views/effective/cpd_statements/_agreements.html.haml
445
446
  - app/views/effective/cpd_statements/_cpd_statement.html.haml
446
447
  - app/views/effective/cpd_statements/_layout.html.haml