Add pickup date to order select box in Messages#new

This commit is contained in:
Patrick Gansterer 2019-11-15 21:03:19 +01:00
parent 5b04b65cd8
commit 7fcfd75fe3
3 changed files with 4 additions and 1 deletions

View file

@ -104,7 +104,8 @@
#messagegroup
= f.input :messagegroup_id, :as => :select, include_blank: false, :collection => Messagegroup.undeleted.order(:name)
#order
= f.input :order_id, :as => :select, include_blank: false, :collection => Order.finished_not_closed.order('pickup DESC').includes(:supplier).limit(25)
= f.input :order_id, :as => :select, include_blank: false, :collection => Order.finished_not_closed.order('pickup DESC').includes(:supplier).limit(25),
:label_method => ->(obj){ t('.order_item', supplier_name: obj.supplier.name, pickup: format_date(obj.pickup)) }, :input_html => {class: 'input-xxlarge'}
#recipients
= f.input :recipient_tokens, :input_html => { 'data-pre' => User.where(id: @message.recipients_ids).map(&:token_attributes).to_json }
= f.input :private, inline_label: t('.hint_private')

View file

@ -92,6 +92,7 @@ de:
wiki: Wiki (Abschnitt Mailing-Liste)
message: Nachricht
no_user_found: Kein/e Benutzer/in gefunden
order_item: "%{supplier_name} (Abholung: %{pickup})"
reply_to: Diese Nachricht ist eine Antwort auf eine andere %{link}.
search: Suche ...
search_user: Nach Bernutzer/in suchen

View file

@ -97,6 +97,7 @@ en:
wiki: Wiki (page Mailing-List)
message: message
no_user_found: No user found
order_item: "%{supplier_name} (Pickup: %{pickup})"
reply_to: This message is an reply to an other %{link}.
search: Search ...
search_user: Search user