mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
33 lines
2.1 KiB
Plaintext
33 lines
2.1 KiB
Plaintext
= render partial: "/admin/order_cycles/order_cycle_top_buttons"
|
|
- content_for :page_actions do
|
|
- if can? :notify_producers, @order_cycle
|
|
%li
|
|
- mails_sent = @order_cycle.mails_sent?
|
|
- url = main_app.notify_producers_admin_order_cycle_path
|
|
- confirm_msg = "#{t('.notify_producers_tip')} #{t(:are_you_sure)}"
|
|
%a.button.icon-email.with-tip{ href: url, data: { method: 'post', confirm: confirm_msg }, 'data-powertip': t('.notify_producers_tip') }
|
|
= mails_sent ? t('.re_notify_producers') : t(:notify_producers)
|
|
- if mails_sent
|
|
.badge.icon-ok.success
|
|
|
|
- content_for :page_title do
|
|
= t :edit_order_cycle
|
|
|
|
- ng_controller = order_cycles_simple_form ? 'AdminSimpleEditOrderCycleCtrl' : 'AdminEditOrderCycleCtrl'
|
|
= admin_inject_order_cycle_instance
|
|
= form_for [main_app, :admin, @order_cycle], :url => '', :html => {:class => 'ng order_cycle', 'ng-app' => 'admin.orderCycles', 'ng-controller' => ng_controller, name: 'order_cycle_form'} do |f|
|
|
|
|
%save-bar{ dirty: "order_cycle_form.$dirty", persist: "true" }
|
|
%input.red{ type: "button", value: t('.save'), ng: { click: "submit($event, null)", disabled: "!order_cycle_form.$dirty || order_cycle_form.$invalid" } }
|
|
- if order_cycles_simple_form
|
|
%input.red{ type: "button", value: t('.save_and_back_to_list'), ng: { click: "submit($event, '#{main_app.admin_order_cycles_path}')", disabled: "!order_cycle_form.$dirty || order_cycle_form.$invalid" } }
|
|
- else
|
|
%input.red{ type: "button", value: t('.save_and_next'), ng: { click: "submit($event, '#{main_app.admin_order_cycle_incoming_path(@order_cycle)}')", disabled: "!order_cycle_form.$dirty || order_cycle_form.$invalid" } }
|
|
%input{ type: "button", value: t('.next'), ng: { click: "cancel('#{main_app.admin_order_cycle_incoming_path(@order_cycle)}')", disabled: "order_cycle_form.$dirty" } }
|
|
%input{ type: "button", ng: { value: "order_cycle_form.$dirty ? '#{t('.cancel')}' : '#{t('.back_to_list')}'", click: "cancel('#{main_app.admin_order_cycles_path}')" } }
|
|
|
|
- if order_cycles_simple_form
|
|
= render 'simple_form', f: f
|
|
- else
|
|
= render 'form', f: f
|