Migrations: Fix course introduction text by lang - refs BT#20846

pull/4834/head
christian 2 years ago
parent fa0840e364
commit 631d11c7f9
  1. 6
      assets/js/translatehtml.js
  2. 16
      assets/vue/store/platformConfig.js
  3. 8
      assets/vue/views/course/CourseHome.vue

@ -28,9 +28,9 @@ export default function translateHtml() {
}
// it checks content from old version
const langs = document.querySelectorAll(
"span[lang]:not(.mce-translatehtml)"
);
const langSpans = document.querySelectorAll('span[lang]');
const langs = [...langSpans].filter(span => !span.classList.contains('mce-translatehtml'));
if (langs.length > 0) {
// it hides all contents with lang
langs.forEach(function (el) {

@ -6,7 +6,7 @@ export const usePlatformConfig = defineStore("platformConfig", () => {
const isLoading = ref(false);
const settings = ref(null);
const studentView = ref('teacherview');
const plugins = ref([])
const plugins = ref([]);
function getSetting(variable) {
if (settings.value && settings.value[variable]) {
@ -20,17 +20,17 @@ export const usePlatformConfig = defineStore("platformConfig", () => {
isLoading.value = true;
try {
const { data } = await axios.get("/platform-config/list")
const { data } = await axios.get("/platform-config/list");
settings.value = data.settings
settings.value = data.settings;
studentView.value = data.studentview
studentView.value = data.studentview;
plugins.value = data.plugins
plugins.value = data.plugins;
} catch (e) {
console.log(e)
console.log(e);
} finally {
isLoading.value = false
isLoading.value = false;
}
}
@ -39,7 +39,7 @@ export const usePlatformConfig = defineStore("platformConfig", () => {
}
function isStudentViewActive() {
return 'studentview' === studentView.value
return 'studentview' === studentView.value;
}
return {

@ -275,12 +275,7 @@ async function getIntro() {
then(response => {
intro.value = response.data;
introTool.value = response.data.c_tool;
console.log('response.data ',response.data);
createInSession.value = response.data.createInSession;
translateHtml();
}).catch(function (error) {
console.log(error);
});
@ -409,6 +404,9 @@ const isAllowedToEdit = ref(false)
onMounted(async () => {
isAllowedToEdit.value = await checkIsAllowedToEdit()
setTimeout(() => {
translateHtml();
}, 1000);
})
const onStudentViewChanged = async () => {

Loading…
Cancel
Save