Skip to content

Commit d28d3fb

Browse files
committed
Maintain Add button position
When it stays at the very end of the line, it's easier to add the same product again Without that change it's was easy to add and then remove on the next click
1 parent 20ceda9 commit d28d3fb

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

rails_application/app/views/orders/edit.html.erb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434
<th class="text-left py-2">Quantity</th>
3535
<th class="text-left py-2">Catalog Price</th>
3636
<th class="text-left py-2">Price</th>
37-
<th class="text-left py-2" colspan="3">Value</th>
37+
<th class="text-left py-2">Value</th>
38+
<th></th>
39+
<th></th>
3840
</tr>
3941
</thead>
4042

@@ -50,12 +52,12 @@
5052
<td class="py-2"><%= number_to_currency(product.price) %></td>
5153
<td class="py-2" id="<%= "orders_order_#{product.id}_price" %>"><%= number_to_currency(order_line&.price) %></td>
5254
<td class="py-2" id="<%= "orders_order_#{product.id}_value" %>"><%= number_to_currency(order_line&.value) %></td>
53-
<td class="py-2"><%= button_to "Add", add_item_order_path(id: @order_id, product_id: product.id), class: "hover:underline text-blue-500" %></td>
5455
<% if order_line.nil? %>
55-
<td class="py-2 text-right" id="<%= "orders_order_#{product.id}_remove_item_button" %>"></td>
56+
<td class="py-2" id="<%= "orders_order_#{product.id}_remove_item_button" %>"></td>
5657
<% else %>
57-
<td class="py-2 text-right" id="<%= "orders_order_#{product.id}_remove_item_button" %>"><%= button_to("Remove", remove_item_order_path(id: @order_id, product_id: product.id), class: "hover:underline text-blue-500") %></td>
58+
<td class="py-2" id="<%= "orders_order_#{product.id}_remove_item_button" %>"><%= button_to("Remove", remove_item_order_path(id: @order_id, product_id: product.id), class: "hover:underline text-blue-500") %></td>
5859
<% end %>
60+
<td class="py-2"><%= button_to "Add", add_item_order_path(id: @order_id, product_id: product.id), class: "hover:underline text-blue-500" %></td>
5961
</tr>
6062
<% end %>
6163
</tbody>

0 commit comments

Comments
 (0)