views: reduce set of <body> data attributes.

Some API attributes aren't generally useful or are too expensive to calculate
on every pageload. Only include basic attributes plus account settings.
This commit is contained in:
evazion
2019-10-06 00:38:38 -05:00
parent e6c53a9e9a
commit 48ed227fc5

View File

@@ -175,8 +175,7 @@ module ApplicationHelper
end
def body_attributes(user = CurrentUser.user)
attributes = user.api_attributes
attributes -= [:custom_style, :blacklisted_tags, :favorite_tags]
attributes = %i[id name level level_string theme] + User::BOOLEAN_ATTRIBUTES.map(&:to_sym)
attributes += User::Roles.map { |role| :"is_#{role}?" }
controller_param = params[:controller].parameterize.dasherize