effective_cpd 1.4.0 → 1.4.1

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: 10907aa7ee22755cd4b27d3e0fba90d6297dce95948e18c43b6e7a24f60d5f03
4
- data.tar.gz: f2f2c72a7d1ea65c420583d7e2749dec93793b0395f4a2a4253f440c6f862f05
3
+ metadata.gz: 15a9526456ab27ed3cc2dca6c6c368afe97e478282d66083cfb45e10250071c8
4
+ data.tar.gz: 4394265758150e1a979fa5cb000f22f5153c7c7a5be772e4b90d2795376697f4
5
5
  SHA512:
6
- metadata.gz: 1114387c7ae09280a38b2f446456c1ae76d51647fd50b945dcf0d830f8e27b6aee44a6187f3f113b484939f5d89b59d78e1482416f9c9ba37b92e8be35b907da
7
- data.tar.gz: 93c2ce6aa6b583bc33517291b44145a80542ac8545f6012a38ff5ed92a85fb7876a3f110d507034965b55942065113fb47fe0aa1c0994c44daf63613badd2e45
6
+ metadata.gz: bffcf39a42c4481b6e51425e0ff373b9a6670c2e9c01027099d4f3abe299fdf428ba601123e38f17f136abdd5f95cec8a35560839524dcd29c69bf3cdb653d9b
7
+ data.tar.gz: e427677d3c6ec195b01b0b22c9022ce4eac3c40fa04eeeb873da3a7573e2b8a68e076cc8151f684f9a0b0c11fe1804cc63ce77c9554d50823dfb54b9ed9e1614
@@ -14,7 +14,12 @@ module Effective
14
14
  # Redirect the remote form back to the activities page
15
15
  on :save, redirect: -> {
16
16
  statement = resource.cpd_statement
17
- effective_cpd.cpd_cycle_cpd_statement_build_path(statement.cpd_cycle, statement, :activities)
17
+
18
+ if params[:commit] == 'Save and Add Another'
19
+ effective_cpd.cpd_cycle_cpd_statement_build_path(statement.cpd_cycle, statement, :activities, activities: :new)
20
+ else
21
+ effective_cpd.cpd_cycle_cpd_statement_build_path(statement.cpd_cycle, statement, :activities)
22
+ end
18
23
  }
19
24
 
20
25
  def permitted_params
@@ -62,7 +62,8 @@
62
62
 
63
63
  .mb-3
64
64
  = f.submit do
65
- = f.save 'Save Activity'
65
+ = f.save "Save"
66
+ = f.save "Save and Add Another"
66
67
 
67
68
  %div{style: 'position: absolute; left: 0;'}
68
69
  - if f.object.new_record?
@@ -4,7 +4,9 @@
4
4
  .col-9
5
5
  %h1= resource.cpd_cycle
6
6
 
7
- .activities-index
7
+ - activities = (params[:activities] == 'new' ? :new : :index)
8
+
9
+ .activities-index{style: ('display: none;' unless activities == :index)}
8
10
  = render('layout') do
9
11
  - if resource.cpd_cycle.all_steps_content.present?
10
12
  .mb-2= resource.cpd_cycle.all_steps_content.to_s
@@ -22,5 +24,5 @@
22
24
  = f.hidden_field :current_step
23
25
  = f.submit 'Save and Continue', center: true
24
26
 
25
- .activities-new{style: 'display: none;'}
27
+ .activities-new{style: ('display: none;' unless activities == :new)}
26
28
  = render('activities_new', cpd_statement: resource)
@@ -1,3 +1,3 @@
1
1
  module EffectiveCpd
2
- VERSION = '1.4.0'
2
+ VERSION = '1.4.1'
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: 1.4.0
4
+ version: 1.4.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: 2023-03-02 00:00:00.000000000 Z
11
+ date: 2023-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails