diff --git a/app/assets/javascripts/editor/participantsupport.js.erb b/app/assets/javascripts/editor/participantsupport.js.erb index a8fc8437..f2745242 100644 --- a/app/assets/javascripts/editor/participantsupport.js.erb +++ b/app/assets/javascripts/editor/participantsupport.js.erb @@ -94,7 +94,7 @@ CodeOceanEditorFlowr = { var body = resultTile.find('.card-body'); body.html(result.body); body.append('' + - '<%= I18n.t('exercises.implement.flowr.go_to_question') %>'); + `${I18n.t('exercises.implement.flowr.go_to_question')}`); body.find('.btn').on('click', CodeOceanEditor.createEventHandler('editor_flowr_click_question', questionUrl)); flowrHintBody.append(resultTile); diff --git a/app/assets/javascripts/exercise_collections.js.erb b/app/assets/javascripts/exercise_collections.js.erb index 154f82ff..786d0443 100644 --- a/app/assets/javascripts/exercise_collections.js.erb +++ b/app/assets/javascripts/exercise_collections.js.erb @@ -92,9 +92,9 @@ $(document).on('turbolinks:load', function() { .style("left", event.pageX - 50 + "px") .style("top", event.pageY + 50 + "px") .style("display", "inline-block") - .html("<%= I18n.t('activerecord.models.exercise.one') %> ID: " + d.exercise_id + "
" + - "<%= I18n.t('activerecord.attributes.exercise.title') %>: " + d.exercise_title + "
" + - "<%= I18n.t('exercises.statistics.average_worktime') %>: " + d.working_time + "s"); + .html(`${I18n.t('activerecord.models.exercise.one')} ID: ${d.exercise_id}
` + + `${I18n.t('activerecord.attributes.exercise.title')}: ${d.exercise_title}
` + + `${I18n.t('exercises.statistics.average_worktime')}: ${d.working_time}s`); }) .on("mouseout", function () { tooltip.style("display", "none"); @@ -174,8 +174,8 @@ $(document).on('turbolinks:load', function() { var template = '' + '' + '' + exercise.title + '' + - `<%= I18n.t('shared.show') %>` + - '<%= I18n.t('shared.destroy') %>'; + `${I18n.t('shared.show')}` + + `${I18n.t('shared.destroy')}`; exerciseList.find('tbody').append(template); $('#exercise-list').find('option[value="' + exercise.id + '"]').prop('selected', true); } diff --git a/app/assets/javascripts/exercises.js.erb b/app/assets/javascripts/exercises.js.erb index 4f9deb8a..804ad5c2 100644 --- a/app/assets/javascripts/exercises.js.erb +++ b/app/assets/javascripts/exercises.js.erb @@ -100,7 +100,7 @@ $(document).on('turbolinks:load', function () { event.preventDefault(); var fileUrl = $(event.target).data('file-url'); - if (confirm('<%= I18n.t('shared.confirm_destroy') %>')) { + if (confirm(I18n.t('shared.confirm_destroy'))) { var jqxhr = $.ajax({ // normal file path (without json) would destroy the context object (the exercise) as well, due to redirection // to the context after the :destroy action. @@ -312,7 +312,7 @@ $(document).on('turbolinks:load', function () { new_execution_environment = $('#exercise_execution_environment_id').val(); if (new_execution_environment == '' && !$('#exercise_unpublished').prop('checked')) { - if (confirm('<%= I18n.t('exercises.form.unpublish_warning') %>')) { + if (confirm(I18n.t('exercises.form.unpublish_warning'))) { $('#exercise_unpublished').prop('checked', true); } else { return $('#exercise_execution_environment_id').val(old_execution_environment).trigger("chosen:updated"); @@ -325,11 +325,11 @@ $(document).on('turbolinks:load', function () { var observeUnpublishedState = function () { $('#exercise_unpublished').on('change', function () { if ($('#exercise_unpublished').prop('checked')) { - if (!confirm('<%= I18n.t('exercises.form.unpublish_warning') %>')) { + if (!confirm(I18n.t('exercises.form.unpublish_warning'))) { $('#exercise_unpublished').prop('checked', false); } } else if ($('#exercise_execution_environment_id').val() == '') { - alert('<%= I18n.t('exercises.form.no_execution_environment_selected') %>'); + alert(I18n.t('exercises.form.no_execution_environment_selected')); $('#exercise_unpublished').prop('checked', true); } }) @@ -356,7 +356,7 @@ $(document).on('turbolinks:load', function () { $messageDiv.removeClass('export-failure'); - $messageDiv.html('<%= I18n.t('exercises.export_codeharbor.checking_codeharbor') %>'); + $messageDiv.html(I18n.t('exercises.export_codeharbor.checking_codeharbor')); $actionsDiv.html('
'); return $.ajax({