267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
|
# File 'app/helpers/effective_resources_helper.rb', line 267
def wizard_card(resource, &block)
raise('expected a block') unless block_given?
raise('expected an acts_as_wizard resource') unless resource.class.respond_to?(:acts_as_wizard?)
step = resource.render_step
raise('expected a render_step') unless step.present?
title = resource.wizard_step_title(step)
raise("expected a title for step #{step}") unless title.present?
link = if edit_effective_wizard? && resource.can_visit_step?(step)
link_to('Edit', wizard_path(step), title: "Edit #{title}")
end
content_tag(:div, class: 'card') do
content_tag(:div, class: 'card-body') do
content_tag(:div, class: 'row') do
content_tag(:div, class: 'col-sm') do
content_tag(:h5, title, class: 'card-title')
end +
content_tag(:div, class: 'col-sm-auto text-right') do
(link || '')
end
end + capture(&block)
end
end
end
|