diff --git a/app/helpers/admin/enterprises_helper.rb b/app/helpers/admin/enterprises_helper.rb index 67ed726282..61bab28edc 100644 --- a/app/helpers/admin/enterprises_helper.rb +++ b/app/helpers/admin/enterprises_helper.rb @@ -75,6 +75,7 @@ module Admin { name: 'white_label', icon_class: "icon-leaf", show: true }, { name: 'users', icon_class: "icon-user", show: true }, { name: 'connected_apps', icon_class: "icon-puzzle-piece", show: show_connected_apps }, + { name: 'admin_only', icon_class: "icon-gear", show: spree_current_user.admin? }, ] end end diff --git a/app/services/permitted_attributes/enterprise.rb b/app/services/permitted_attributes/enterprise.rb index 234fadac77..1dd5b5a838 100644 --- a/app/services/permitted_attributes/enterprise.rb +++ b/app/services/permitted_attributes/enterprise.rb @@ -37,7 +37,7 @@ module PermittedAttributes :preferred_invoice_order_by_supplier, :preferred_product_low_stock_display, :hide_ofn_navigation, :white_label_logo, :white_label_logo_link, - :hide_groups_tab + :hide_groups_tab, :external_billing_id, ] end end diff --git a/app/views/admin/enterprises/form/_admin_only.html.haml b/app/views/admin/enterprises/form/_admin_only.html.haml new file mode 100644 index 0000000000..0d8033bcf1 --- /dev/null +++ b/app/views/admin/enterprises/form/_admin_only.html.haml @@ -0,0 +1,21 @@ +.row + .three.columns.alpha + = f.label :sells, t('.sells') + = render partial: 'admin/shared/whats_this_tooltip', locals: {tooltip_text: t('.sells_tip')} + .two.columns + = f.radio_button :sells, "none", 'ng-model' => 'Enterprise.sells', data: {action: "change->primary-details#enterpriseSellsChanged"} + = f.label :sells, t('.none'), value: "none" + .two.columns + = f.radio_button :sells, "own", 'ng-model' => 'Enterprise.sells', data: {action: "change->primary-details#enterpriseSellsChanged"} + = f.label :sells, t('.own'), value: "own" + .four.columns.omega + = f.radio_button :sells, "any", 'ng-model' => 'Enterprise.sells', data: {action: "change->primary-details#enterpriseSellsChanged"} + = f.label :sells, t('.any'), value: "any" + %span{ style: "width: 30px; height: 30px;", class: "hidden", data: { "primary-details-target": "spinner" } } + = render partial: "components/admin_spinner" +.row + .three.columns.alpha + = f.label :external_billing_id, t('.external_billing_id') + = render partial: 'admin/shared/whats_this_tooltip', locals: {tooltip_text: t('.external_billing_id_tip')} + .four.columns + = f.text_field :external_billing_id, { placeholder: t(:external_billing_id_placeholder) } diff --git a/app/views/admin/enterprises/form/_primary_details.html.haml b/app/views/admin/enterprises/form/_primary_details.html.haml index 04609e9b58..27965fb421 100644 --- a/app/views/admin/enterprises/form/_primary_details.html.haml +++ b/app/views/admin/enterprises/form/_primary_details.html.haml @@ -18,22 +18,6 @@ .five.columns.omega = f.check_box :is_primary_producer, data: { action: "change->primary-details#primaryProducerChanged" } = f.label :is_primary_producer, t('.producer') -- if spree_current_user.admin? - .row - .three.columns.alpha - = f.label :sells, t('.sells') - = render partial: 'admin/shared/whats_this_tooltip', locals: {tooltip_text: t('.sells_tip')} - .two.columns - = f.radio_button :sells, "none", 'ng-model' => 'Enterprise.sells', data: {action: "change->primary-details#enterpriseSellsChanged"} - = f.label :sells, t('.none'), value: "none" - .two.columns - = f.radio_button :sells, "own", 'ng-model' => 'Enterprise.sells', data: {action: "change->primary-details#enterpriseSellsChanged"} - = f.label :sells, t('.own'), value: "own" - .four.columns.omega - = f.radio_button :sells, "any", 'ng-model' => 'Enterprise.sells', data: {action: "change->primary-details#enterpriseSellsChanged"} - = f.label :sells, t('.any'), value: "any" - %span{ style: "width: 30px; height: 30px;", class: "hidden", data: { "primary-details-target": "spinner" } } - = render partial: "components/admin_spinner" .row .three.columns.alpha %label= t('.visible_in_search')