diff --git a/app/views/admin/customers/index.html.haml b/app/views/admin/customers/index.html.haml index 6477357d63..477e609cde 100644 --- a/app/views/admin/customers/index.html.haml +++ b/app/views/admin/customers/index.html.haml @@ -2,8 +2,8 @@ %h1.page-title =t :customers -- content_for :app_wrapper_attrs do - = "ng-app='admin.customers'" +- content_for :main_ng_app_name do + = "admin.customers" - content_for :page_actions do %li diff --git a/app/views/admin/enterprises/edit.html.haml b/app/views/admin/enterprises/edit.html.haml index 61c26b5428..0e6a9162b8 100644 --- a/app/views/admin/enterprises/edit.html.haml +++ b/app/views/admin/enterprises/edit.html.haml @@ -4,8 +4,8 @@ = t('.editing') = @enterprise.name -- content_for :app_wrapper_attrs do - = "ng-app='admin.enterprises'" +- 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'} diff --git a/app/views/admin/enterprises/index.html.haml b/app/views/admin/enterprises/index.html.haml index 8ced7bd769..499f8f9db6 100644 --- a/app/views/admin/enterprises/index.html.haml +++ b/app/views/admin/enterprises/index.html.haml @@ -1,8 +1,8 @@ - content_for :page_title do = t('.title') -- content_for :app_wrapper_attrs do - = "ng-app='admin.enterprises'" +- content_for :main_ng_app_name do + = "admin.enterprises" - content_for :page_actions do = render 'admin/shared/user_guide_link' diff --git a/app/views/admin/enterprises/new.html.haml b/app/views/admin/enterprises/new.html.haml index dd830054f5..ec54e17900 100644 --- a/app/views/admin/enterprises/new.html.haml +++ b/app/views/admin/enterprises/new.html.haml @@ -6,8 +6,8 @@ - content_for :page_actions do %li= button_link_to t('.back_link'), main_app.admin_enterprises_path, icon: 'icon-arrow-left' -- content_for :app_wrapper_attrs do - = "ng-app='admin.enterprises'" +- content_for :main_ng_app_name do + = "admin.enterprises" = admin_inject_available_countries(module: 'admin.enterprises') = admin_inject_json "admin.enterprises", "defaultCountryID", Spree::Config[:default_country_id] diff --git a/app/views/admin/order_cycles/index.html.haml b/app/views/admin/order_cycles/index.html.haml index 81cb437940..266d4c36d9 100644 --- a/app/views/admin/order_cycles/index.html.haml +++ b/app/views/admin/order_cycles/index.html.haml @@ -1,8 +1,8 @@ = content_for :page_title do = t :admin_order_cycles -- content_for :app_wrapper_attrs do - = "ng-app='admin.orderCycles'" +- content_for :main_ng_app_name do + = "admin.orderCycles" = content_for :page_actions do - if subscriptions_enabled? diff --git a/app/views/admin/subscriptions/index.html.haml b/app/views/admin/subscriptions/index.html.haml index 096e745627..4dd37c4f75 100644 --- a/app/views/admin/subscriptions/index.html.haml +++ b/app/views/admin/subscriptions/index.html.haml @@ -1,8 +1,8 @@ - content_for :page_title do = t('admin.subscriptions.subscriptions') -- content_for :app_wrapper_attrs do - = "ng-app='admin.subscriptions'" +- content_for :main_ng_app_name do + = "admin.subscriptions" - content_for :page_actions do %li diff --git a/app/views/spree/admin/orders/bulk_management.html.haml b/app/views/spree/admin/orders/bulk_management.html.haml index 1d2b5ed70d..1fc72e9a9b 100644 --- a/app/views/spree/admin/orders/bulk_management.html.haml +++ b/app/views/spree/admin/orders/bulk_management.html.haml @@ -1,5 +1,5 @@ -- content_for :app_wrapper_attrs do - = "ng-app='admin.lineItems'" +- content_for :main_ng_app_name do + = "admin.lineItems" - content_for :page_title do %h1.page-title diff --git a/app/views/spree/admin/orders/customer_details/edit.html.haml b/app/views/spree/admin/orders/customer_details/edit.html.haml index 36ecdb70a0..e4fa93ffbb 100644 --- a/app/views/spree/admin/orders/customer_details/edit.html.haml +++ b/app/views/spree/admin/orders/customer_details/edit.html.haml @@ -13,8 +13,8 @@ #select-customer{"data-hook" => ""} %fieldset.no-border-bottom %legend{:align => "center"}= Spree.t(:customer_search) - - content_for :app_wrapper_attrs do - = 'ng-app=admin.orders' + - content_for :main_ng_app_name do + = "admin.orders" = hidden_field_tag :customer_search_override, nil, distributor_id: @order.distributor_id, :class => 'fullwidth title customer-search-override' = render :partial => "spree/admin/orders/customer_details/autocomplete", :formats => :js diff --git a/app/views/spree/admin/orders/index.html.haml b/app/views/spree/admin/orders/index.html.haml index 3f1e087b6e..07c3acd836 100644 --- a/app/views/spree/admin/orders/index.html.haml +++ b/app/views/spree/admin/orders/index.html.haml @@ -7,8 +7,11 @@ = render partial: 'spree/admin/shared/order_sub_menu' -- content_for :app_wrapper_attrs do - = "ng-app='admin.orders' ng-controller='ordersCtrl'" +- content_for :main_ng_app_name do + = "admin.orders" + +- content_for :main_ng_ctrl_name do + = "ordersCtrl" - content_for :table_filter_title do = t(:search) diff --git a/app/views/spree/layouts/admin.html.haml b/app/views/spree/layouts/admin.html.haml index df4c8c011a..fdfb6c0932 100644 --- a/app/views/spree/layouts/admin.html.haml +++ b/app/views/spree/layouts/admin.html.haml @@ -4,4 +4,5 @@ = render :partial => 'spree/admin/shared/head' %body.admin - = render :partial => 'spree/layouts/admin_body' + %div{ "ng-app" => yield(:main_ng_app_name).strip.html_safe, "ng-controller" => yield(:main_ng_ctrl_name).strip.html_safe } + = render :partial => 'spree/layouts/admin_body'