mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-27 21:06:49 +00:00
39 lines
1.8 KiB
Plaintext
39 lines
1.8 KiB
Plaintext
- content_for :page_actions do
|
|
:javascript
|
|
function toggleSettings(){
|
|
if( $('#advanced_settings').is(":visible") ){
|
|
$('button#toggle_settings i').switchClass("icon-chevron-up","icon-chevron-down")
|
|
}
|
|
else {
|
|
$('button#toggle_settings i').switchClass("icon-chevron-down","icon-chevron-up")
|
|
}
|
|
$("#advanced_settings").slideToggle()
|
|
}
|
|
|
|
- if can? :notify_producers, @order_cycle
|
|
%li
|
|
= button_to t(:notify_producers), main_app.notify_producers_admin_order_cycle_path, :id => 'admin_notify_producers', :confirm => t(:are_you_sure)
|
|
%li
|
|
%button#toggle_settings{ onClick: 'toggleSettings()' }
|
|
= t('.advanced_settings')
|
|
%i.icon-chevron-down
|
|
|
|
#advanced_settings{ hidden: true }
|
|
= render partial: "/admin/order_cycles/advanced_settings"
|
|
|
|
%h1
|
|
= t :edit_order_cycle
|
|
|
|
- ng_controller = order_cycles_simple_form ? 'AdminSimpleEditOrderCycleCtrl' : 'AdminEditOrderCycleCtrl'
|
|
= 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(:update), ng: { click: "submit($event, null)", disabled: "!order_cycle_form.$dirty || order_cycle_form.$invalid" } }
|
|
%input.red{ type: "button", value: t('.update_and_close'), ng: { click: "submit($event, '#{main_app.admin_order_cycles_path}')", disabled: "!order_cycle_form.$dirty || order_cycle_form.$invalid" } }
|
|
%input{ type: "button", ng: { value: "order_cycle_form.$dirty ? '#{t(:cancel)}' : '#{t(:close)}'", click: "cancel('#{main_app.admin_order_cycles_path}')" } }
|
|
|
|
- if order_cycles_simple_form
|
|
= render 'simple_form', f: f
|
|
- else
|
|
= render 'form', f: f
|