effective_cpd 1.4.0 → 1.4.2

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: 3b0933a04c3fbbcd4f6aa4676848f9f2d3a707a97b199f25ee3439562d73049d
4
+ data.tar.gz: 3b8f990c0c13f8112ed97ea24133dcf2cf1cb5f66fc2464ec8b686c83dc81aa7
5
5
  SHA512:
6
- metadata.gz: 1114387c7ae09280a38b2f446456c1ae76d51647fd50b945dcf0d830f8e27b6aee44a6187f3f113b484939f5d89b59d78e1482416f9c9ba37b92e8be35b907da
7
- data.tar.gz: 93c2ce6aa6b583bc33517291b44145a80542ac8545f6012a38ff5ed92a85fb7876a3f110d507034965b55942065113fb47fe0aa1c0994c44daf63613badd2e45
6
+ metadata.gz: 5c4a5860719ddb9336610bca4d45d17c23756d46255f94cc18719d45853401275e1458e89ad0cb2b6f97e3b7db8f6cd3932ca869843f8da806d4fd07ddcf82fd
7
+ data.tar.gz: a513062879d048f4401040b1114fdbbb2e8622ea836d306824ec3f1aeec54846235a932283954821578ccb4aac79e0daba26da46cc0c91678f5dc22e8ae1106b
@@ -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,11 +62,12 @@
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?
69
70
  = link_to('Back', '#', class: 'btn btn-secondary', 'data-cpd-back-activity': true)
70
71
  - else
71
72
  - url = effective_cpd.cpd_statement_cpd_statement_activity_path(statement, cpd_statement_activity)
72
- = link_to('Delete', url, class: 'btn btn-danger', 'data-confirm': "Really delete?", 'data-method': :delete)
73
+ = link_to('Delete', url, class: 'btn btn-danger', 'data-confirm': "Really delete?", 'data-disable-with': 'Deleting...', 'data-method': :delete)
@@ -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.2'
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.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: 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