Skip to content

Commit

Permalink
button
Browse files Browse the repository at this point in the history
  • Loading branch information
yigefaxian committed Sep 8, 2024
1 parent cabb36c commit e122ae4
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="button is-fullwidth justify-content-space-between is-light">
<div data-controller="modify" data-modify-submit-value="true" data-modify-step-value="1" class="button is-fullwidth justify-content-space-between is-light">
<div>
<span><%= component_part.part.name %></span>
<% if component_part.part.price.to_d > 0 %>
Expand All @@ -12,14 +12,18 @@
<%= check_box_tag 'production_parts_attributes[][part_id]', component_part.part_id, @production.part_ids.include?(component_part.part_id), disabled: component.disabled?(@production.part_ids, component_part.part_id), data: { action: 'custom#toggle', part_taxon_id: component.part_taxon_id }, class: 'weui-check display-none', id: "part_#{component_part.part_id}", form: 'edit_custom' %>
</div>
<div>
<% if @production.part_ids.include?(component_part.part_id) %>
<button data-action="modify#minus" class="button_to mr-1">
<i class="fa-solid fa-xl fa-minus text-grey"></i>
</button>
<%= number_field_tag 'production_parts_attributes[][number]', component_part.min, form: 'edit_custom', class: 'text-centered', style: 'width: 3rem' %>
<% end %>
<% if @production.part_ids.include?(component_part.part_id) %>
<button data-action="modify#minus" class="button_to mr-1">
<i class="fa-solid fa-xl fa-minus text-grey"></i>
</button>
<%= number_field_tag 'production_parts_attributes[][number]', component_part.min, data: { action: 'change->input#form focus->input#blank', modify_target: 'input' }, form: 'edit_custom', class: 'text-centered', style: 'width: 3rem' %>
<button data-action="modify#plus" class="button_to ml-1">
<i class="fa-solid fa-xl fa-plus text-grey"></i>
</button>
<% else %>
<button data-action="modify#plus" class="button_to ml-1">
<i class="fa-solid fa-xl fa-plus text-grey"></i>
</button>
<% end %>
</div>
</div>

0 comments on commit e122ae4

Please sign in to comment.