mirror of
https://github.com/rickbarrette/redmine_qbo_lineitems.git
synced 2026-04-02 07:01:59 -04:00
Fixed remove button functionality
This commit is contained in:
@@ -2,7 +2,10 @@
|
||||
|
||||
<% @issue.line_items.build if @issue.line_items.empty? && !readonly %>
|
||||
|
||||
<div class="box tabular" <%= 'data-nested-form data-wrapper-selector=".line-item"' unless readonly %>>
|
||||
<div class="box tabular"
|
||||
data-nested-form
|
||||
data-wrapper-selector=".line-item">
|
||||
|
||||
<p><strong><%= t :label_line_items %></strong></p>
|
||||
|
||||
<table class="list line-items-table">
|
||||
@@ -17,9 +20,11 @@
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody <%= 'data-nested-form-container' unless readonly %>>
|
||||
<tbody data-nested-form-container>
|
||||
<%= f.fields_for :line_items do |item_form| %>
|
||||
<%= render "line_items/line_item_fields", f: item_form, readonly: readonly %>
|
||||
<%= render "line_items/line_item_fields",
|
||||
f: item_form,
|
||||
readonly: readonly %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -27,14 +32,19 @@
|
||||
<% unless readonly %>
|
||||
<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, readonly: false %>
|
||||
<%= render "line_items/line_item_fields",
|
||||
f: item_form,
|
||||
readonly: false %>
|
||||
<% end %>
|
||||
</template>
|
||||
|
||||
<p>
|
||||
<button type="button" class="icon icon-add" data-nested-form-add>
|
||||
Add Line Item
|
||||
<button type="button"
|
||||
class="icon icon-add"
|
||||
data-nested-form-add>
|
||||
<%= l(:button_add) %>
|
||||
</button>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
@@ -1,6 +1,6 @@
|
||||
<tr class="line-item">
|
||||
<%= f.hidden_field :id %>
|
||||
<%= f.hidden_field :_destroy unless readonly %>
|
||||
<%= f.hidden_field :_destroy %>
|
||||
|
||||
<td>
|
||||
<%= f.text_field :description,
|
||||
@@ -31,7 +31,7 @@
|
||||
<td style="text-align:center;">
|
||||
<button type="button"
|
||||
class="icon-only icon-del"
|
||||
title="Remove"
|
||||
title="<%=l(:label_remove)%>"
|
||||
data-nested-form-remove>
|
||||
</button>
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user