Sha256: bfbc05f5f7b7d0ca5f2d57d6d80d8b4f5ef90a5cb86ddb46a9d4204b64864873

Contents?: true

Size: 1.71 KB

Versions: 6

Compression:

Stored size: 1.71 KB

Contents

<div id="standard-form--relation-<%= field_setting.id %>" class="standard-form--relation form-item">

<%# TODO: refactor in order to have a single depenedent field, not one per instance type %>

	<% if field_setting.accepted_structures.select{|s| s.instance_type == "component"}.any? %>
		<%= ff.input :dependent_component_ids, collection: get_relationable_components(field_setting), 
			as: :select,
			input_html: { multiple: true, class: 'select2-item' },
			label: field_setting.name.capitalize,
			hint: field_setting.description,
			value_method: :id,
			checked: ff.object.dependent_component_ids, 
			include_blank: false, 
			include_hidden: false,
			placeholder: t('binda.select_placeholder') %>
	<% end %>

	<% if field_setting.accepted_structures.select{|s| s.instance_type == "board"}.any? %>
		<%= ff.input :dependent_board_ids, collection: get_relationable_boards(field_setting), 
			as: :select, 
			input_html: { multiple: true, class: 'select2-item' }, 
			label: field_setting.name.capitalize,
			hint: field_setting.description,
			value_method: :id, 
			checked: ff.object.dependent_board_ids, 
			include_blank: false, 
			include_hidden: false,
			placeholder: t('binda.select_placeholder') %>
	<% end %>

	<% unless field_setting.accepted_structures.any? %>
		<div class="form-group">
			<div class="control-label-wrap">
				<label class="control-label"><%= field_setting.name.capitalize %></label>
			</div>
			<p><%= t('binda.relation_warning') %></p>
		</div>
	<% end %>

	<%= ff.input :field_setting_id, as: :hidden, input_html: { value: field_setting.id } %>
	<%= ff.input :id, as: :hidden, input_html: { value: ff.object.id } %>
	<%= ff.input :fieldable_id, as: :hidden %>
	<%= ff.input :fieldable_type, as: :hidden %>
</div>

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
binda-0.1.5 app/views/binda/fieldable/_form_item_relation.html.erb
binda-0.1.4 app/views/binda/fieldable/_form_item_relation.html.erb
binda-0.1.3 app/views/binda/fieldable/_form_item_relation.html.erb
binda-0.1.2 app/views/binda/fieldable/_form_item_relation.html.erb
binda-0.1.1 app/views/binda/fieldable/_form_item_relation.html.erb
binda-0.1.0 app/views/binda/fieldable/_form_item_relation.html.erb