active_scaffold 3.7.12 → 4.0.0.rc1
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 +4 -4
- data/CHANGELOG.rdoc +9 -23
- data/README.md +3 -2
- data/app/assets/config/active_scaffold_manifest.js +3 -0
- data/app/assets/javascripts/active_scaffold.js.erb +24 -34
- data/app/assets/javascripts/jquery/active_scaffold.js +41 -58
- data/app/assets/javascripts/jquery/date_picker_bridge.js.erb +1 -1
- data/app/assets/stylesheets/active_scaffold_colors.scss +0 -7
- data/app/assets/stylesheets/active_scaffold_extensions.css.erb +2 -2
- data/app/assets/stylesheets/active_scaffold_jquery_ui.css.erb +7 -7
- data/app/assets/stylesheets/active_scaffold_layout.css +57 -30
- data/app/views/active_scaffold_overrides/_add_existing_form.html.erb +10 -10
- data/app/views/active_scaffold_overrides/_base_form.html.erb +21 -21
- data/app/views/active_scaffold_overrides/_create_form.html.erb +10 -7
- data/app/views/active_scaffold_overrides/_create_form_on_list.html.erb +5 -5
- data/app/views/active_scaffold_overrides/_field_search.html.erb +6 -6
- data/app/views/active_scaffold_overrides/_form.html.erb +11 -14
- data/app/views/active_scaffold_overrides/_form_association.html.erb +21 -12
- data/app/views/active_scaffold_overrides/_form_association_footer.html.erb +19 -10
- data/app/views/active_scaffold_overrides/_form_association_record.html.erb +15 -21
- data/app/views/active_scaffold_overrides/_form_messages.html.erb +2 -2
- data/app/views/active_scaffold_overrides/_horizontal_subform.html.erb +7 -6
- data/app/views/active_scaffold_overrides/_human_conditions.html.erb +2 -2
- data/app/views/active_scaffold_overrides/_list.html.erb +15 -8
- data/app/views/active_scaffold_overrides/_list_calculations.html.erb +2 -3
- data/app/views/active_scaffold_overrides/_list_header.html.erb +2 -2
- data/app/views/active_scaffold_overrides/_list_inline_adapter.html.erb +5 -5
- data/app/views/active_scaffold_overrides/_list_messages.html.erb +12 -3
- data/app/views/active_scaffold_overrides/_list_pagination.html.erb +3 -3
- data/app/views/active_scaffold_overrides/_list_pagination_links.html.erb +4 -4
- data/app/views/active_scaffold_overrides/_list_record.html.erb +6 -6
- data/app/views/active_scaffold_overrides/_list_with_header.html.erb +4 -4
- data/app/views/active_scaffold_overrides/_messages.html.erb +1 -1
- data/app/views/active_scaffold_overrides/_refresh_list.js.erb +2 -2
- data/app/views/active_scaffold_overrides/_render_field.js.erb +4 -4
- data/app/views/active_scaffold_overrides/_row.html.erb +1 -1
- data/app/views/active_scaffold_overrides/_search.html.erb +6 -5
- data/app/views/active_scaffold_overrides/_show.html.erb +3 -3
- data/app/views/active_scaffold_overrides/_show_actions.html.erb +1 -1
- data/app/views/active_scaffold_overrides/_show_association.html.erb +1 -1
- data/app/views/active_scaffold_overrides/_show_association_horizontal.html.erb +1 -1
- data/app/views/active_scaffold_overrides/_show_association_vertical.html.erb +1 -1
- data/app/views/active_scaffold_overrides/_show_columns.html.erb +1 -1
- data/app/views/active_scaffold_overrides/_show_horizontal_record.html.erb +1 -1
- data/app/views/active_scaffold_overrides/_update_actions.html.erb +1 -1
- data/app/views/active_scaffold_overrides/_update_calculations.js.erb +2 -2
- data/app/views/active_scaffold_overrides/_update_column.js.erb +8 -7
- data/app/views/active_scaffold_overrides/_update_form.html.erb +5 -5
- data/app/views/active_scaffold_overrides/_update_messages.js.erb +1 -1
- data/app/views/active_scaffold_overrides/_vertical_subform.html.erb +4 -3
- data/app/views/active_scaffold_overrides/action_confirmation.html.erb +3 -3
- data/app/views/active_scaffold_overrides/add_existing.js.erb +6 -6
- data/app/views/active_scaffold_overrides/add_existing_form.html.erb +1 -1
- data/app/views/active_scaffold_overrides/add_tab.js.erb +15 -0
- data/app/views/active_scaffold_overrides/create.html.erb +1 -1
- data/app/views/active_scaffold_overrides/delete.html.erb +4 -4
- data/app/views/active_scaffold_overrides/destroy.js.erb +15 -13
- data/app/views/active_scaffold_overrides/edit_associated.js.erb +3 -3
- data/app/views/active_scaffold_overrides/field_search.html.erb +1 -1
- data/app/views/active_scaffold_overrides/form_messages.js.erb +1 -1
- data/app/views/active_scaffold_overrides/list.html.erb +1 -1
- data/app/views/active_scaffold_overrides/on_action_update.js.erb +13 -8
- data/app/views/active_scaffold_overrides/on_create.js.erb +34 -6
- data/app/views/active_scaffold_overrides/on_mark.js.erb +3 -3
- data/app/views/active_scaffold_overrides/on_update.js.erb +9 -9
- data/app/views/active_scaffold_overrides/render_field.js.erb +1 -1
- data/app/views/active_scaffold_overrides/render_field_inplace.html.erb +1 -1
- data/app/views/active_scaffold_overrides/row.js.erb +2 -2
- data/app/views/active_scaffold_overrides/search.html.erb +1 -1
- data/app/views/active_scaffold_overrides/show.html.erb +3 -3
- data/app/views/active_scaffold_overrides/update.html.erb +2 -2
- data/app/views/active_scaffold_overrides/update_column.js.erb +4 -4
- data/app/views/active_scaffold_overrides/update_row.js.erb +1 -1
- data/lib/active_scaffold/actions/common_search.rb +5 -3
- data/lib/active_scaffold/actions/core.rb +57 -32
- data/lib/active_scaffold/actions/create.rb +19 -17
- data/lib/active_scaffold/actions/delete.rb +10 -12
- data/lib/active_scaffold/actions/field_search.rb +28 -13
- data/lib/active_scaffold/actions/list.rb +34 -34
- data/lib/active_scaffold/actions/mark.rb +5 -5
- data/lib/active_scaffold/actions/nested.rb +64 -56
- data/lib/active_scaffold/actions/search.rb +2 -2
- data/lib/active_scaffold/actions/show.rb +5 -5
- data/lib/active_scaffold/actions/subform.rb +15 -4
- data/lib/active_scaffold/actions/update.rb +20 -20
- data/lib/active_scaffold/active_record_permissions.rb +4 -3
- data/lib/active_scaffold/attribute_params.rb +51 -50
- data/lib/active_scaffold/bridges/active_storage/active_storage_bridge.rb +4 -4
- data/lib/active_scaffold/bridges/active_storage/active_storage_helpers.rb +6 -2
- data/lib/active_scaffold/bridges/active_storage.rb +1 -1
- data/lib/active_scaffold/bridges/ancestry/ancestry_bridge.rb +3 -3
- data/lib/active_scaffold/bridges/bitfields/bitfields_bridge.rb +4 -1
- data/lib/active_scaffold/bridges/bitfields.rb +1 -1
- data/lib/active_scaffold/bridges/cancan/cancan_bridge.rb +9 -8
- data/lib/active_scaffold/bridges/cancan.rb +8 -8
- data/lib/active_scaffold/bridges/carrierwave/form_ui.rb +1 -1
- data/lib/active_scaffold/bridges/carrierwave/list_ui.rb +4 -3
- data/lib/active_scaffold/bridges/carrierwave.rb +2 -2
- data/lib/active_scaffold/bridges/chosen.rb +1 -5
- data/lib/active_scaffold/bridges/country_select/country_select_bridge_helper.rb +4 -2
- data/lib/active_scaffold/bridges/date_picker/ext.rb +20 -12
- data/lib/active_scaffold/bridges/date_picker/helper.rb +37 -33
- data/lib/active_scaffold/bridges/date_picker.rb +1 -4
- data/lib/active_scaffold/bridges/dragonfly/dragonfly_bridge.rb +1 -1
- data/lib/active_scaffold/bridges/dragonfly/list_ui.rb +3 -2
- data/lib/active_scaffold/bridges/dragonfly.rb +1 -1
- data/lib/active_scaffold/bridges/file_column/as_file_column_bridge.rb +3 -2
- data/lib/active_scaffold/bridges/file_column/file_column_helpers.rb +2 -1
- data/lib/active_scaffold/bridges/file_column/form_ui.rb +4 -9
- data/lib/active_scaffold/bridges/file_column/list_ui.rb +6 -3
- data/lib/active_scaffold/bridges/file_column/test/functional/file_column_keep_test.rb +3 -3
- data/lib/active_scaffold/bridges/file_column/test/mock_model.rb +1 -4
- data/lib/active_scaffold/bridges/file_column.rb +1 -0
- data/lib/active_scaffold/bridges/paper_trail/actions.rb +4 -2
- data/lib/active_scaffold/bridges/paper_trail/config.rb +1 -1
- data/lib/active_scaffold/bridges/paper_trail/helper.rb +1 -1
- data/lib/active_scaffold/bridges/paper_trail/paper_trail_bridge.rb +2 -1
- data/lib/active_scaffold/bridges/paperclip/list_ui.rb +3 -2
- data/lib/active_scaffold/bridges/paperclip/paperclip_bridge.rb +1 -1
- data/lib/active_scaffold/bridges/paperclip/paperclip_bridge_helpers.rb +10 -9
- data/lib/active_scaffold/bridges/paperclip.rb +2 -1
- data/lib/active_scaffold/bridges/record_select/helpers.rb +10 -11
- data/lib/active_scaffold/bridges/semantic_attributes/column.rb +3 -1
- data/lib/active_scaffold/bridges/tiny_mce/helpers.rb +3 -7
- data/lib/active_scaffold/bridges/tiny_mce.rb +2 -7
- data/lib/active_scaffold/bridges/usa_state_select/usa_state_select_helper.rb +7 -7
- data/lib/active_scaffold/bridges.rb +7 -5
- data/lib/active_scaffold/config/base.rb +20 -24
- data/lib/active_scaffold/config/core.rb +27 -39
- data/lib/active_scaffold/config/create.rb +1 -1
- data/lib/active_scaffold/config/delete.rb +9 -9
- data/lib/active_scaffold/config/field_search.rb +4 -9
- data/lib/active_scaffold/config/form.rb +3 -1
- data/lib/active_scaffold/config/list.rb +19 -15
- data/lib/active_scaffold/config/nested.rb +2 -2
- data/lib/active_scaffold/config/search.rb +5 -5
- data/lib/active_scaffold/config/show.rb +1 -1
- data/lib/active_scaffold/config/subform.rb +1 -1
- data/lib/active_scaffold/config/update.rb +4 -5
- data/lib/active_scaffold/configurable.rb +2 -1
- data/lib/active_scaffold/constraints.rb +16 -11
- data/lib/active_scaffold/core.rb +25 -27
- data/lib/active_scaffold/data_structures/action_columns.rb +10 -3
- data/lib/active_scaffold/data_structures/action_link.rb +19 -9
- data/lib/active_scaffold/data_structures/action_links.rb +20 -26
- data/lib/active_scaffold/data_structures/actions.rb +3 -3
- data/lib/active_scaffold/data_structures/association/abstract.rb +8 -4
- data/lib/active_scaffold/data_structures/association/active_mongoid.rb +1 -0
- data/lib/active_scaffold/data_structures/association/active_record.rb +1 -4
- data/lib/active_scaffold/data_structures/column.rb +368 -327
- data/lib/active_scaffold/data_structures/columns.rb +3 -2
- data/lib/active_scaffold/data_structures/nested_info.rb +6 -5
- data/lib/active_scaffold/data_structures/proxy_column.rb +68 -0
- data/lib/active_scaffold/data_structures/set.rb +7 -4
- data/lib/active_scaffold/data_structures/sorting.rb +21 -12
- data/lib/active_scaffold/engine.rb +12 -12
- data/lib/active_scaffold/extensions/action_controller_rendering.rb +5 -5
- data/lib/active_scaffold/extensions/action_controller_rescueing.rb +1 -1
- data/lib/active_scaffold/extensions/action_view_rendering.rb +29 -31
- data/lib/active_scaffold/extensions/ice_nine.rb +2 -1
- data/lib/active_scaffold/extensions/localize.rb +2 -2
- data/lib/active_scaffold/extensions/name_option_for_datetime.rb +1 -1
- data/lib/active_scaffold/extensions/routing_mapper.rb +5 -4
- data/lib/active_scaffold/extensions/unsaved_associated.rb +3 -2
- data/lib/active_scaffold/finder.rb +71 -78
- data/lib/active_scaffold/helpers/action_link_helpers.rb +37 -49
- data/lib/active_scaffold/helpers/association_helpers.rb +3 -2
- data/lib/active_scaffold/helpers/controller_helpers.rb +18 -16
- data/lib/active_scaffold/helpers/form_column_helpers.rb +69 -53
- data/lib/active_scaffold/helpers/human_condition_helpers.rb +17 -15
- data/lib/active_scaffold/helpers/id_helpers.rb +5 -5
- data/lib/active_scaffold/helpers/list_column_helpers.rb +35 -38
- data/lib/active_scaffold/helpers/pagination_helpers.rb +4 -4
- data/lib/active_scaffold/helpers/search_column_helpers.rb +25 -34
- data/lib/active_scaffold/helpers/show_column_helpers.rb +7 -4
- data/lib/active_scaffold/helpers/tabs_helpers.rb +88 -0
- data/lib/active_scaffold/helpers/view_helpers.rb +15 -13
- data/lib/active_scaffold/marked_model.rb +1 -2
- data/lib/active_scaffold/orm_checks.rb +6 -4
- data/lib/active_scaffold/paginator.rb +3 -2
- data/lib/active_scaffold/registry.rb +5 -0
- data/lib/active_scaffold/tableless.rb +24 -14
- data/lib/active_scaffold/version.rb +4 -4
- data/lib/active_scaffold.rb +8 -34
- data/lib/generators/active_scaffold/controller_generator.rb +20 -20
- data/lib/generators/active_scaffold/install_generator.rb +4 -8
- data/lib/generators/active_scaffold/resource_generator.rb +31 -31
- data/lib/tasks/brakeman.rake +1 -1
- data/shoulda_macros/macros.rb +14 -14
- metadata +11 -232
- data/app/assets/javascripts/prototype/active_scaffold.js +0 -1249
- data/app/assets/javascripts/prototype/active_scaffold_chosen.js +0 -0
- data/app/assets/javascripts/prototype/dhtml_history.js +0 -870
- data/app/assets/javascripts/prototype/form_enhancements.js +0 -117
- data/app/assets/javascripts/prototype/tiny_mce_bridge.js +0 -17
- data/app/views/active_scaffold_overrides/_list_messages_content.html.erb +0 -8
- data/app/views/active_scaffold_overrides/_new_record.js.erb +0 -15
- data/app/views/active_scaffold_overrides/_popup_adapter.html.erb +0 -20
- data/app/views/active_scaffold_overrides/_refresh_create_form.js.erb +0 -12
- data/lib/active_scaffold/bridges/calendar_date_select/as_cds_bridge.rb +0 -58
- data/lib/active_scaffold/bridges/calendar_date_select.rb +0 -17
- data/lib/active_scaffold/data_structures/action_link_separator.rb +0 -13
- data/lib/active_scaffold/extensions/cow_proxy.rb +0 -102
- data/test/active_scaffold_config_mock.rb +0 -33
- data/test/bridges/bridge_test.rb +0 -88
- data/test/bridges/date_picker_test.rb +0 -31
- data/test/bridges/paper_trail_test.rb +0 -16
- data/test/bridges/paperclip_test.rb +0 -85
- data/test/bridges/tiny_mce_test.rb +0 -61
- data/test/class_with_finder.rb +0 -42
- data/test/company.rb +0 -97
- data/test/config/base_test.rb +0 -17
- data/test/config/core_test.rb +0 -66
- data/test/config/create_test.rb +0 -72
- data/test/config/delete_test.rb +0 -35
- data/test/config/field_search_test.rb +0 -49
- data/test/config/list_test.rb +0 -134
- data/test/config/nested_test.rb +0 -55
- data/test/config/search_test.rb +0 -62
- data/test/config/show_test.rb +0 -45
- data/test/config/subform_test.rb +0 -19
- data/test/config/update_test.rb +0 -52
- data/test/const_mocker.rb +0 -32
- data/test/data_structures/action_columns_test.rb +0 -112
- data/test/data_structures/action_link_test.rb +0 -79
- data/test/data_structures/action_links_test.rb +0 -78
- data/test/data_structures/actions_test.rb +0 -25
- data/test/data_structures/association_column_test.rb +0 -41
- data/test/data_structures/column_test.rb +0 -186
- data/test/data_structures/columns_test.rb +0 -68
- data/test/data_structures/set_test.rb +0 -84
- data/test/data_structures/sorting_test.rb +0 -148
- data/test/data_structures/standard_column_test.rb +0 -23
- data/test/data_structures/validation_reflection_test.rb +0 -69
- data/test/data_structures/virtual_column_test.rb +0 -23
- data/test/extensions/action_view_rendering_test.rb +0 -20
- data/test/extensions/active_record_test.rb +0 -44
- data/test/extensions/routing_mapper_test.rb +0 -73
- data/test/helpers/form_column_helpers_test.rb +0 -34
- data/test/helpers/list_column_helpers_test.rb +0 -53
- data/test/helpers/pagination_helpers_test.rb +0 -65
- data/test/helpers/search_column_helpers_test.rb +0 -15
- data/test/misc/active_record_permissions_test.rb +0 -193
- data/test/misc/attribute_params_test.rb +0 -460
- data/test/misc/calculation_test.rb +0 -39
- data/test/misc/configurable_test.rb +0 -97
- data/test/misc/constraints_test.rb +0 -209
- data/test/misc/convert_numbers_format_test.rb +0 -171
- data/test/misc/finder_test.rb +0 -124
- data/test/misc/lang_test.rb +0 -10
- data/test/misc/parse_datetime_test.rb +0 -159
- data/test/misc/render_test.rb +0 -9
- data/test/misc/tableless_test.rb +0 -56
- data/test/mock_app/.gitignore +0 -2
- data/test/mock_app/Rakefile +0 -7
- data/test/mock_app/app/assets/config/manifest.js +0 -0
- data/test/mock_app/app/controllers/addresses_controller.rb +0 -4
- data/test/mock_app/app/controllers/application_controller.rb +0 -10
- data/test/mock_app/app/controllers/buildings_controller.rb +0 -4
- data/test/mock_app/app/controllers/cars_controller.rb +0 -5
- data/test/mock_app/app/controllers/contacts_controller.rb +0 -4
- data/test/mock_app/app/controllers/floors_controller.rb +0 -6
- data/test/mock_app/app/controllers/people_controller.rb +0 -8
- data/test/mock_app/app/controllers/roles_controller.rb +0 -4
- data/test/mock_app/app/helpers/application_helper.rb +0 -3
- data/test/mock_app/app/models/address.rb +0 -3
- data/test/mock_app/app/models/building.rb +0 -9
- data/test/mock_app/app/models/car.rb +0 -3
- data/test/mock_app/app/models/contact.rb +0 -3
- data/test/mock_app/app/models/file_model.rb +0 -31
- data/test/mock_app/app/models/floor.rb +0 -8
- data/test/mock_app/app/models/person.rb +0 -12
- data/test/mock_app/app/models/role.rb +0 -3
- data/test/mock_app/app/views/active_scaffold_overrides/_form.html.erb +0 -2
- data/test/mock_app/app/views/active_scaffold_overrides/list.html.erb +0 -2
- data/test/mock_app/app/views/people/_first_name_form_column.html.erb +0 -2
- data/test/mock_app/app/views/people/_form.html.erb +0 -2
- data/test/mock_app/app/views/people/list.html.erb +0 -2
- data/test/mock_app/config/application.rb +0 -14
- data/test/mock_app/config/boot.rb +0 -7
- data/test/mock_app/config/database.yml +0 -16
- data/test/mock_app/config/environment.rb +0 -6
- data/test/mock_app/config/environments/development.rb +0 -24
- data/test/mock_app/config/environments/production.rb +0 -49
- data/test/mock_app/config/environments/test.rb +0 -34
- data/test/mock_app/config/initializers/backtrace_silencers.rb +0 -7
- data/test/mock_app/config/initializers/inflections.rb +0 -10
- data/test/mock_app/config/initializers/mime_types.rb +0 -5
- data/test/mock_app/config/initializers/secret_token.rb +0 -11
- data/test/mock_app/config/initializers/session_store.rb +0 -8
- data/test/mock_app/config/initializers/wrap_parameters.rb +0 -14
- data/test/mock_app/config/locales/en.yml +0 -5
- data/test/mock_app/config/routes.rb +0 -17
- data/test/mock_app/config.ru +0 -4
- data/test/mock_app/db/schema.rb +0 -68
- data/test/mock_app/db/test.sqlite3 +0 -1
- data/test/model_stub.rb +0 -64
- data/test/performance/list_cars_performance_test.rb +0 -34
- data/test/performance/list_people_performance_test.rb +0 -31
- data/test/performance_test_help.rb +0 -3
- data/test/run_all.rb +0 -6
- data/test/test_helper.rb +0 -71
- data/vendor/assets/javascripts/getprototypeof.js +0 -12
@@ -1,8 +1,11 @@
|
|
1
|
-
<%
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
<%
|
2
|
+
form_action ||= :create
|
3
|
+
cancel_link = true if cancel_link.nil?
|
4
|
+
headline ||= active_scaffold_config.send(form_action).label(active_scaffold_config.add_sti_create_links? ? @record.class.model_name.human(count: 1) : nil)
|
5
|
+
%>
|
6
|
+
<%= render partial: 'base_form', locals: {xhr: xhr ||= nil,
|
7
|
+
form_action: form_action,
|
8
|
+
method: method ||= :post,
|
9
|
+
cancel_link: cancel_link,
|
10
|
+
headline: headline} %>
|
8
11
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<% cancel_link = false if cancel_link.nil? %>
|
2
|
-
<%= render :
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
<%= render partial: 'base_form', locals: {xhr: xhr ||= nil,
|
3
|
+
form_action: form_action ||= :create,
|
4
|
+
method: method ||= :post,
|
5
|
+
cancel_link: cancel_link,
|
6
|
+
headline: headline ||= active_scaffold_config.create.label(active_scaffold_config.add_sti_create_links? ? @record.class.model_name.human(count: 1) : nil)} %>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
xhr ||= request.xhr?
|
5
5
|
options = {
|
6
6
|
id: element_form_id(action: 'search'),
|
7
|
-
class:
|
7
|
+
class: 'as_form search',
|
8
8
|
remote: xhr,
|
9
9
|
data: {loading: true},
|
10
10
|
method: :get
|
@@ -27,10 +27,10 @@
|
|
27
27
|
<% end -%>
|
28
28
|
<% unless hiddens.empty? -%>
|
29
29
|
<li class="sub-section">
|
30
|
-
<% further_options_id = sub_section_id(:
|
30
|
+
<% further_options_id = sub_section_id(sub_section: 'further_options') %>
|
31
31
|
<h5>
|
32
32
|
<%= as_(:optional_attributes) %>
|
33
|
-
<%= link_to_visibility_toggle(further_options_id,
|
33
|
+
<%= link_to_visibility_toggle(further_options_id, default_visible: false) %>
|
34
34
|
</h5>
|
35
35
|
<ol id ="<%= further_options_id %>" class="form" style="display:none;">
|
36
36
|
<% hiddens.each do |column| -%>
|
@@ -50,8 +50,8 @@
|
|
50
50
|
reset_attrs.merge! remote: true, data: {refresh: true}
|
51
51
|
end
|
52
52
|
%>
|
53
|
-
<%= submit_tag as_(submit_text), :
|
54
|
-
<%= link_to as_(:reset), url_for(url_options.merge(:
|
55
|
-
<%= loading_indicator_tag(:
|
53
|
+
<%= submit_tag as_(submit_text), class: 'submit' %>
|
54
|
+
<%= link_to as_(:reset), url_for(url_options.merge(search: '')), reset_attrs unless local_assigns[:skip_reset] %>
|
55
|
+
<%= loading_indicator_tag(action: :search) %>
|
56
56
|
</p>
|
57
57
|
</form>
|
@@ -1,31 +1,28 @@
|
|
1
1
|
<%
|
2
2
|
scope ||= nil
|
3
3
|
subsection_id ||= nil
|
4
|
+
tab_value ||= nil
|
5
|
+
tabbed_by ||= nil
|
6
|
+
tab_id ||= nil
|
4
7
|
show_unauthorized_columns = active_scaffold_config.send(form_action).show_unauthorized_columns if active_scaffold_config.actions.include? form_action
|
5
8
|
%>
|
6
|
-
<ol class="form" <%= "id=#{subsection_id}" unless subsection_id.nil? %> <%=
|
9
|
+
<ol class="form" <%= "id=#{subsection_id}" unless subsection_id.nil? %> <%= 'style="display: none;"'.html_safe if columns.collapsed %>>
|
7
10
|
<% columns.each_column(for: @record, crud_type: (:read if show_unauthorized_columns)) do |column| %>
|
8
11
|
<% column_css_class = column.css_class unless column.css_class.nil? || column.css_class.is_a?(Proc) %>
|
9
12
|
<% renders_as = column_renders_as(column) %>
|
10
|
-
<% authorized = show_unauthorized_columns || renders_as == :subsection ? @record.authorized_for?(:
|
11
|
-
<% if renders_as == :subsection -%>
|
12
|
-
|
13
|
-
<% subsection_id = sub_section_id(:sub_section => column.label) %>
|
13
|
+
<% authorized = show_unauthorized_columns || renders_as == :subsection ? @record.authorized_for?(crud_type: form_action, column: column.name) : true %>
|
14
|
+
<% if renders_as == :subsection || renders_as == :tabbed -%>
|
15
|
+
<% next unless authorized %>
|
14
16
|
<li class="sub-section <%= column_css_class %>">
|
15
|
-
|
16
|
-
<%= column.label %>
|
17
|
-
<%= link_to_visibility_toggle(subsection_id, {:default_visible => !column.collapsed}) -%>
|
18
|
-
</h5>
|
19
|
-
<%= render :partial => 'form', :locals => { :columns => column, :subsection_id => subsection_id, :form_action => form_action, :scope => scope } %>
|
17
|
+
<%= render_subsection(column, @record, scope, form_action) %>
|
20
18
|
</li>
|
21
|
-
<% end %>
|
22
19
|
<% elsif renders_as == :subform and authorized -%>
|
23
|
-
<%= content_tag :li, active_scaffold_subform_attributes(column, column_css_class) do %>
|
24
|
-
<%= render_column(column, @record, renders_as, scope) %>
|
20
|
+
<%= content_tag :li, active_scaffold_subform_attributes(column, column_css_class, tab_id: tab_id) do %>
|
21
|
+
<%= render_column(column, @record, renders_as, scope, tabbed_by: (column.options[:tabbed_by] || tabbed_by if tabbed_by), tab_value: tab_value, tab_id: tab_id) %>
|
25
22
|
<% end %>
|
26
23
|
<% else -%>
|
27
24
|
<li class="form-element <%= 'required' if column.required?(action_for_validation?(@record)) %> <%= column.form_ui %> <%= column_css_class %>">
|
28
|
-
<%= render_column(column, @record, renders_as, scope, !authorized) %>
|
25
|
+
<%= render_column(column, @record, renders_as, scope, only_value: !authorized) %>
|
29
26
|
</li>
|
30
27
|
<% end -%>
|
31
28
|
<% end -%>
|
@@ -1,15 +1,24 @@
|
|
1
1
|
<%
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
2
|
+
tabbed_by ||= nil
|
3
|
+
tab_value ||= nil
|
4
|
+
tab_id ||= nil
|
5
|
+
associated = column.association.singular? ? [parent_record.send(column.name)].compact : parent_record.send(column.name).to_a
|
6
|
+
associated = associated.select { |record| record.send(tabbed_by) == tab_value } if tabbed_by && tab_value
|
7
|
+
if column.show_blank_record?(associated)
|
8
|
+
show_blank_record = build_associated(column.association, parent_record) do |blank_record|
|
9
|
+
blank_record.send(:"#{tabbed_by}=", tab_value) if tabbed_by && tab_value
|
10
|
+
end
|
11
|
+
end
|
12
|
+
disable_required_for_new = @disable_required_for_new
|
13
|
+
@disable_required_for_new = !show_blank_record.nil? unless column.association.singular? && column.required?(action_for_validation?(parent_record))
|
14
|
+
subform_div_id = "#{sub_form_id(association: column.name, tab_id: tab_id, id: parent_record.id || generated_id(parent_record) || 99_999_999_999)}-div"
|
9
15
|
|
10
|
-
# render footer before rendering associated records, fixes create new on self-associations
|
11
|
-
# so generated_id for blank associated record is not used in create new button
|
12
|
-
footer = render(
|
16
|
+
# render footer before rendering associated records, fixes create new on self-associations
|
17
|
+
# so generated_id for blank associated record is not used in create new button
|
18
|
+
footer = render('form_association_footer', {
|
19
|
+
parent_record: parent_record, column: column, associated: associated, scope: scope, subform_div_id: subform_div_id,
|
20
|
+
tabbed_by: tabbed_by, tab_value: tab_value
|
21
|
+
})
|
13
22
|
-%>
|
14
23
|
<h5>
|
15
24
|
<%= column.label -%>
|
@@ -18,8 +27,8 @@ footer = render(:partial => 'form_association_footer', :locals => {:parent_recor
|
|
18
27
|
<%= content_tag :span, column.description, class: 'description' if column.description.present? %>
|
19
28
|
<div id ="<%= subform_div_id %>" <%= 'style="display: none;"'.html_safe if column.collapsed -%>>
|
20
29
|
<%# HACK: to be able to delete all associated records %>
|
21
|
-
<%= hidden_field_tag "#{(opts = active_scaffold_input_options(column, scope, :
|
22
|
-
<%= render
|
30
|
+
<%= hidden_field_tag "#{(opts = active_scaffold_input_options(column, scope, object: parent_record))[:name]}[0]", '', id: "#{opts[:id]}_0" if column.association.collection? %>
|
31
|
+
<%= render subform_partial_for_column(column), column: column, parent_record: parent_record, associated: associated, show_blank_record: show_blank_record, scope: scope, tab_id: tab_id %>
|
23
32
|
<%= footer -%>
|
24
33
|
</div>
|
25
34
|
<%
|
@@ -13,36 +13,45 @@ return unless show_add_new or show_add_existing
|
|
13
13
|
temporary_id = generated_id(parent_record) if parent_record.new_record?
|
14
14
|
controller_path = active_scaffold_controller_for(parent_record.class).controller_path
|
15
15
|
parent_controller = (main_form_controller || controller).controller_path
|
16
|
-
url_options = {:
|
17
|
-
edit_associated_url = params_for(url_options.merge(:
|
18
|
-
|
16
|
+
url_options = {controller: controller_path, action: 'edit_associated', child_association: column.name, scope: scope, id: parent_record.to_param, generated_id: temporary_id, parent_controller: parent_controller}
|
17
|
+
edit_associated_url = params_for(url_options.merge(associated_id: '--ID--')) if show_add_existing
|
18
|
+
if show_add_new
|
19
|
+
if local_assigns[:tabbed_by]
|
20
|
+
url_options.merge! tabbed_by: tabbed_by, value: tab_value
|
21
|
+
if (tabbed_association = tabbed_by_association(column, tabbed_by))
|
22
|
+
url_options[:value] = tab_value.id
|
23
|
+
url_options[:value_type] = tab_value.class.base_class.sti_name if tabbed_association.polymorphic?
|
24
|
+
end
|
25
|
+
end
|
26
|
+
add_new_url = params_for(url_options)
|
27
|
+
end
|
19
28
|
|
20
29
|
-%>
|
21
30
|
<div class="footer-wrapper">
|
22
31
|
<div class="footer">
|
23
32
|
<% if show_add_new -%>
|
24
33
|
<% if column.association.collection?
|
25
|
-
add_label = as_(:create_another, :
|
34
|
+
add_label = as_(:create_another, model: column.association.klass.model_name.human)
|
26
35
|
add_class = 'as_create_another'
|
27
36
|
else
|
28
37
|
add_label = as_(:replace_with_new)
|
29
38
|
add_class = 'as_replace_with_new'
|
30
39
|
end
|
31
|
-
create_another_id = "#{
|
32
|
-
<%= link_to add_label, add_new_url, :
|
40
|
+
create_another_id = "#{subform_div_id}-create-another" %>
|
41
|
+
<%= link_to add_label, add_new_url, id: create_another_id, remote: true, class: "as-js-button #{add_class}", style: 'display: none;' %>
|
33
42
|
<% end -%>
|
34
43
|
|
35
|
-
<%= '|' if show_add_new
|
44
|
+
<%= '|' if show_add_new && show_add_existing %>
|
36
45
|
|
37
46
|
<% if show_add_existing -%>
|
38
|
-
<% if remote_controller
|
47
|
+
<% if remote_controller.respond_to?(:uses_record_select?) && remote_controller.uses_record_select? -%>
|
39
48
|
<%= link_to_record_select as_(:add_existing), remote_controller.controller_path, record_select_params_for_add_existing(column.association, edit_associated_url, parent_record) -%>
|
40
49
|
<% else -%>
|
41
50
|
<% select_options = options_from_collection_for_select(sorted_association_options_find(column.association, nil, parent_record), :to_param, :to_label)
|
42
|
-
add_existing_id = "#{
|
51
|
+
add_existing_id = "#{subform_div_id}-add-existing"
|
43
52
|
add_existing_label = column.association.collection? ? :add_existing : :replace_existing %>
|
44
53
|
<%= select_tag 'associated_id', content_tag(:option, as_(:_select_), value: '') + select_options %>
|
45
|
-
<%= link_to as_(add_existing_label), edit_associated_url, :
|
54
|
+
<%= link_to as_(add_existing_label), edit_associated_url, id: add_existing_id, remote: true, class: "as-js-button as_#{add_existing_label}", style: 'display: none;' %>
|
46
55
|
<% end -%>
|
47
56
|
<% end -%>
|
48
57
|
</div>
|
@@ -1,14 +1,13 @@
|
|
1
1
|
<%
|
2
2
|
record_column = column
|
3
|
-
|
4
|
-
readonly = (record.readonly? or not record.authorized_for?(:crud_type => :update))
|
3
|
+
readonly = record.readonly? || !record.authorized_for?(crud_type: :update)
|
5
4
|
crud_type = record.new_record? ? :create : (readonly ? :read : :update)
|
6
5
|
show_actions = false
|
7
6
|
locked ||= false
|
8
7
|
config = active_scaffold_config_for(record.class)
|
9
8
|
columns ||= config.subform.columns
|
10
9
|
scope = column_scope(record_column, scope, record)
|
11
|
-
options = active_scaffold_input_options(config.columns[record.class.primary_key], scope, :
|
10
|
+
options = active_scaffold_input_options(config.columns[record.class.primary_key], scope, object: record)
|
12
11
|
tr_id = "association-#{options[:id]}"
|
13
12
|
layout ||= config.subform.layout
|
14
13
|
|
@@ -34,14 +33,14 @@
|
|
34
33
|
columns_length = 0
|
35
34
|
columns_groups = []
|
36
35
|
-%>
|
37
|
-
<%= content_tag record_tag, :
|
36
|
+
<%= content_tag record_tag, class: 'sub-form-record' do %>
|
38
37
|
<% unless record.errors.empty? -%>
|
39
|
-
<%= content_tag error_tag, :
|
40
|
-
<% errors = active_scaffold_error_messages_for(:record, :
|
41
|
-
<%= error_inner_tag ? content_tag(error_inner_tag, errors, :
|
38
|
+
<%= content_tag error_tag, class: 'association-record-errors', id: element_messages_id(action: record.class.name.underscore, id: "#{parent_record.id}-#{index}") do %>
|
39
|
+
<% errors = active_scaffold_error_messages_for(:record, object: record) %>
|
40
|
+
<%= error_inner_tag ? content_tag(error_inner_tag, errors, colspan: (active_scaffold_config_for(record.class).subform.columns.length + 1 if error_inner_tag == :td)) : errors %>
|
42
41
|
<% end %>
|
43
42
|
<% end %>
|
44
|
-
<%= content_tag row_tag, :
|
43
|
+
<%= content_tag row_tag, id: tr_id, class: "association-record#{' association-record-new' if record.new_record?}#{' locked' if locked}" do %>
|
45
44
|
<% columns.each_column(for: record.class, crud_type: :read, flatten: flatten) do |column| %>
|
46
45
|
<%
|
47
46
|
if column.respond_to? :each_column
|
@@ -52,29 +51,24 @@
|
|
52
51
|
next unless in_subform?(column, parent_record, record_column)
|
53
52
|
columns_length += 1
|
54
53
|
show_actions = true
|
55
|
-
if !ActiveScaffold.nested_subforms && !readonly && column.association && column.form_ui.nil?
|
56
|
-
ActiveSupport::Deprecation.warn "Nested subforms are allowed now, set form_ui = :select for #{column.name} in controller for #{config.model.name}"
|
57
|
-
column = column.dup unless ActiveScaffold.threadsafe
|
58
|
-
column.form_ui = :select
|
59
|
-
end
|
60
54
|
|
61
55
|
col_class = default_col_class.clone
|
62
56
|
col_class << 'required' if column.required?(action_for_validation?(record))
|
63
57
|
col_class << column.css_class unless column.css_class.nil? || column.css_class.is_a?(Proc)
|
64
58
|
col_class << 'hidden' if column_renders_as(column) == :hidden
|
65
59
|
-%>
|
66
|
-
<%= content_tag column_tag, :
|
60
|
+
<%= content_tag column_tag, class: col_class.join(' ') do %>
|
67
61
|
<%= active_scaffold_render_subform_column(column, scope, crud_type, readonly, false, record) %>
|
68
62
|
<% end %>
|
69
63
|
<% end -%>
|
70
64
|
<% if show_actions -%>
|
71
|
-
<%= content_tag column_tag, :
|
65
|
+
<%= content_tag column_tag, class: 'actions' do %>
|
72
66
|
<% if record_column.association.collection? && !locked %>
|
73
67
|
<%
|
74
|
-
auth = [
|
75
|
-
auth, reason = record.authorized_for?(:
|
68
|
+
auth = %i[destroy delete_all delete].exclude?(record_column.association.dependent)
|
69
|
+
auth, reason = record.authorized_for?(crud_type: :delete, reason: true) unless auth
|
76
70
|
%>
|
77
|
-
<%= auth ? link_to(as_(:remove), '#', :
|
71
|
+
<%= auth ? link_to(as_(:remove), '#', class: 'destroy', id: "#{options[:id]}-destroy", data: {delete_id: tr_id}) : reason %>
|
78
72
|
<% end %>
|
79
73
|
<% unless record.new_record? %>
|
80
74
|
<input type="hidden" name="<%= options[:name] -%>" id="<%= options[:id] -%>" value="<%= record.id -%>" />
|
@@ -84,7 +78,7 @@
|
|
84
78
|
<% end %>
|
85
79
|
|
86
80
|
<% columns_groups.each do |columns_group| %>
|
87
|
-
<%= content_tag row_tag, :
|
81
|
+
<%= content_tag row_tag, class: 'associated-record' do %>
|
88
82
|
<% if layout == :vertical %>
|
89
83
|
<% columns_group.each_column(for: record.class, crud_type: :read, flatten: true) do |col| %>
|
90
84
|
<%
|
@@ -93,12 +87,12 @@
|
|
93
87
|
col_class << col.css_class unless col.css_class.nil? || col.css_class.is_a?(Proc)
|
94
88
|
col_class << 'hidden' if column_renders_as(col) == :hidden
|
95
89
|
%>
|
96
|
-
<%= content_tag column_tag, :
|
90
|
+
<%= content_tag column_tag, class: col_class, colspan: (columns_length if column_tag == :td) do %>
|
97
91
|
<%= active_scaffold_render_subform_column(col, scope, crud_type, readonly, false, record) %>
|
98
92
|
<% end %>
|
99
93
|
<% end %>
|
100
94
|
<% else %>
|
101
|
-
<%= content_tag column_tag, :
|
95
|
+
<%= content_tag column_tag, colspan: (columns_length if column_tag == :td) do %>
|
102
96
|
<% columns_group.each_column(for: record.class, crud_type: :read, flatten: true) do |col| %>
|
103
97
|
<%= active_scaffold_render_subform_column(col, scope, crud_type, readonly, true, record) %>
|
104
98
|
<% end %>
|
@@ -1,5 +1,5 @@
|
|
1
|
-
<%= render
|
1
|
+
<%= render 'messages' unless request.xhr? %>
|
2
2
|
|
3
3
|
<% unless @record.nil? %>
|
4
|
-
<%= active_scaffold_error_messages_for :record, :
|
4
|
+
<%= active_scaffold_error_messages_for :record, object_name: @record.class.model_name.human.downcase %>
|
5
5
|
<% end %>
|
@@ -1,12 +1,13 @@
|
|
1
|
-
<table id="<%= sub_form_list_id(association: column.name, id: parent_record&.id || generated_id(parent_record) ||
|
1
|
+
<table id="<%= sub_form_list_id(association: column.name, id: parent_record&.id || generated_id(parent_record) || 99_999_999_999, tab_id: local_assigns[:tab_id]) %>">
|
2
2
|
<%
|
3
|
-
header_record_class =
|
3
|
+
header_record_class = show_blank_record&.class || column.association.klass
|
4
|
+
record_partial_locals = {scope: scope, parent_record: parent_record, column: column, columns: local_assigns[:columns], layout: :horizontal}
|
4
5
|
-%>
|
5
|
-
<%= render
|
6
|
+
<%= render 'horizontal_subform_header', parent_record: parent_record, record_class: header_record_class, parent_column: column, columns: local_assigns[:columns] %>
|
6
7
|
|
7
|
-
<%= render partial: 'form_association_record', collection: associated,
|
8
|
-
<%= render
|
8
|
+
<%= render partial: 'form_association_record', collection: associated, as: :record, locals: record_partial_locals %>
|
9
|
+
<%= render 'form_association_record', record_partial_locals.merge(locked: true, index: associated.size, record: show_blank_record) if show_blank_record %>
|
9
10
|
<tfoot>
|
10
|
-
<%= render
|
11
|
+
<%= render 'horizontal_subform_footer', scope: scope, parent_record: parent_record, column: column %>
|
11
12
|
</tfoot>
|
12
13
|
</table>
|
@@ -1,3 +1,3 @@
|
|
1
|
-
<%= columns.
|
2
|
-
<%= tag
|
1
|
+
<%= columns.filter_map { |column| active_scaffold_human_condition_for(column) }.to_sentence %>
|
2
|
+
<%= tag.br if columns.present? && grouped_search? %>
|
3
3
|
<%= as_(:grouped_by, column: active_scaffold_grouped_by_label) if grouped_search? %>
|
@@ -3,7 +3,14 @@
|
|
3
3
|
<tbody>
|
4
4
|
<tr>
|
5
5
|
<td class="messages-container">
|
6
|
-
|
6
|
+
<p class="error-message message server-error" style="display:none;">
|
7
|
+
<%= as_(:internal_error).html_safe %>
|
8
|
+
<span class="error-500"><%= as_(:error_500).html_safe %></span>
|
9
|
+
<a href="#" class="close" title="<%= as_(:close).html_safe %>"><%= as_(:close).html_safe %></a>
|
10
|
+
</p>
|
11
|
+
<div id="<%= active_scaffold_messages_id -%>" class="action-messages">
|
12
|
+
<%= render 'messages' %>
|
13
|
+
</div>
|
7
14
|
</td>
|
8
15
|
</tr>
|
9
16
|
</tbody>
|
@@ -13,19 +20,19 @@
|
|
13
20
|
<thead>
|
14
21
|
<tr>
|
15
22
|
<% columns = list_columns %>
|
16
|
-
<%= render
|
23
|
+
<%= render 'list_column_headings', columns: columns %>
|
17
24
|
</tr>
|
18
25
|
</thead>
|
19
|
-
<%= render
|
20
|
-
<tbody class="records" id="<%= active_scaffold_tbody_id %>" data-refresh-record="<%= url_for(params_for(:
|
26
|
+
<%= render 'list_messages', columns: columns %>
|
27
|
+
<tbody class="records" id="<%= active_scaffold_tbody_id %>" data-refresh-record="<%= url_for(params_for(action: :index, id: '--ID--')) %>">
|
21
28
|
<% if !@page.empty? -%>
|
22
|
-
<%= render :
|
29
|
+
<%= render partial: 'list_record', collection: @page.items, locals: {hidden: false, columns: columns, action_links: active_scaffold_config.action_links.member} %>
|
23
30
|
<% end -%>
|
24
31
|
</tbody>
|
25
|
-
<% if columns.any?
|
32
|
+
<% if columns.any?(&:calculation?) -%>
|
26
33
|
<tfoot>
|
27
|
-
<%= render
|
34
|
+
<%= render 'list_calculations', columns: columns %>
|
28
35
|
</tfoot>
|
29
36
|
<% end -%>
|
30
37
|
</table>
|
31
|
-
<%= render
|
38
|
+
<%= render 'list_pagination' %>
|
@@ -1,9 +1,8 @@
|
|
1
|
-
<%
|
2
|
-
columns ||= list_columns -%>
|
1
|
+
<% columns ||= list_columns -%>
|
3
2
|
<tr id="<%= active_scaffold_calculations_id %>" class="active-scaffold-calculations">
|
4
3
|
<% columns.each do |column| -%>
|
5
4
|
<% if column.calculation? %>
|
6
|
-
<td id="<%= active_scaffold_calculations_id(:
|
5
|
+
<td id="<%= active_scaffold_calculations_id(column: column) %>"><%= render_column_calculation(column) %></td>
|
7
6
|
<% else %>
|
8
7
|
<td> </td>
|
9
8
|
<% end -%>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<% action_links = active_scaffold_config.action_links.collection -%>
|
2
2
|
<div class="actions">
|
3
|
-
<%= display_action_links(action_links, nil, :
|
4
|
-
<%= loading_indicator_tag(:
|
3
|
+
<%= display_action_links(action_links, nil, skip_unauthorized: true) unless action_links.empty? %>
|
4
|
+
<%= loading_indicator_tag(action: :table) %>
|
5
5
|
</div>
|
6
6
|
<h2><%= active_scaffold_config.list.user.label %></h2>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<%# nested_id, allows us to remove a nested scaffold programmatically %>
|
2
|
-
<tr class="inline-adapter" id="<%=
|
2
|
+
<tr class="inline-adapter" id="<%= element_row_id action: :nested %>">
|
3
3
|
<td class="inline-adapter-cell">
|
4
4
|
<% if successful? %>
|
5
5
|
<div class="<%= "#{params[:action]}-view" if params[:action] %> <%= "#{nested? ? nested.name : id_from_controller(params[:controller])}-view" %> view">
|
@@ -9,13 +9,13 @@
|
|
9
9
|
<% end %>
|
10
10
|
<%= javascript_tag do %>
|
11
11
|
setTimeout(function() {
|
12
|
-
var action_link = ActiveScaffold.ActionLink.get('<%=
|
12
|
+
var action_link = ActiveScaffold.ActionLink.get('<%= element_row_id(action: :nested) %>');
|
13
13
|
if (action_link) {
|
14
14
|
action_link.update_flash_messages('<%= escape_javascript(render('messages').strip) %>');
|
15
|
-
|
15
|
+
<% unless successful? %>
|
16
16
|
action_link.close();
|
17
|
-
ActiveScaffold.scroll_to(action_link.scaffold(), ActiveScaffold.config.scroll_on_close ==
|
18
|
-
|
17
|
+
ActiveScaffold.scroll_to(action_link.scaffold(), ActiveScaffold.config.scroll_on_close == 'checkInViewport');
|
18
|
+
<% end %>
|
19
19
|
}
|
20
20
|
}, 10);
|
21
21
|
<% end %>
|
@@ -2,14 +2,23 @@
|
|
2
2
|
<tbody class="messages">
|
3
3
|
<tr class="record even-record">
|
4
4
|
<td colspan="<%= column_count -%>" class="messages-container">
|
5
|
-
|
5
|
+
<% unless active_scaffold_config.list.messages_above_header %>
|
6
|
+
<p class="error-message message server-error" style="display:none;">
|
7
|
+
<%= as_(:internal_error).html_safe %>
|
8
|
+
<span class="error-500"><%= as_(:error_500).html_safe %></span>
|
9
|
+
<a href="#" class="close" title="<%= as_(:close).html_safe %>"><%= as_(:close).html_safe %></a>
|
10
|
+
</p>
|
11
|
+
<div id="<%= active_scaffold_messages_id -%>" class="action-messages">
|
12
|
+
<%= render 'messages' %>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
6
15
|
<%= content_tag :div, class: 'filtered-message',
|
7
16
|
style: ('display:none;' unless @filtered),
|
8
17
|
data: ({search: search_params || ''} if active_scaffold_config.store_user_settings && respond_to?(:search_params)) do %>
|
9
|
-
|
18
|
+
<%= @filtered.is_a?(Array) ? render('human_conditions', columns: @filtered) : as_(active_scaffold_config.list.filtered_message) %>
|
10
19
|
<% if active_scaffold_config.list.show_search_reset && @filtered -%>
|
11
20
|
<div class="reset">
|
12
|
-
<%= loading_indicator_tag(:
|
21
|
+
<%= loading_indicator_tag(action: :record, id: nil) %>
|
13
22
|
<%= render_action_link(active_scaffold_config.list.reset_link) %>
|
14
23
|
</div>
|
15
24
|
<% end -%>
|
@@ -1,10 +1,10 @@
|
|
1
1
|
<div class="active-scaffold-footer">
|
2
2
|
<% if active_scaffold_config.list.pagination != :infinite -%>
|
3
|
-
<div class="active-scaffold-found"><span class="active-scaffold-records"><%= @page.pager.count -%></span> <%=as_(:found, :
|
3
|
+
<div class="active-scaffold-found"><span class="active-scaffold-records"><%= @page.pager.count -%></span> <%= as_(:found, count: @page.pager.count) %></div>
|
4
4
|
<% end -%>
|
5
5
|
<% if active_scaffold_config.list.pagination -%>
|
6
|
-
<div class="active-scaffold-pagination<%=
|
7
|
-
<%= render
|
6
|
+
<div class="active-scaffold-pagination<%= ' auto-paginate' if active_scaffold_config.list.auto_pagination %>">
|
7
|
+
<%= render 'list_pagination_links', current_page: @page if @page.pager.infinite? || @page.pager.number_of_pages > 1 %>
|
8
8
|
</div>
|
9
9
|
<% end -%>
|
10
10
|
<br /><!-- to clear this block -->
|
@@ -1,9 +1,9 @@
|
|
1
1
|
<% unless current_page.nil? -%>
|
2
2
|
<% url_options = pagination_url_options -%>
|
3
|
-
<% options = {'data-page-history' => controller_id, :
|
3
|
+
<% options = {'data-page-history' => controller_id, remote: true, method: :get} -%>
|
4
4
|
|
5
|
-
<%= loading_indicator_tag :
|
6
|
-
<%= link_to as_(:previous), url_options.merge(:
|
5
|
+
<%= loading_indicator_tag action: :pagination %>
|
6
|
+
<%= link_to as_(:previous), url_options.merge(page: current_page.number - 1), options.merge(class: 'as_paginate previous') if current_page.prev? %>
|
7
7
|
<%= pagination_ajax_links current_page, url_options, options, active_scaffold_config.list.page_links_inner_window, active_scaffold_config.list.page_links_outer_window %>
|
8
|
-
<%= link_to as_(:next), url_options.merge(:
|
8
|
+
<%= link_to as_(:next), url_options.merge(page: current_page.number + 1), options.merge(class: 'as_paginate next') if current_page.next? %>
|
9
9
|
<% end -%>
|
@@ -1,16 +1,16 @@
|
|
1
1
|
<%
|
2
2
|
record = list_record if local_assigns[:list_record] # compat with render :partial :collection
|
3
3
|
columns ||= list_columns
|
4
|
-
row_id ||= element_row_id(:
|
5
|
-
tr_class = "#{cycle(
|
4
|
+
row_id ||= element_row_id(action: :list, id: record.id)
|
5
|
+
tr_class = "#{cycle('', 'even-record')} #{list_row_class(record)}"
|
6
6
|
action_links ||= active_scaffold_config.action_links.member
|
7
7
|
data_refresh ||= record.to_param
|
8
8
|
-%>
|
9
9
|
<%= content_tag :tr, list_row_attributes(tr_class, row_id, data_refresh) do %>
|
10
10
|
<% columns.each do |column| %>
|
11
|
-
<% authorized = record.authorized_for?(:
|
11
|
+
<% authorized = record.authorized_for?(crud_type: :read, column: column.name) -%>
|
12
12
|
<% column_value = authorized ? get_column_value(record, column) : empty_field_text -%>
|
13
|
-
<% attrs = column_attributes(column, record).merge(:
|
13
|
+
<% attrs = column_attributes(column, record).merge(class: column_class(column, column_value, record)) %>
|
14
14
|
|
15
15
|
<%= content_tag :td, authorized ? render_list_column(column_value, column, record) : column_value, attrs %>
|
16
16
|
<% end -%>
|
@@ -19,9 +19,9 @@ data_refresh ||= record.to_param
|
|
19
19
|
<td class="actions"><table>
|
20
20
|
<tr>
|
21
21
|
<td class="indicator-container">
|
22
|
-
<%= loading_indicator_tag(:
|
22
|
+
<%= loading_indicator_tag(action: :record, id: record.id) %>
|
23
23
|
</td>
|
24
|
-
<%= display_action_links(action_links, record, :
|
24
|
+
<%= display_action_links(action_links, record, level_0_tag: :td, for: record.persisted? ? record : record.class) %>
|
25
25
|
</tr>
|
26
26
|
</table></td>
|
27
27
|
<% end -%>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<%= content_tag(:div, id: active_scaffold_id, class: as_main_div_class, data: as_main_div_data) do %>
|
2
2
|
<div class="active-scaffold-header">
|
3
|
-
<%= render
|
3
|
+
<%= render 'list_header' %>
|
4
4
|
</div>
|
5
5
|
<table>
|
6
6
|
<tbody class="before-header" id="<%= before_header_id -%>">
|
@@ -9,7 +9,7 @@
|
|
9
9
|
<tr>
|
10
10
|
<td>
|
11
11
|
<div class="active-scaffold show_search-view <%= "#{id_from_controller params[:controller]}-view" %> view">
|
12
|
-
<%= render
|
12
|
+
<%= render active_scaffold_config.list.search_partial, xhr: true %>
|
13
13
|
</div>
|
14
14
|
</td>
|
15
15
|
</tr>
|
@@ -22,7 +22,7 @@
|
|
22
22
|
<tr>
|
23
23
|
<td>
|
24
24
|
<div class="active-scaffold create-view <%= "#{id_from_controller params[:controller]}-view" %> view">
|
25
|
-
<%= render
|
25
|
+
<%= render 'create_form_on_list' %>
|
26
26
|
</div>
|
27
27
|
</td>
|
28
28
|
</tr>
|
@@ -31,6 +31,6 @@
|
|
31
31
|
</tbody>
|
32
32
|
</table>
|
33
33
|
<div id="<%= active_scaffold_content_id-%>" class="as_content">
|
34
|
-
<%= render
|
34
|
+
<%= render 'list' %>
|
35
35
|
</div>
|
36
36
|
<% end %>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<% if @auto_pagination -%>
|
2
2
|
<% if @page.items.present? -%>
|
3
|
-
ActiveScaffold.append('<%= active_scaffold_tbody_id %>', '<%= escape_javascript(render(:
|
3
|
+
ActiveScaffold.append('<%= active_scaffold_tbody_id %>', '<%= escape_javascript(render(partial: 'list_record', collection: @page.items, locals: {hidden: false, columns: list_columns, action_links: active_scaffold_config.action_links.member})) %>');
|
4
4
|
|
5
5
|
<% if @page.pager.infinite? || @page.number < @page.pager.number_of_pages -%>
|
6
6
|
ActiveScaffold.auto_load_page('<%= url_for main_path_to_return %>', {auto_pagination: true, page: <%= @page.number + 1 %>});
|
@@ -17,7 +17,7 @@
|
|
17
17
|
ActiveScaffold.replace_html('<%= active_scaffold_content_id %>', '<%= escape_javascript(render('list')) %>');
|
18
18
|
<% end # @auto_pagination -%>
|
19
19
|
|
20
|
-
<% if
|
20
|
+
<% if !@auto_pagination && !@popstate && !embedded? && !local_assigns[:no_history] -%>
|
21
21
|
if (!jQuery('#<%= active_scaffold_id %>').is('.active-scaffold .active-scaffold')) {
|
22
22
|
ActiveScaffold.add_to_history(<%=raw request.original_url.to_json %>, <%=raw history_state.to_json %>);
|
23
23
|
}
|