mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
Nested forms are not valid HTML and we were submitting the wrong authenticity token to Rails when updating the enterprise. I inverted the hierarchy of the form and the panels. The menu and tab-panel structure now sits above and the enterprise edit form is nested within. The current structure is not ideal but it's only a transition phase. I'm expecting the page to get re-designed at some point and re-writen without AngularJS.
27 lines
1.3 KiB
Plaintext
27 lines
1.3 KiB
Plaintext
= render partial: 'spree/shared/error_messages', locals: { target: @enterprise }
|
|
|
|
- content_for :page_title do
|
|
= t('.editing')
|
|
= @enterprise.name
|
|
|
|
- content_for :main_ng_app_name do
|
|
= "admin.enterprises"
|
|
|
|
- content_for :page_actions do
|
|
%li= select :enterprise, :id, options_for_select(editable_enterprises.collect {|e| [e.name, e.id, {:'data-url' => "#{main_app.edit_admin_enterprise_path(e.permalink)}", :'ng-selected' => "selected==#{e.id}"}]}, @enterprise.id ), {}, {:'enterprise-switcher' => '', 'data-initial' => "#{@enterprise.id}", :'ng-init' => "selected='#{@enterprise.id}'", :'ng-model' => 'selected', :id => 'enterprise_switcher', :class => 'select2'}
|
|
%li= button_link_to t('.back_link'), main_app.admin_enterprises_path, icon: 'icon-arrow-left'
|
|
|
|
= render 'admin/enterprises/form_data'
|
|
|
|
.row{ data: { controller: "tabs-and-panels", "tabs-and-panels-class-name-value": "selected" }}
|
|
.sixteen.columns.alpha
|
|
.four.columns.alpha
|
|
= render 'admin/shared/side_menu'
|
|
.one.column
|
|
.eleven.columns.omega.fullwidth_inputs
|
|
= render 'admin/enterprises/ng_form', action: 'edit'
|
|
|
|
%fieldset.alpha.no-border-bottom{ id: "connected_apps_panel", data: { "tabs-and-panels-target": "panel" }}
|
|
%legend= t("admin.enterprises.form.connected_apps.legend")
|
|
= render "admin/enterprises/form/connected_apps", enterprise: @enterprise
|