Adding shop closed message preference

This commit is contained in:
Rob Harrington
2014-12-17 15:39:32 +11:00
parent d5df73c6a2
commit 3fa1832e7b
4 changed files with 16 additions and 6 deletions

View File

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

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, :long_description, :preferred_shopfront_message
attributes :producer_profile_only, :email, :long_description, :preferred_shopfront_message, :preferred_shopfront_closed_message
end

View File

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

View File

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