diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index 407cf7d69..272c2f546 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -1,5 +1,21 @@ class DashboardController < ActionController::Base + before_action :set_global_config + layout 'vueapp' def index; end + + private + + def set_global_config + @global_config = GlobalConfig.get( + 'LOGO', + 'LOGO_THUMBNAIL', + 'INSTALLATION_NAME', + 'WIDGET_BRAND_URL', + 'TERMS_URL', + 'PRIVACY_URL', + 'DISPLAY_MANIFEST' + ) + end end diff --git a/app/controllers/widgets_controller.rb b/app/controllers/widgets_controller.rb index 7b7cb4f52..4e784ac60 100644 --- a/app/controllers/widgets_controller.rb +++ b/app/controllers/widgets_controller.rb @@ -1,4 +1,5 @@ class WidgetsController < ActionController::Base + before_action :set_global_config before_action :set_web_widget before_action :set_token before_action :set_contact @@ -8,6 +9,10 @@ class WidgetsController < ActionController::Base private + def set_global_config + @global_config = GlobalConfig.get('LOGO_THUMBNAIL', 'INSTALLATION_NAME', 'WIDGET_BRAND_URL') + end + def set_web_widget @web_widget = ::Channel::WebWidget.find_by!(website_token: permitted_params[:website_token]) end diff --git a/app/views/layouts/vueapp.html.erb b/app/views/layouts/vueapp.html.erb index e5d751a21..f93ccb464 100644 --- a/app/views/layouts/vueapp.html.erb +++ b/app/views/layouts/vueapp.html.erb @@ -1,26 +1,31 @@ - Chatwoot + + <%= @global_config['INSTALLATION_NAME'] %> + - - - - - - - - - - - - - - - - - - + <% if @global_config['DISPLAY_MANIFEST'] %> + + + + + + + + + + + + + + + + + + + <% end %> + <%= csrf_meta_tags %> <%= javascript_pack_tag 'application' %> <%= stylesheet_pack_tag 'application' %> diff --git a/app/views/widgets/show.html.erb b/app/views/widgets/show.html.erb index 632064bb0..3bf98cf99 100644 --- a/app/views/widgets/show.html.erb +++ b/app/views/widgets/show.html.erb @@ -1,7 +1,7 @@ - Chatwoot + <%= @global_config['INSTALLATION_NAME'] %> <%= csrf_meta_tags %> <%= javascript_pack_tag 'widget' %> <%= stylesheet_pack_tag 'widget' %> diff --git a/config/installation_config.yml b/config/installation_config.yml index ac340c168..13801a95b 100644 --- a/config/installation_config.yml +++ b/config/installation_config.yml @@ -12,3 +12,5 @@ value: 'https://www.chatwoot.com/terms-of-service' - name: PRIVACY_URL value: 'https://www.chatwoot.com/privacy-policy' +- name: DISPLAY_MANIFEST + value: true