- Eerste stap in het opnieuw laten werken van de chat client...
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
{{ tenant_make.name|default('') }}
|
||||
</div>
|
||||
<div id="language-selector-container"></div>
|
||||
<div class="sidebar-explanation" v-html="compiledExplanation"></div>
|
||||
<div class="sidebar-explanation" id="sidebar-explanation"></div>
|
||||
</div>
|
||||
|
||||
<!-- Right content area - contains the chat client -->
|
||||
@@ -47,44 +47,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="{{url_for('static', filename='dist/chat-client.js')}}"></script>
|
||||
<script>
|
||||
// Maak ondersteunde talen beschikbaar voor de client
|
||||
window.config = {
|
||||
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'] }}"
|
||||
}{% if not loop.last %},{% endif %}
|
||||
{% endfor %}
|
||||
]
|
||||
};
|
||||
|
||||
// Create Vue app and make it available globally
|
||||
window.__vueApp = Vue.createApp({
|
||||
data() {
|
||||
return {
|
||||
explanation: `{{ customisation.sidebar_markdown|default('') }}`
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
compiledExplanation: function() {
|
||||
// Handle different versions of the marked library
|
||||
if (typeof marked === 'function') {
|
||||
return marked(this.explanation);
|
||||
} else if (marked && typeof marked.parse === 'function') {
|
||||
return marked.parse(this.explanation);
|
||||
} else {
|
||||
console.error('Marked library not properly loaded');
|
||||
return this.explanation; // Fallback to raw text
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
{% include 'scripts.html' %}
|
||||
{% block scripts %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user