2019-10-29 07:20:54 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
2020-05-12 07:15:28 +00:00
|
|
|
<title><%= @global_config['INSTALLATION_NAME'] %></title>
|
2019-10-29 07:20:54 +00:00
|
|
|
<%= csrf_meta_tags %>
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0" />
|
2019-10-30 05:13:11 +00:00
|
|
|
<script>
|
2019-11-25 18:40:27 +00:00
|
|
|
window.chatwootWebChannel = {
|
2020-05-06 08:08:36 +00:00
|
|
|
avatarUrl: '<%= @web_widget.inbox.avatar_url %>',
|
2020-05-09 16:32:43 +00:00
|
|
|
hasAConnectedAgentBot: '<%= @web_widget.inbox.agent_bot&.name %>',
|
2020-05-06 08:08:36 +00:00
|
|
|
locale: '<%= @web_widget.account.locale %>',
|
2020-04-19 18:10:28 +00:00
|
|
|
websiteName: '<%= @web_widget.inbox.name %>',
|
2020-04-20 06:25:06 +00:00
|
|
|
websiteToken: '<%= @web_widget.website_token %>',
|
2020-04-19 18:10:28 +00:00
|
|
|
welcomeTagline: '<%= @web_widget.welcome_tagline %>',
|
2020-05-06 08:08:36 +00:00
|
|
|
welcomeTitle: '<%= @web_widget.welcome_title %>',
|
|
|
|
widgetColor: '<%= @web_widget.widget_color %>',
|
2020-08-05 12:16:17 +00:00
|
|
|
enabledFeatures: <%= @web_widget.selected_feature_flags.to_json.html_safe %>,
|
2020-05-17 10:45:53 +00:00
|
|
|
enabledLanguages: <%= available_locales_with_name.to_json.html_safe %>,
|
2021-02-15 18:44:13 +00:00
|
|
|
replyTime: '<%= @web_widget.reply_time %>',
|
|
|
|
preChatFormEnabled: <%= @web_widget.pre_chat_form_enabled %>,
|
2021-03-13 06:14:28 +00:00
|
|
|
preChatFormOptions: <%= @web_widget.pre_chat_form_options.to_json.html_safe %>,
|
|
|
|
workingHoursEnabled: <%= @web_widget.inbox.working_hours_enabled %>,
|
2021-06-30 15:39:44 +00:00
|
|
|
csatSurveyEnabled: <%= @web_widget.inbox.csat_survey_enabled %>,
|
2021-03-13 06:14:28 +00:00
|
|
|
workingHours: <%= @web_widget.inbox.working_hours.to_json.html_safe %>,
|
|
|
|
outOfOfficeMessage: <%= @web_widget.inbox.out_of_office_message.to_json.html_safe %>,
|
2022-01-11 08:32:03 +00:00
|
|
|
utcOffset: '<%= ActiveSupport::TimeZone[@web_widget.inbox.timezone].now.formatted_offset %>',
|
|
|
|
allowMessagesAfterResolved: <%= @web_widget.inbox.allow_messages_after_resolved %>
|
2019-11-25 18:40:27 +00:00
|
|
|
}
|
2020-05-09 16:32:43 +00:00
|
|
|
window.chatwootWidgetDefaults = {
|
|
|
|
useInboxAvatarForBot: <%= ActiveModel::Type::Boolean.new.cast(ENV.fetch('USE_INBOX_AVATAR_FOR_BOT', false)) %>,
|
|
|
|
}
|
2021-11-22 18:02:17 +00:00
|
|
|
window.chatwootPubsubToken = '<%= @contact_inbox.pubsub_token %>'
|
2019-10-30 05:13:11 +00:00
|
|
|
window.authToken = '<%= @token %>'
|
2020-05-12 07:15:28 +00:00
|
|
|
window.globalConfig = <%= raw @global_config.to_json %>
|
2019-10-30 05:13:11 +00:00
|
|
|
</script>
|
2019-10-29 07:20:54 +00:00
|
|
|
<%= javascript_pack_tag 'widget' %>
|
|
|
|
<%= stylesheet_pack_tag 'widget' %>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div id="app"></div>
|
|
|
|
<%= yield %>
|
|
|
|
</body>
|
|
|
|
</html>
|