mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-13 23:37:47 +00:00
Add new field on enterprise admin form
This commit is contained in:
committed by
Rachel Arnould
parent
772f1f8fde
commit
14334b02bf
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
21
app/views/admin/enterprises/form/_admin_only.html.haml
Normal file
21
app/views/admin/enterprises/form/_admin_only.html.haml
Normal file
@@ -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) }
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user