forked from moonshine/spree-dropdown-variants-by-option
-
Notifications
You must be signed in to change notification settings - Fork 1
/
_form.html.erb
43 lines (39 loc) · 1.32 KB
/
_form.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<% hook :admin_option_type_edit_form do %>
<%- locals = {:f => f} -%>
<% hook :admin_option_type_edit_fields, locals do %>
<% f.field_container :name do %>
<%= f.label :name, t("name") %><br />
<%= f.text_field :name %>
<%= f.error_message_on :name %>
<% end %>
<% f.field_container :name do %>
<%= f.label :presentation, t("presentation") %><br />
<%= f.text_field :presentation %>
<%= f.error_message_on :presentation %>
<% end %>
<% end %>
<% hook :admin_option_type_edit_option_values, locals do %>
<h3><%= t("option_values") %></h3>
<table class="index">
<thead>
<tr>
<th><%= t("name") %></th>
<th><%= t("display") %></th>
<th></th>
</tr>
</thead>
<tbody id="option_values">
<%= f.render_associated_form(@option_type.option_values) %>
<tr id="none">
<td colspan="3"><%= @option_type.option_values.empty? ? t("none") : "" %></td>
</tr>
</tbody>
</table>
<% end %>
<% hook :admin_option_type_edit_buttons, locals do %>
<p>
<%= f.add_associated_link( icon('add') + ' ' + t("add_option_value"), @option_type.option_values.build,
{:onclick => "jQuery('#none').hide();", :class => 'iconlink'}) %>
</p>
<% end %>
<% end %>