Files
openfoodnetwork/app/views/spree/admin/orders/_note.html.haml
2024-02-22 15:01:13 +11:00

27 lines
1.2 KiB
Plaintext

%table.index.edit-note-table
%tr.edit-note.hidden.total
%td{ "colspan" => "5", "style" => "position: relative;", "data-controller" => "input-char-count" }
%label
= t(".note_label")
= text_field_tag :note, @order.note, { maxLength: 280, data: { "input-char-count-target": "input" } }
%span.edit-note-count{ "style" => "position: absolute; right: 7px; top: 7px; font-size: 11px;", "data-input-char-count-target" => "count" }
%td.actions
= link_to '', '', class: 'save-note icon_link icon-ok no-text with-tip', data: { action: 'save' }, title: I18n.t('actions.save')
= link_to '', '', class: 'cancel-note icon_link icon-cancel no-text with-tip', data: { action: 'cancel' }, title: I18n.t('actions.cancel')
%tr.show-note.total
%td{ :colspan => "5" }
- if order.note.present?
%strong
= t(".note_label")
= order.note
- else
= t(".no_note_present")
%td.actions
= link_to '', '', class: 'edit-note icon_link icon-edit no-text with-tip', data: { action: 'edit' }, title: Spree.t('edit')
- if @order.note.present?
= link_to '', '', class: 'delete-note icon_link icon-trash no-text with-tip', data: { action: 'remove' }, title: Spree.t('delete')