mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-04-03 08:41:58 -04:00
Got the UI working
This commit is contained in:
@@ -1,31 +1,17 @@
|
||||
<%= form_with model: @issue do |f| %>
|
||||
<% @issue.line_items.build if @issue.line_items.empty? %>
|
||||
|
||||
<!-- Existing issue fields -->
|
||||
|
||||
<h3>Invoice Line Items</h3>
|
||||
|
||||
<div
|
||||
data-controller="nested-form"
|
||||
data-nested-form-wrapper-selector-value=".line-item"
|
||||
>
|
||||
<div data-nested-form-target="container">
|
||||
<%= f.fields_for :invoice_line_items do |item_form| %>
|
||||
<%= render "line_items/invoice_line_item_fields", f: item_form %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<template data-nested-form-target="template">
|
||||
<%= f.fields_for :invoice_line_items,
|
||||
LineItem.new,
|
||||
child_index: "NEW_RECORD" do |item_form| %>
|
||||
<%= render "line_items/invoice_line_item_fields", f: item_form %>
|
||||
<% end %>
|
||||
</template>
|
||||
|
||||
<button type="button" data-action="nested-form#add">
|
||||
Add Line Item
|
||||
</button>
|
||||
<div data-nested-form data-wrapper-selector=".line-item">
|
||||
<div data-nested-form-container>
|
||||
<%= f.fields_for :line_items do |item_form| %>
|
||||
<%= render "line_items/line_item_fields", f: item_form %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= f.submit %>
|
||||
<% end %>
|
||||
<template data-nested-form-template>
|
||||
<%= f.fields_for :line_items, LineItem.new, child_index: "NEW_RECORD" do |item_form| %>
|
||||
<%= render "line_items/line_item_fields", f: item_form %>
|
||||
<% end %>
|
||||
</template>
|
||||
|
||||
<button type="button" data-nested-form-add>Add Line Item</button>
|
||||
</div>
|
||||
@@ -2,12 +2,12 @@
|
||||
<%= f.hidden_field :id %>
|
||||
|
||||
<%= f.text_field :description, placeholder: "Description" %>
|
||||
<%= f.number_field :quantity, step: 1 ,placeholder: "Quantity"%>
|
||||
<%= f.number_field :quantity, step: 1, placeholder: "Quantity" %>
|
||||
<%= f.number_field :unit_price, step: 0.01, placeholder: "Unit Price" %>
|
||||
|
||||
<%= f.hidden_field :_destroy %>
|
||||
|
||||
<button type="button" data-action="nested-form#remove">
|
||||
<button type="button" data-nested-form-remove>
|
||||
Remove
|
||||
</button>
|
||||
</div>
|
||||
Reference in New Issue
Block a user