Skip to content

Commit

Permalink
Merge pull request #749 from momocus/pr/issue748/fieldset-sakenote
Browse files Browse the repository at this point in the history
レビュー項にあった酒ノートを、新たな項にした
  • Loading branch information
momocus authored Nov 24, 2024
2 parents 78c2ae3 + a739e96 commit 3cc9616
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 21 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 @@ -106,14 +106,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
15 changes: 15 additions & 0 deletions app/views/sakes/_show_note.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<div class="row gy-3">
<div class="col-12">
<h2 class="fs-3 mb-0"><%= t(".note") %></h2>
</div>

<div class="col-12">
<div class="textbox">
<div class="text">
<div class="box">
<p><%= empty_to_default(sake.note, " ") %></p>
</div>
</div>
</div>
</div>
</div>
13 changes: 0 additions & 13 deletions app/views/sakes/_show_review.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,4 @@
</div>
</div>
</div>

<div class="col-lg-6 col-12">
<div class="textbox">
<div class="label">
<%= Sake.human_attribute_name(:note) %>
</div>
<div class="text">
<div class="box">
<p><%= empty_to_default(sake.note, " ") %></p>
</div>
</div>
</div>
</div>
</div>
4 changes: 4 additions & 0 deletions app/views/sakes/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
<%= render(partial: "show_review", locals: { sake: @sake }) %>
</div>

<div class="col-12">
<%= render(partial: "show_note", locals: { sake: @sake }) %>
</div>

<div class="col-12">
<div class="row justify-content-center">
<div class="col-auto">
Expand Down
4 changes: 4 additions & 0 deletions config/locales/views/sake.ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ ja:
unknown: 不明
show_review:
review: レビュー
show_note:
note: ノート
drink_button:
open: 開封する
confirm_open: "%{name} の栓を開ける?"
Expand Down Expand Up @@ -60,6 +62,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 3cc9616

Please sign in to comment.