1 <%# Copyright (C) The Arvados Authors. All rights reserved.
3 SPDX-License-Identifier: AGPL-3.0 %>
8 Parameters received from the caller/requestor of the modal are
9 attached to the action button (.btn-primary) as follows:
11 action_class -- string -- added as a pseudoclass to the action button.
13 action_href -- string -- will be available at $(btn).attr('data-action-href')
15 action_data -- json-encoded object -- will be at $(btn).data('action-data')
17 action_data_form_params -- array -- for each X in this array, the
18 value of params[X] during this "show chooser" request will be in
19 $(btn).data('action-data-from-params')[X].
24 $('body > .modal-container').html("<%= escape_javascript(render partial: 'choose.html', locals: {multiple: multiple}) %>");
25 $('body > .modal-container .modal').modal('show');
26 $('body > .modal-container .modal .modal-footer .btn-primary').
27 addClass('<%= j params[:action_class] %>').
28 attr('data-action-href', '<%= j params[:action_href] %>').
29 attr('data-method', '<%= j params[:action_method] %>').
30 data('action-data', <%= raw params[:action_data] %>).
31 data('action-data-from-params', <%= raw params.select { |k,v| k.in?(params[:action_data_from_params] || []) }.to_json %>);