mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Duplicate create basic version of enterprise serializer for lists, make shopfront_message input use textangular
This commit is contained in:
@@ -5,8 +5,8 @@ module Admin
|
||||
end
|
||||
|
||||
def admin_inject_enterprises
|
||||
admin_inject_json_ams_array("ofn.admin", "my_enterprises", @my_enterprises, Api::Admin::EnterpriseSerializer) +
|
||||
admin_inject_json_ams_array("ofn.admin", "all_enterprises", @all_enterprises, Api::Admin::EnterpriseSerializer)
|
||||
admin_inject_json_ams_array("ofn.admin", "my_enterprises", @my_enterprises, Api::Admin::BasicEnterpriseSerializer) +
|
||||
admin_inject_json_ams_array("ofn.admin", "all_enterprises", @all_enterprises, Api::Admin::BasicEnterpriseSerializer)
|
||||
end
|
||||
|
||||
def admin_inject_enterprise_relationships
|
||||
|
||||
4
app/serializers/api/admin/basic_enterprise_serializer.rb
Normal file
4
app/serializers/api/admin/basic_enterprise_serializer.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
class Api::Admin::BasicEnterpriseSerializer < ActiveModel::Serializer
|
||||
attributes :name, :id, :is_primary_producer, :is_distributor, :sells, :category, :payment_method_ids, :shipping_method_ids
|
||||
attributes :producer_profile_only
|
||||
end
|
||||
@@ -1,4 +1,4 @@
|
||||
class Api::Admin::EnterpriseSerializer < ActiveModel::Serializer
|
||||
attributes :name, :id, :is_primary_producer, :is_distributor, :sells, :category, :payment_method_ids, :shipping_method_ids
|
||||
attributes :producer_profile_only, :email
|
||||
end
|
||||
attributes :producer_profile_only, :email, :long_description, :preferred_shopfront_message
|
||||
end
|
||||
@@ -3,7 +3,6 @@
|
||||
.three.columns.alpha
|
||||
= f.label "preferred_shopfront_message", t(:shopfront_message)
|
||||
.eight.columns.omega
|
||||
-# %text-angular{'ng-model' => 'longDescription', 'id' => 'enterprise_long_description', 'name' => 'enterprise[long_description]', 'class' => 'text-angular',
|
||||
-# 'ta-toolbar' => "[['h1','h2','h3','h4','p'],['bold','italics','underline','clear'],['insertLink']]",
|
||||
-# 'placeholder' => 'Tell customers about yourself. This information appears on your public profile.'}
|
||||
= f.text_area :preferred_shopfront_message, rows: 6, class: "fullwidth", placeholder: "An option explanation for customers detailing how your shopfront works. This text will appear at the top of your shop page, immediately above your products."
|
||||
%text-angular{'ng-model' => 'Enterprise.preferred_shopfront_message', 'id' => 'enterprise_preferred_shopfront_message', 'name' => 'enterprise[preferred_shopfront_message]', 'class' => 'text-angular',
|
||||
'ta-toolbar' => "[['h1','h2','h3','h4','p'],['bold','italics','underline','clear'],['insertLink']]",
|
||||
'placeholder' => 'Tell customers about yourself. This information appears on your public profile.'}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
.row
|
||||
.small-12.columns
|
||||
.shopfront_closed_message
|
||||
= current_distributor.preferred_shopfront_message
|
||||
= current_distributor.preferred_shopfront_message.html_safe
|
||||
- elsif current_distributor.preferred_shopfront_message.present?
|
||||
.row
|
||||
.small-12.columns
|
||||
.shopfront_message
|
||||
= current_distributor.preferred_shopfront_message
|
||||
= current_distributor.preferred_shopfront_message.html_safe
|
||||
|
||||
Reference in New Issue
Block a user