diff --git a/app/models/enterprise.rb b/app/models/enterprise.rb index 49c2dd29e6..0ab440f0a7 100644 --- a/app/models/enterprise.rb +++ b/app/models/enterprise.rb @@ -4,6 +4,7 @@ class Enterprise < ActiveRecord::Base ENTERPRISE_SEARCH_RADIUS = 100 preference :shopfront_message, :text, default: "" + preference :shopfront_closed_message, :text, default: "" devise :confirmable, reconfirmable: true, confirmation_keys: [ :id, :email ] diff --git a/app/serializers/api/admin/enterprise_serializer.rb b/app/serializers/api/admin/enterprise_serializer.rb index 174c5c4daa..d63e2d1537 100644 --- a/app/serializers/api/admin/enterprise_serializer.rb +++ b/app/serializers/api/admin/enterprise_serializer.rb @@ -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, :long_description, :preferred_shopfront_message + attributes :producer_profile_only, :email, :long_description, :preferred_shopfront_message, :preferred_shopfront_closed_message end \ No newline at end of file diff --git a/app/views/admin/enterprises/form/_shop_preferences.html.haml b/app/views/admin/enterprises/form/_shop_preferences.html.haml index 2d23f2f335..bda68ec0ae 100644 --- a/app/views/admin/enterprises/form/_shop_preferences.html.haml +++ b/app/views/admin/enterprises/form/_shop_preferences.html.haml @@ -5,4 +5,12 @@ .eight.columns.omega %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.'} + 'placeholder' => 'An optional explanation for customers detailing how your shopfront works, to be displayed above the product list on your shop page.'} +.row + .alpha.eleven.columns + .three.columns.alpha + = f.label "preferred_shopfront_closed_message", t(:shopfront_closed_message) + .eight.columns.omega + %text-angular{'ng-model' => 'Enterprise.preferred_shopfront_closed_message', 'id' => 'enterprise_preferred_shopfront_closed_message', 'name' => 'enterprise[preferred_shopfront_closed_message]', 'class' => 'text-angular', + 'ta-toolbar' => "[['h1','h2','h3','h4','p'],['bold','italics','underline','clear'],['insertLink']]", + 'placeholder' => 'A message which provides a more detailed explanation about why your shop is closed and/or when customers can expect it to open again. This is displayed on your shop only when you have no active order cycles (ie. shop is closed).'} diff --git a/app/views/shop/_messages.html.haml b/app/views/shop/_messages.html.haml index 2cff1b30b5..1cca55bb35 100644 --- a/app/views/shop/_messages.html.haml +++ b/app/views/shop/_messages.html.haml @@ -1,8 +1,9 @@ - if @order_cycles and @order_cycles.empty? - .row - .small-12.columns - .shopfront_closed_message - = current_distributor.preferred_shopfront_message.html_safe + - if current_distributor.preferred_shopfront_closed_message.present? + .row + .small-12.columns + .shopfront_closed_message + = current_distributor.preferred_shopfront_closed_message.html_safe - elsif current_distributor.preferred_shopfront_message.present? .row .small-12.columns