- TRA-76 - Send Button color changes implemented
- TRA-72 - Translation of privacy statement and T&C - TRA-73 - Strange characters in Tenant Make Name - Addition of meta information in Specialist Form Fields
This commit is contained in:
@@ -9,10 +9,10 @@
|
||||
<script>
|
||||
// Definieer chatConfig voordat componenten worden geladen
|
||||
window.chatConfig = {
|
||||
explanation: `{{ customisation.sidebar_markdown|default('') }}`,
|
||||
progress_tracker_insights: `{{ customisation.progress_tracker_insights|default('No Information') }}`,
|
||||
form_title_display: `{{ customisation.form_title_display|default('Full Title') }}`,
|
||||
conversationId: '{{ conversation_id|default("default") }}',
|
||||
explanation: {{ customisation.sidebar_markdown|default('')|tojson }},
|
||||
progress_tracker_insights: {{ customisation.progress_tracker_insights|default('No Information')|tojson }},
|
||||
form_title_display: {{ customisation.form_title_display|default('Full Title')|tojson }},
|
||||
conversationId: {{ conversation_id|default('default')|tojson }},
|
||||
messages: {{ messages|tojson|safe }},
|
||||
settings: {
|
||||
maxMessageLength: {{ settings.max_message_length|default(2000) }},
|
||||
@@ -22,15 +22,15 @@
|
||||
allowReactions: {{ settings.allow_reactions|default('true')|lower }}
|
||||
},
|
||||
apiPrefix: '/chat-client/chat',
|
||||
language: '{{ session.magic_link.specialist_args.language|default("en") }}',
|
||||
language: {{ session.magic_link.specialist_args.language|default('en')|tojson }},
|
||||
supportedLanguageDetails: {{ config.SUPPORTED_LANGUAGE_DETAILS|tojson|safe }},
|
||||
allowedLanguages: {{ tenant_make.allowed_languages|tojson|safe }},
|
||||
tenantMake: {
|
||||
name: "{{ tenant_make.name|default('EveAI') }}",
|
||||
logo_url: "{{ tenant_make.logo_url|default('') }}"
|
||||
},
|
||||
tenantMake: {{ {
|
||||
'name': tenant_make.name or 'EveAI',
|
||||
'logo_url': tenant_make.logo_url or ''
|
||||
}|tojson|safe }},
|
||||
// Environment-aware static base provided by Flask's overridden url_for
|
||||
staticBase: '{{ static_url }}'
|
||||
staticBase: {{ static_url|tojson }}
|
||||
};
|
||||
|
||||
// Debug info om te controleren of chatConfig correct is ingesteld
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
try { globalThis.staticUrl = window.staticUrl; } catch (e) {}
|
||||
} else {
|
||||
// Prefer runtime chatConfig.staticBase; else fallback to server-provided base or default
|
||||
var serverStaticBase = '{{ static_url|default("") }}' || '';
|
||||
if (!serverStaticBase) { serverStaticBase = '{{ url_for("static", filename="") }}'; }
|
||||
var serverStaticBase = {{ static_url|default('')|tojson }} || '';
|
||||
if (!serverStaticBase) { serverStaticBase = {{ url_for('static', filename='')|tojson }}; }
|
||||
var base = (window.chatConfig && window.chatConfig.staticBase) ? window.chatConfig.staticBase : (serverStaticBase || '/static/');
|
||||
var normalizedBase = String(base).replace(/\/+$/, '/');
|
||||
window.staticUrl = function(path) {
|
||||
@@ -34,19 +34,19 @@
|
||||
window.chatConfig.supportedLanguages = [
|
||||
{% for lang_code in config.SUPPORTED_LANGUAGES %}
|
||||
{
|
||||
code: "{{ lang_code }}",
|
||||
name: "{{ config.SUPPORTED_LANGUAGE_DETAILS[config.SUPPORTED_LANGUAGES_FULL[loop.index0]]['iso 639-1'] }}",
|
||||
flag: "{{ config.SUPPORTED_LANGUAGE_DETAILS[config.SUPPORTED_LANGUAGES_FULL[loop.index0]]['flag'] }}"
|
||||
code: {{ lang_code|tojson }},
|
||||
name: {{ config.SUPPORTED_LANGUAGE_DETAILS[config.SUPPORTED_LANGUAGES_FULL[loop.index0]]['iso 639-1']|tojson }},
|
||||
flag: {{ config.SUPPORTED_LANGUAGE_DETAILS[config.SUPPORTED_LANGUAGES_FULL[loop.index0]]['flag']|tojson }}
|
||||
}{% if not loop.last %},{% endif %}
|
||||
{% endfor %}
|
||||
];
|
||||
|
||||
// Voeg tenantMake toe aan chatConfig als die nog niet bestaat
|
||||
if (!window.chatConfig.tenantMake) {
|
||||
window.chatConfig.tenantMake = {
|
||||
name: "{{ tenant_make.name|default('EveAI') }}",
|
||||
logo_url: "{{ tenant_make.logo_url|default('') }}"
|
||||
};
|
||||
window.chatConfig.tenantMake = {{ {
|
||||
'name': tenant_make.name or 'EveAI',
|
||||
'logo_url': tenant_make.logo_url or ''
|
||||
}|tojson|safe }};
|
||||
}
|
||||
|
||||
console.log('Taalinstellingen toegevoegd aan chatConfig');
|
||||
|
||||
Reference in New Issue
Block a user