Allow opening multiple new/edit forms

Closes #30
This commit is contained in:
2024-12-21 17:52:45 +01:00
parent e5cf3dc0ae
commit d726e92445
14 changed files with 95 additions and 116 deletions

View File

@@ -1,9 +1,14 @@
require 'core_ext/big_decimal_scientific_notation'
ActiveSupport.on_load :active_record do
ActiveModel::Validations::NumericalityValidator.prepend CoreExt::ActiveModel::Validations::NumericalityValidatesPrecisionAndScale
end
ActiveSupport.on_load :action_dispatch_system_test_case do
prepend CoreExt::ActionDispatch::SystemTesting::TestHelpers::ScreenshotHelperUniqueId
end
ActiveSupport.on_load :action_view do
ActionView::RecordIdentifier.prepend CoreExt::ActionView::RecordIdentifierWithSuffix
end
ActiveSupport.on_load :active_record do
ActiveModel::Validations::NumericalityValidator
.prepend CoreExt::ActiveModel::Validations::NumericalityValidatesPrecisionAndScale
end

View File

@@ -15,24 +15,8 @@ ActiveSupport.on_load :turbo_streams_tag_builder do
action_all :enable, targets, allow_inferred_rendering: false
end
def blur_all
action :blur, nil, allow_inferred_rendering: false
end
def focus(target)
action :focus, target, allow_inferred_rendering: false
end
def insert_form(target, content = nil, **rendering, &block)
if target.is_a? Symbol
action :prepend_form, target, content, **rendering, &block
else
action :after_form, target, content, **rendering, &block
end
end
def replace_form(target, content = nil, **rendering, &block)
action :replace_form, target, content, **rendering, &block
def hide(target)
action :hide, target, allow_inferred_rendering: false
end
def close_form(target)

View File

@@ -57,10 +57,10 @@ en:
users: Users
units:
unit:
add_subunit: Subunit
new_subunit: Subunit
delete_unit: Delete
index:
add_unit: Add unit
new_unit: Add unit
import_units: Import
no_items: There are no configured units. You can Add some or Import from defaults.
top_level_drop: Drop here to reposition into top-level unit