mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-10 23:07:47 +00:00
Merge pull request #4167 from luisramos0/last_dedeface
Move app_wrapper deface to spree/layouts/admin view
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
<!-- surround_contents 'body' -->
|
||||
|
||||
<div <%= yield(:app_wrapper_attrs).strip.html_safe %>>
|
||||
<%= render_original %>
|
||||
</div>
|
||||
@@ -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
|
||||
|
||||
@@ -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'}
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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?
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
78
app/views/spree/layouts/_admin_body.html.haml
Normal file
78
app/views/spree/layouts/_admin_body.html.haml
Normal file
@@ -0,0 +1,78 @@
|
||||
= admin_inject_currency_config
|
||||
= render "layouts/i18n_script"
|
||||
|
||||
#wrapper{"data-hook" => ""}
|
||||
- if flash[:error]
|
||||
.flash.error= flash[:error]
|
||||
- if notice
|
||||
.flash.notice= notice
|
||||
- if flash[:success]
|
||||
.flash.success= flash[:success]
|
||||
|
||||
#progress
|
||||
.wrapper
|
||||
#spinner
|
||||
.progress-message
|
||||
= Spree.t(:loading)
|
||||
\...
|
||||
|
||||
= render :partial => 'spree/admin/shared/alert', :collection => session[:alerts]
|
||||
|
||||
%header#header{"data-hook" => ""}
|
||||
.container
|
||||
%figure.columns.five{"data-hook" => "logo-wrapper"}
|
||||
= link_to image_tag(Spree::Config[:admin_interface_logo], :id => 'logo'), spree.admin_path
|
||||
%nav.columns.eleven{"data-hook" => "admin_login_navigation_bar"}
|
||||
= render :partial => 'spree/layouts/admin/login_nav'
|
||||
|
||||
%nav#admin-menu{"data-hook" => ""}
|
||||
.container
|
||||
.sixteen.columns.main-menu-wrapper
|
||||
%ul.inline-menu.fullwidth-menu{"data-hook" => "admin_tabs"}
|
||||
= render :partial => 'spree/admin/shared/tabs'
|
||||
|
||||
- if content_for?(:sub_menu)
|
||||
%nav#sub-menu{"data-hook" => ""}
|
||||
.container
|
||||
.sixteen.columns
|
||||
= yield :sub_menu
|
||||
|
||||
- if content_for?(:page_title) || content_for?(:page_actions)
|
||||
#content-header{"data-hook" => ""}
|
||||
.container
|
||||
.sixteen.columns
|
||||
.block-table
|
||||
- if content_for?(:page_title)
|
||||
.table-cell
|
||||
%h1{:class => "page-title"}= yield :page_title
|
||||
- if content_for?(:page_actions)
|
||||
.page-actions.table-cell.toolbar{"data-hook" => "toolbar"}
|
||||
%ul.inline-menu
|
||||
= yield :page_actions
|
||||
|
||||
.container
|
||||
.row
|
||||
- content_class = content_for?(:sidebar) ? "with-sidebar" : ""
|
||||
#content{:class => content_class, "data-hook" => ""}
|
||||
- if content_for?(:table_filter)
|
||||
- table_filter_class = content_for?(:sidebar) ? 'twelve columns' : 'sixteen columns'
|
||||
#table-filter{:class => table_filter_class, "data-hook" => ""}
|
||||
%fieldset
|
||||
%legend{:align => "center"}= yield :table_filter_title
|
||||
= yield :table_filter
|
||||
- div_class = content_for?(:sidebar) ? 'twelve columns' : 'sixteen columns'
|
||||
%div{:class => div_class}
|
||||
= yield
|
||||
- if content_for?(:sidebar)
|
||||
%aside#sidebar.four.columns{"data-hook" => ""}
|
||||
- if content_for?(:sidebar_title)
|
||||
%h5.sidebar-title
|
||||
%span= yield :sidebar_title
|
||||
= yield :sidebar
|
||||
|
||||
%div{"data-hook" => "admin_footer_scripts"}
|
||||
|
||||
= render 'spree/shared/google_analytics'
|
||||
|
||||
%script
|
||||
= raw "Spree.api_key = \"#{try_spree_current_user.try(:spree_api_key).to_s}\";"
|
||||
@@ -4,81 +4,12 @@
|
||||
= render :partial => 'spree/admin/shared/head'
|
||||
|
||||
%body.admin
|
||||
= admin_inject_currency_config
|
||||
= render "layouts/i18n_script"
|
||||
|
||||
#wrapper{"data-hook" => ""}
|
||||
- if flash[:error]
|
||||
.flash.error= flash[:error]
|
||||
- if notice
|
||||
.flash.notice= notice
|
||||
- if flash[:success]
|
||||
.flash.success= flash[:success]
|
||||
|
||||
#progress
|
||||
.wrapper
|
||||
#spinner
|
||||
.progress-message
|
||||
= Spree.t(:loading)
|
||||
\...
|
||||
|
||||
= render :partial => 'spree/admin/shared/alert', :collection => session[:alerts]
|
||||
|
||||
%header#header{"data-hook" => ""}
|
||||
.container
|
||||
%figure.columns.five{"data-hook" => "logo-wrapper"}
|
||||
= link_to image_tag(Spree::Config[:admin_interface_logo], :id => 'logo'), spree.admin_path
|
||||
%nav.columns.eleven{"data-hook" => "admin_login_navigation_bar"}
|
||||
= render :partial => 'spree/layouts/admin/login_nav'
|
||||
|
||||
%nav#admin-menu{"data-hook" => ""}
|
||||
.container
|
||||
.sixteen.columns.main-menu-wrapper
|
||||
%ul.inline-menu.fullwidth-menu{"data-hook" => "admin_tabs"}
|
||||
= render :partial => 'spree/admin/shared/tabs'
|
||||
|
||||
- if content_for?(:sub_menu)
|
||||
%nav#sub-menu{"data-hook" => ""}
|
||||
.container
|
||||
.sixteen.columns
|
||||
= yield :sub_menu
|
||||
|
||||
- if content_for?(:page_title) || content_for?(:page_actions)
|
||||
#content-header{"data-hook" => ""}
|
||||
.container
|
||||
.sixteen.columns
|
||||
.block-table
|
||||
- if content_for?(:page_title)
|
||||
.table-cell
|
||||
%h1{:class => "page-title"}= yield :page_title
|
||||
- if content_for?(:page_actions)
|
||||
.page-actions.table-cell.toolbar{"data-hook" => "toolbar"}
|
||||
%ul.inline-menu
|
||||
= yield :page_actions
|
||||
|
||||
.container
|
||||
.row
|
||||
- content_class = content_for?(:sidebar) ? "with-sidebar" : ""
|
||||
#content{:class => content_class, "data-hook" => ""}
|
||||
- if content_for?(:table_filter)
|
||||
- table_filter_class = content_for?(:sidebar) ? 'twelve columns' : 'sixteen columns'
|
||||
#table-filter{:class => table_filter_class, "data-hook" => ""}
|
||||
%fieldset
|
||||
%legend{:align => "center"}= yield :table_filter_title
|
||||
= yield :table_filter
|
||||
- div_class = content_for?(:sidebar) ? 'twelve columns' : 'sixteen columns'
|
||||
%div{:class => div_class}
|
||||
= yield
|
||||
- if content_for?(:sidebar)
|
||||
%aside#sidebar.four.columns{"data-hook" => ""}
|
||||
- if content_for?(:sidebar_title)
|
||||
%h5.sidebar-title
|
||||
%span= yield :sidebar_title
|
||||
= yield :sidebar
|
||||
|
||||
%div{"data-hook" => "admin_footer_scripts"}
|
||||
|
||||
= render 'spree/shared/google_analytics'
|
||||
|
||||
%script
|
||||
= raw "Spree.api_key = \"#{try_spree_current_user.try(:spree_api_key).to_s}\";"
|
||||
- if content_for?(:main_ng_app_name)
|
||||
- if content_for?(:main_ng_ctrl_name)
|
||||
%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'
|
||||
- else
|
||||
%div{ "ng-app" => yield(:main_ng_app_name).strip.html_safe }
|
||||
= render :partial => 'spree/layouts/admin_body'
|
||||
- else
|
||||
= render :partial => 'spree/layouts/admin_body'
|
||||
|
||||
Reference in New Issue
Block a user