mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Merge pull request #7646 from apricot12/advanced_settings_button_OC_edits
Add advanced settings button to incoming and outgoing pages in OC cyc…
This commit is contained in:
@@ -64,7 +64,7 @@ module Admin
|
||||
if @order_cycle_form.save
|
||||
respond_to do |format|
|
||||
flash[:notice] = I18n.t(:order_cycles_update_notice) if params[:reloading] == '1'
|
||||
format.html { redirect_to main_app.edit_admin_order_cycle_path(@order_cycle) }
|
||||
format.html { redirect_back(fallback_location: root_path) }
|
||||
format.json { render json: { success: true } }
|
||||
end
|
||||
else
|
||||
|
||||
@@ -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"
|
||||
@@ -1,25 +1,8 @@
|
||||
= render partial: "/admin/order_cycles/order_cycle_top_buttons"
|
||||
- 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"
|
||||
|
||||
- content_for :page_title do
|
||||
= t :edit_order_cycle
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
= render partial: "/admin/order_cycles/order_cycle_top_buttons"
|
||||
|
||||
- content_for :page_title do
|
||||
= t :edit_order_cycle
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
= render partial: "/admin/order_cycles/order_cycle_top_buttons"
|
||||
|
||||
- content_for :page_title do
|
||||
= t :edit_order_cycle
|
||||
|
||||
|
||||
@@ -996,7 +996,6 @@ en:
|
||||
cancel: "Cancel"
|
||||
back_to_list: "Back To List"
|
||||
edit:
|
||||
advanced_settings: "Advanced Settings"
|
||||
save: "Save"
|
||||
save_and_next: "Save and Next"
|
||||
next: "Next"
|
||||
@@ -1049,6 +1048,8 @@ en:
|
||||
preferred_product_selection_from_coordinator_inventory_only_here: Coordinator's Inventory Only
|
||||
preferred_product_selection_from_coordinator_inventory_only_all: All Available Products
|
||||
save_reload: Save and Reload Page
|
||||
order_cycle_top_buttons:
|
||||
advanced_settings: "Advanced Settings"
|
||||
coordinator_fees:
|
||||
add: Add coordinator fee
|
||||
filters:
|
||||
|
||||
@@ -119,7 +119,5 @@ feature '
|
||||
click_link 'Groups'
|
||||
expect(page).to have_content 'My Group'
|
||||
end
|
||||
|
||||
xit "should show me only enterprises I manage when creating a new enterprise group"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -43,7 +43,7 @@ feature '
|
||||
end
|
||||
end
|
||||
|
||||
pending "when user is a profile only" do
|
||||
context "when user is a profile only" do
|
||||
before do
|
||||
d1.sells = "none"
|
||||
d1.save!
|
||||
@@ -51,7 +51,7 @@ feature '
|
||||
|
||||
it "does not show a products item" do
|
||||
visit '/admin'
|
||||
page.should_not have_selector "#products"
|
||||
expect(page).to have_no_selector "#products"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -45,8 +45,6 @@ feature 'shipping methods' do
|
||||
expect(sm.distributors).to match_array [distributor1, distributor2]
|
||||
end
|
||||
|
||||
it "at checkout, user can only see shipping methods for their current distributor (checkout spec)"
|
||||
|
||||
scenario "deleting a shipping method" do
|
||||
visit_delete spree.admin_shipping_method_path(@shipping_method)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user