Skip to content

Commit

Permalink
Update: 酒フォームのノートを別フィールドセットにした
Browse files Browse the repository at this point in the history
  • Loading branch information
yonta committed Jul 31, 2024
1 parent 51087f2 commit a739e96
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 8 deletions.
1 change: 1 addition & 0 deletions app/views/sakes/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
<%= render(partial: "form_abstract", locals: { sake:, form: }) %>
<%= render(partial: "form_detail", locals: { sake:, form: }) %>
<%= render(partial: "form_review", locals: { sake:, form: }) %>
<%= render(partial: "form_note", locals: { sake:, form: }) %>
</div>
<% end %>
23 changes: 23 additions & 0 deletions app/views/sakes/_form_note.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<div class="accordion-item">
<h2 class="accordion-header" id="headingNote">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
data-bs-target="#collapseNote" aria-expanded="false" aria-controls="collapseNote">
<%= t(".note") %>
</button>
</h2>
<div id="collapseNote" class="accordion-collapse collapse"
aria-labelledby="headingNote" role="row"
data-bs-parent="#accordionNote">
<div class="accordion-body">
<div class="row g-4">
<fieldset class="col-12">
<div class="row gx-3">
<div class="col-12">
<%= form.text_area(:note, class: "form-control", data: { testid: "sake_note" }) %>
</div>
</div>
</fieldset>
</div>
</div>
</div>
</div>
8 changes: 0 additions & 8 deletions app/views/sakes/_form_review.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,6 @@
testid: "sake_rating",
}) %>
</fieldset>
<fieldset class="col-12">
<div class="row gx-3">
<div class="col-12 col-lg-6">
<%= form.label(:note, class: "form-label") %>
<%= form.text_area(:note, class: "form-control", data: { testid: "sake_note" }) %>
</div>
</div>
</fieldset>
</div>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions config/locales/views/sake.ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ ja:
measurement: :sakes.show_detail.measurement
form_review:
review: :sakes.show_review.review
form_note:
note: :sakes.show_note.note
float_button:
edit: :sakes.sake.edit
copy: 複製
Expand Down

0 comments on commit a739e96

Please sign in to comment.