This way it will be possible to write CSS and JavaScript code that will only apply to specific tenants. Note that CSS customization is still limited because it isn't possible to use different SCSS variables per tenant.
22 lines
419 B
Ruby
22 lines
419 B
Ruby
class Layout::CommonHTMLAttributesComponent < ApplicationComponent
|
|
delegate :rtl?, to: :helpers
|
|
|
|
private
|
|
|
|
def attributes
|
|
sanitize([dir, lang, html_class].compact.join(" "))
|
|
end
|
|
|
|
def dir
|
|
'dir="rtl"' if rtl?
|
|
end
|
|
|
|
def lang
|
|
"lang=\"#{I18n.locale}\""
|
|
end
|
|
|
|
def html_class
|
|
"class=\"tenant-#{Tenant.current_schema}\"" if Rails.application.config.multitenancy
|
|
end
|
|
end
|