set/rule/rule_form.rb in card-mod-rules-0.14.2 vs set/rule/rule_form.rb in card-mod-rules-0.15.0
- old
+ new
@@ -1,17 +1,33 @@
format :html do
view :rule_form, cache: :never, unknown: true do
- @success_view ||= :open
- @rule_context ||= card
- @form_type ||= :overlay
+ prepare_rule_form_options
wrap do
edit_rule_form @success_view do
[
hidden_tags(success: @edit_rule_success),
haml(:rule_form)
].join
end
+ end
+ end
+
+ def prepare_rule_form_options
+ @success_view ||= :open
+ @rule_context ||= card
+ @form_type ||= :overlay
+ @edit_rule_success = edit_rule_success @success_view
+ end
+
+ view :rule_form_card_editor, cache: :never, unknown: true do
+ prepare_rule_form_options
+
+ wrap true, class: "card-editor slotter" do
+ [
+ rules_type_formgroup,
+ rule_content_formgroup
+ ]
end
end
def form_type
@form_type || :overlay