From 675cf546c9a0c435a5a474d087a37560b791b614 Mon Sep 17 00:00:00 2001 From: unenglishable Date: Thu, 22 Aug 2024 18:48:54 -0700 Subject: [PATCH] fix(templates/config.js): access fields with atom keys instead of strings after standardizing config return and converting keys to atoms, this file was not updated to reflect the conversion this fix accesses keys with atoms and also, updates portal enabled with a default value of `false` --- .../templates/configuration_js/config.js.eex | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/lib/epochtalk_server_web/js/templates/configuration_js/config.js.eex b/lib/epochtalk_server_web/js/templates/configuration_js/config.js.eex index dba808e4..2757f4a7 100644 --- a/lib/epochtalk_server_web/js/templates/configuration_js/config.js.eex +++ b/lib/epochtalk_server_web/js/templates/configuration_js/config.js.eex @@ -1,22 +1,22 @@ -window.title = '<%= @config["website"]["title"] %>' -window.description = '<%= @config["website"]["description"] %>' -window.keywords = '<%= @config["website"]["keywords"] %>' -window.logo = '<%= @config["website"]["logo"] %>' -window.default_avatar = '<%= @config["website"]["default_avatar"] %>' -window.default_avatar_shape = '<%= @config["website"]["default_avatar_shape"] %>' -window.favicon = '<%= @config["website"]["favicon"] %>' -window.images_local_root = '<%= @config["images"]["options"]["local_host"] %>' -window.post_max_length = '<%= @config["post_max_length"] %>' -window.mobile_break_width = '<%= @config["mobile_break_width"] %>' -window.max_image_size = '<%= @config["max_image_size"] %>' -window.max_avatar_size = '<%= @config["max_avatar_size"] %>' -window.frontend_url = '<%= @config["frontend_url"] %>' -window.backend_url = '<%= @config["backend_url"] %>' +window.title = '<%= @config[:website][:title] %>' +window.description = '<%= @config[:website][:description] %>' +window.keywords = '<%= @config[:website][:keywords] %>' +window.logo = '<%= @config[:website][:logo] %>' +window.default_avatar = '<%= @config[:website][:default_avatar] %>' +window.default_avatar_shape = '<%= @config[:website][:default_avatar_shape] %>' +window.favicon = '<%= @config[:website][:favicon] %>' +window.images_local_root = '<%= @config[:images][:options][:local_host] %>' +window.post_max_length = '<%= @config[:post_max_length] %>' +window.mobile_break_width = '<%= @config[:mobile_break_width] %>' +window.max_image_size = '<%= @config[:max_image_size] %>' +window.max_avatar_size = '<%= @config[:max_avatar_size] %>' +window.frontend_url = '<%= @config[:frontend_url] %>' +window.backend_url = '<%= @config[:backend_url] %>' window.portal = { - enabled: <%= @config["portal"]["enabled"] %>, - board_id: <%= if board_id = @config["portal"]["board_id"], do: board_id, else: "null" %> + enabled: <%= if portal_enabled = @config[:portal][:enabled], do: portal_enabled, else: false %>, + board_id: <%= if board_id = @config[:portal][:board_id], do: board_id, else: "null" %> }; -window.ga_key = '<%= @config["ga_key"] %>' -window.google_api_key = '<%= @config["google_api_key"] %>' -window.google_client_id = '<%= @config["google_client_id"] %>' -window.google_app_domain = '<%= @config["google_app_domain"] %>' +window.ga_key = '<%= @config[:ga_key] %>' +window.google_api_key = '<%= @config[:google_api_key] %>' +window.google_client_id = '<%= @config[:google_client_id] %>' +window.google_app_domain = '<%= @config[:google_app_domain] %>'