Duplicate create basic version of enterprise serializer for lists, make shopfront_message input use textangular

This commit is contained in:
Rob Harrington
2014-12-17 15:17:29 +11:00
parent 5a24f2c0e2
commit d5df73c6a2
5 changed files with 13 additions and 10 deletions

View File

@@ -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

View 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

View File

@@ -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

View File

@@ -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.'}

View File

@@ -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