effective_resources 1.18.1 → 1.18.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0823eab342743da2a61c1b174cad39ffc77c6602c8422488bd32c113148b066f'
|
4
|
+
data.tar.gz: 3958c07bc7d38c1c3de867e699b899fddc1833e029b7b639635a08b9a92b9bdc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 180567d91706dee43b3ae5ab9e09e9f1abe0f1f352daa1bbf69ed3110564814ddacbc542d8293d5df8093dc94a36d8547a6f4814e307b6966f5ca7e49e7a34a9
|
7
|
+
data.tar.gz: 9852aac45f8341b0e27509d1b82c59f5d739eb3d1194daad74f6f1c1a4e7a29a0705a90dedd15945fa2af14c6cc546429d6f07db559d8785b182fa0a6a2d0c3b
|
@@ -262,4 +262,32 @@ module EffectiveResourcesHelper
|
|
262
262
|
controller.class.try(:effective_wizard_controller?) && defined?(resource) && resource.draft?
|
263
263
|
end
|
264
264
|
|
265
|
+
def wizard_card(resource, &block)
|
266
|
+
raise('expected a block') unless block_given?
|
267
|
+
raise('expected an acts_as_wizard resource') unless resource.class.respond_to?(:acts_as_wizard?)
|
268
|
+
|
269
|
+
step = resource.render_step
|
270
|
+
raise('expected a render_step') unless step.present?
|
271
|
+
|
272
|
+
title = resource.wizard_step_title(step)
|
273
|
+
raise("expected a title for step #{step}") unless title.present?
|
274
|
+
|
275
|
+
link = if edit_effective_wizard? && resource.can_visit_step?(step)
|
276
|
+
link_to('Edit', wizard_path(step), title: "Edit #{title}")
|
277
|
+
end
|
278
|
+
|
279
|
+
content_tag(:div, class: 'card') do
|
280
|
+
content_tag(:div, class: 'card-body yo') do
|
281
|
+
content_tag(:div, class: 'row') do
|
282
|
+
content_tag(:div, class: 'col-sm') do
|
283
|
+
content_tag(:h5, title, class: 'card-title')
|
284
|
+
end +
|
285
|
+
content_tag(:div, class: 'col-sm-auto text-right') do
|
286
|
+
(link || '')
|
287
|
+
end
|
288
|
+
end + capture(&block)
|
289
|
+
end
|
290
|
+
end
|
291
|
+
end
|
292
|
+
|
265
293
|
end
|
@@ -29,6 +29,9 @@ module ActsAsWizard
|
|
29
29
|
|
30
30
|
attr_accessor :current_user
|
31
31
|
|
32
|
+
# Used by the view when rendering each partial. Not the current step.
|
33
|
+
attr_accessor :render_step
|
34
|
+
|
32
35
|
if Rails.env.test? # So our tests can override the required_steps method
|
33
36
|
cattr_accessor :test_required_steps
|
34
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_resources
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.18.
|
4
|
+
version: 1.18.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: 2022-
|
11
|
+
date: 2022-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|