class Site
  include Mongoid::Document
  include Mongoid::Timestamps

  field :title, type: String, localize: true
  field :school, type: String
  field :department, type: String
  field :address, type: String
  field :footer, localize: true
  field :sub_menu, localize: true
  field :terms_of_use, localize: true
  field :google_analytics, type: String
  field :in_use_locales, :type => Array
  field :valid_locales, :type => Array
  field :site_active, :type => Boolean
  field :frontend_open, :type => Boolean, :default => true
  field :backend_openness_on, :type => Boolean, :default => false
  field :mobile_api_openness_on, :type => Boolean, :default => false  
  field :desktop_closed, :type => Boolean, :default => false
  field :enable_language_detection, :type => Boolean, :default => false
  field :default_locale, :default => "en"
  field :mobile_on, :type => Boolean, :default => false
  field :announcement_category, :type => Array, :default=>[]
  field :mobile_bar_color, :type => Array, :default=>[]
  field :mobile_on, :type => Boolean, :default => false
  field :phone_number, :type => Array,:default=>[]
  field :title_always_on, :type => Boolean, :default => false
  field :sitemap_menu_in_header, :type => Boolean, :default => false
  field :enable_terms_of_use, :type => Boolean, :default => false
  field :search,:type => Hash


  mount_uploader :default_image, ImageUploader
  mount_uploader :favicon, ImageUploader
  mount_uploader :mobile_icon, ImageUploader
  def to_param
    I18n.locale = :en
    title.parameterize
  end

  mount_uploader :default_image, ImageUploader
end