diff --git a/app/views/admin/order_cycles/_order_cycle_top_buttons.haml b/app/views/admin/order_cycles/_order_cycle_top_buttons.haml new file mode 100644 index 0000000000..97b14ddf1b --- /dev/null +++ b/app/views/admin/order_cycles/_order_cycle_top_buttons.haml @@ -0,0 +1,19 @@ +- 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() + } + + %li + %button#toggle_settings{ onClick: 'toggleSettings()' } + = t('.advanced_settings') + %i.icon-chevron-down + +#advanced_settings{ hidden: true } + = render partial: "/admin/order_cycles/advanced_settings" \ No newline at end of file diff --git a/app/views/admin/order_cycles/incoming.html.haml b/app/views/admin/order_cycles/incoming.html.haml index faaa81e03b..3bc3dd86b3 100644 --- a/app/views/admin/order_cycles/incoming.html.haml +++ b/app/views/admin/order_cycles/incoming.html.haml @@ -1,3 +1,20 @@ +- 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() + } + + %li + %button#toggle_settings{ onClick: 'toggleSettings()' } + = t('.advanced_settings') + %i.icon-chevron-down + - content_for :page_title do = t :edit_order_cycle diff --git a/app/views/admin/order_cycles/outgoing.html.haml b/app/views/admin/order_cycles/outgoing.html.haml index 0623d1f71e..890faa9553 100644 --- a/app/views/admin/order_cycles/outgoing.html.haml +++ b/app/views/admin/order_cycles/outgoing.html.haml @@ -1,3 +1,20 @@ +- 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() + } + + %li + %button#toggle_settings{ onClick: 'toggleSettings()' } + = t('.advanced_settings') + %i.icon-chevron-down + - content_for :page_title do = t :edit_order_cycle