Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix expand notes field when editing order #13214

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions app/views/spree/admin/orders/_note.html.haml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
%table.index.edit-note-table
%tr.edit-note.hidden.total
%td{ colspan: "5", data: { controller: "input-char-count" }, style: "position: relative;" }
%label
%label{ for: "note" }
= t(".note_label")
= text_field_tag :note, @order.note, { maxLength: 280, data: { "input-char-count-target": "input" } }
= text_area_tag :note, @order.note, { id: "note", rows: 3, maxLength: 280, data: { "input-char-count-target": "input" }, style: "width: 100%;" }
%span.edit-note-count{ data: { "input-char-count-target": "count" }, style: "position: absolute; right: 7px; top: 7px; font-size: 11px;" }

%td.actions
Expand All @@ -15,7 +15,8 @@
- if order.note.present?
%strong
= t(".note_label")
= order.note
%pre{ style: "font-family: inherit;" }
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's needed because now we have a text area field and sure is now able to enter new lines in the notes.
We have to use this pre tag to support the display of new lines. Moreover, this tag uses a different font-family by default, so using inherit to use the default application one.

= order.note
- else
= t(".no_note_present")

Expand Down
Loading