effective_cpd 0.1.9 → 0.1.14
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 +4 -4
- data/README.md +3 -1
- data/app/assets/javascripts/effective_cpd/activities.js +13 -10
- data/app/assets/stylesheets/effective_cpd/_activities.scss +2 -0
- data/app/controllers/effective/cpd_statements_controller.rb +1 -1
- data/app/datatables/admin/effective_cpd_audits_datatable.rb +1 -1
- data/app/models/effective/cpd_audit.rb +1 -1
- data/app/models/effective/cpd_statement.rb +6 -0
- data/app/views/admin/cpd_audits/_status.html.haml +1 -1
- data/app/views/effective/cpd_audits/_summary.html.haml +1 -1
- data/app/views/effective/cpd_audits/cpd_audit_level_section.html.haml +1 -1
- data/app/views/effective/cpd_statement_activities/_cpd_statement_activity.html.haml +1 -0
- data/config/routes.rb +3 -1
- data/lib/effective_cpd/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: 2653c7ce3493be3cd984924514326ab6e899d2cf45f56d4551c1c649db81431c
|
4
|
+
data.tar.gz: cc4b83b1930e70c5a0ed9df43eaf199e936103edfd43835323e95a8df9c5273b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe5e11e6d7341491c05646e2e680fa10b1d3f203958816640469d1e03763f00deaaccadd56f39f90172ae3bda06ed65768c20a6110ff6d82bec46e08cd540b70
|
7
|
+
data.tar.gz: 0f867cee33de484ad41a3d8f7f0d9f4b57c8023ea3791429bc7cc77e305e950945084f56905527f256fe58c94d9bb850d304952d43b70856eb8e02cdf1a6f9b2
|
data/README.md
CHANGED
@@ -197,11 +197,13 @@ if user.admin?
|
|
197
197
|
can :manage, Effective::CpdCycle
|
198
198
|
can :manage, Effective::CpdRule
|
199
199
|
|
200
|
+
can([:index, :show], Effective::CpdStatement)
|
201
|
+
can(:unsubmit, Effective::CpdStatement) { |statement| statement.completed? }
|
202
|
+
|
200
203
|
can :manage, Effective::CpdAuditLevel
|
201
204
|
can :manage, Effective::CpdAuditLevelSection
|
202
205
|
can :manage, Effective::CpdAuditLevelQuestion
|
203
206
|
|
204
|
-
can :manage, Effective::CpdStatement
|
205
207
|
can :manage, Effective::CpdAudit
|
206
208
|
can :manage, Effective::CpdAuditReview
|
207
209
|
end
|
@@ -1,14 +1,8 @@
|
|
1
1
|
const initialize_effective_cpd_activities = function() {
|
2
|
-
const $obj = $('
|
2
|
+
const $obj = $('#cpd-statement-activities,.cpd-statement-activities')
|
3
3
|
|
4
4
|
if($obj.length > 0) {
|
5
|
-
$(
|
6
|
-
|
7
|
-
// When we click outside the New Activity or Edit Activity
|
8
|
-
$(document).on('mousedown touchstart', '.activities-new', function(event) { event.stopPropagation() });
|
9
|
-
$(document).on('mousedown touchstart', '.statement-activity', function(event) { event.stopPropagation() });
|
10
|
-
|
11
|
-
$obj.addClass('initialized')
|
5
|
+
$('body').addClass('effective-cpd-statement-activities')
|
12
6
|
}
|
13
7
|
};
|
14
8
|
|
@@ -50,6 +44,15 @@ $(document).on('click', '[data-cpd-collapse]', function(event) {
|
|
50
44
|
collapse_effective_cpd_activities()
|
51
45
|
});
|
52
46
|
|
47
|
+
// Click outside the activities anywehre on body
|
48
|
+
$(document).on('mousedown touchstart', 'body.effective-cpd-statement-activities', function(event) {
|
49
|
+
collapse_effective_cpd_activities()
|
50
|
+
});
|
51
|
+
|
52
|
+
// When we click outside the New Activity or Edit Activity
|
53
|
+
$(document).on('mousedown touchstart', 'body.effective-cpd-statement-activities .activities-new', function(event) { event.stopPropagation() });
|
54
|
+
$(document).on('mousedown touchstart', 'body.effective-cpd-statement-activities .statement-activity', function(event) { event.stopPropagation() });
|
55
|
+
|
53
56
|
// Initializers
|
54
|
-
$(document).ready(
|
55
|
-
$(document).on('turbolinks:load',
|
57
|
+
$(document).ready(initialize_effective_cpd_activities);
|
58
|
+
$(document).on('turbolinks:load', initialize_effective_cpd_activities);
|
@@ -22,7 +22,7 @@ module Effective
|
|
22
22
|
flash[:danger] = "You have already completed a statement for this #{cpd_cycle_label}."
|
23
23
|
redirect_to(root_path)
|
24
24
|
elsif existing.present?
|
25
|
-
flash[:success] = "You have been redirected to the #{resource_wizard_step_title(existing.next_step)} step."
|
25
|
+
flash[:success] = "You have been redirected to the #{resource_wizard_step_title(existing, existing.next_step)} step."
|
26
26
|
redirect_to effective_cpd.cpd_cycle_cpd_statement_build_path(existing.cpd_cycle, existing, existing.next_step)
|
27
27
|
end
|
28
28
|
end
|
@@ -39,7 +39,7 @@ module Admin
|
|
39
39
|
col :status
|
40
40
|
col :determination
|
41
41
|
|
42
|
-
col(:auditee_cpd_statements, label: 'Auditee Statements') do |cpd_audit|
|
42
|
+
col(:auditee_cpd_statements, label: 'Auditee Statements', visible: false) do |cpd_audit|
|
43
43
|
cpd_audit.user.cpd_statements.map do |cpd_statement|
|
44
44
|
content_tag(:div, class: 'col-resource_item') do
|
45
45
|
link_to(cpd_statement.to_s, effective_cpd.admin_cpd_statement_path(cpd_statement))
|
@@ -79,6 +79,11 @@ module Effective
|
|
79
79
|
update!(submitted_at: Time.zone.now)
|
80
80
|
end
|
81
81
|
|
82
|
+
# Called by admin only. This is an exceptional action
|
83
|
+
def unsubmit!
|
84
|
+
update!(wizard_steps: {}, submitted_at: nil, confirm_readonly: nil)
|
85
|
+
end
|
86
|
+
|
82
87
|
def in_progress?
|
83
88
|
submitted_at.blank?
|
84
89
|
end
|
@@ -86,6 +91,7 @@ module Effective
|
|
86
91
|
def completed?
|
87
92
|
submitted_at.present?
|
88
93
|
end
|
94
|
+
alias_method :submitted?, :completed?
|
89
95
|
|
90
96
|
def required_score
|
91
97
|
required_by_cycle = cpd_cycle&.required_score
|
data/config/routes.rb
CHANGED
@@ -34,7 +34,9 @@ EffectiveCpd::Engine.routes.draw do
|
|
34
34
|
resources :cpd_rules, only: [:index]
|
35
35
|
resources :cpd_special_rules, except: [:show]
|
36
36
|
|
37
|
-
resources :cpd_statements, only: [:index, :show]
|
37
|
+
resources :cpd_statements, only: [:index, :show] do
|
38
|
+
post :unsubmit, on: :member
|
39
|
+
end
|
38
40
|
|
39
41
|
resources :cpd_audit_levels, except: [:show]
|
40
42
|
resources :cpd_audit_level_questions, except: [:show]
|
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.
|
4
|
+
version: 0.1.14
|
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-
|
11
|
+
date: 2021-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|