Files
openfoodnetwork/app/views/admin/enterprises/edit.html.haml
Maikel Linke 6a206b2a34 Move Connected Apps form out of Enterprise form
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.
2024-05-31 11:09:00 +10:00

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