-
-
Notifications
You must be signed in to change notification settings - Fork 527
/
Copy path_form.html.erb
76 lines (67 loc) · 3.58 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<%= simple_form_for @item, remote: request.xhr?, html: {class: 'form-horizontal'} do |f| %>
<section class="content">
<div class="container-fluid">
<div class="row">
<!-- left column -->
<div class="col-md-12">
<!-- jquery validation -->
<div class="card card-primary">
<!-- /.card-header -->
<!-- form start -->
<div class="card-body">
<% if @item.kit.blank? %>
<%= render partial: "base_items/dropdown", object: f %>
<% end %>
<%= f.input :name, label: "Name", wrapper: :input_group do %>
<span class="input-group-text"><i class="fa fa-tag"></i></span>
<%= f.input_field :name, class: "form-control" %>
<% end %>
<div class='w-1/4'>
<%= f.input :item_category_id, label: 'Category', collection: @item_categories, hint: 'Categories can help organize and identify items' %>
</div>
<%= f.input :name, label: "Value per item", wrapper: :input_group do %>
<span class="input-group-text"><i class="fa fa-money"></i></span>
<%= f.input_field :value_in_dollars, class: "form-control" %>
<% end %>
<%= f.input :name, label: "Quantity Per Individual", wrapper: :input_group do %>
<%= f.input_field :distribution_quantity, class: "form-control", value: f.object.distribution_quantity || (f.object.kit_id.present? ? 1 : 50) %>
<% end %>
<% if current_user.has_cached_role?(Role::ORG_ADMIN, current_organization) %>
<%= f.input :name, label: "On hand minimum quantity", wrapper: :input_group do %>
<%= f.input_field :on_hand_minimum_quantity, input_html: {value: 0}, class: "form-control" %>
<% end %>
<%= f.input :name, label: "On hand recommended quantity", wrapper: :input_group do %>
<%= f.input_field :on_hand_recommended_quantity, class: "form-control" %>
<% end %>
<% end %>
<%= f.input :name, label: "Package size", wrapper: :input_group do %>
<%= f.input_field :package_size, class: "form-control", min: 0 %>
<% end %>
<% if Flipper.enabled?(:enable_packs) %>
<%= f.input :request_units, label: "Additional Custom Request Units" do %>
<%= f.association :request_units, as: :check_boxes, collection: current_organization.request_units, checked: selected_item_request_units(@item), label_method: :name, value_method: :id, class: "form-check-input" %>
<% end %>
<% end %>
<%= f.input :visible, label: "Item is Visible to Partners?", wrapper: :input_group do %>
<%= f.check_box :visible_to_partners, {class: "input-group-text", id: "visible_to_partners"}, "true", "false" %>
<% end %>
<%= f.label :additional_info, "Additional Information (Bank Use Only) " %> <i>(500 character max)</i>
<%= f.input :additional_info, label: false, maxlength: 500, wrapper: :input_group %>
</div>
<!-- /.card-body -->
<div class="card-footer">
<%= submit_button %>
</div>
</div>
<!-- /.card -->
</div>
<!--/.col (left) -->
<!-- right column -->
<div class="col-md-6">
</div>
<!--/.col (right) -->
</div>
<!-- /.row -->
</div><!-- /.container-fluid -->
</section>
<% end %>