From df8bb515e20b496e41b12045c2ba3822e53147f4 Mon Sep 17 00:00:00 2001 From: karol Date: Mon, 2 Jun 2025 23:36:39 +0200 Subject: [PATCH 1/2] - fix static header in generic dialog - fix export dialog not opening --- app/assets/javascripts/exercises.js | 2 ++ app/views/exercises/index.html.slim | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/exercises.js b/app/assets/javascripts/exercises.js index 941565bf4..d7df46aa0 100644 --- a/app/assets/javascripts/exercises.js +++ b/app/assets/javascripts/exercises.js @@ -355,6 +355,7 @@ $(document).on('turbolinks:load', function () { } var exportExerciseStart = function (exerciseID) { + $('#transfer-modal .modal-title').html(I18n.t('exercises.export_codeharbor.dialogtitle')); const $exerciseDiv = $('#exercise-transfer'); const $messageDiv = $exerciseDiv.children('.transfer-message'); const $actionsDiv = $exerciseDiv.children('.transfer-exercise-actions'); @@ -448,6 +449,7 @@ $(document).on('turbolinks:load', function () { }); } var importExerciseStart = function () { + $('#transfer-modal .modal-title').html(I18n.t('exercises.import_proforma.label')); const $exerciseDiv = $('#exercise-transfer'); const $messageDiv = $exerciseDiv.children('.transfer-message'); const $actionsDiv = $exerciseDiv.children('.transfer-exercise-actions'); diff --git a/app/views/exercises/index.html.slim b/app/views/exercises/index.html.slim index 6b13278db..dac1b5f63 100644 --- a/app/views/exercises/index.html.slim +++ b/app/views/exercises/index.html.slim @@ -53,7 +53,7 @@ h1 = Exercise.model_name.human(count: :other) li = link_to(ProgrammingGroup.model_name.human(count: :other), exercise_programming_groups_path(exercise), class: 'dropdown-item') if policy(exercise).programming_groups_for_exercise? li = link_to(t('shared.destroy'), exercise, data: {confirm: t('shared.confirm_destroy')}, method: :delete, class: 'dropdown-item') if policy(exercise).destroy? li = link_to(t('.clone'), clone_exercise_path(exercise), data: {confirm: t('shared.confirm_destroy')}, method: :post, class: 'dropdown-item') if policy(exercise).clone? - li = link_to(t('exercises.export_codeharbor.label'), '', class: 'dropdown-item export-start', data: {'exercise-id': exercise.id}) if policy(exercise).export_external_confirm? + li = link_to(t('exercises.export_codeharbor.label'), '', class: 'dropdown-item export-start', data: {'exercise-id': exercise.id, 'bs-toggle': 'modal', 'bs-target': '#transfer-modal'}) if policy(exercise).export_external_confirm? li = link_to(t('exercises.download_proforma.label'), download_proforma_exercise_path(exercise), class: 'dropdown-item', target: '_blank', rel: 'noopener noreferrer') if policy(exercise).download_proforma? = render('shared/pagination', collection: @exercises) @@ -65,6 +65,5 @@ p = t('exercises.import_proforma.label') = render 'shared/modal', - title: t('exercises.export_codeharbor.dialogtitle'), modal_root_attributes: {id: 'transfer-modal'}, template: 'exercises/_transfer_dialogcontent' From 6a46fe2f03dce8d9437d3def32d773d83a045790 Mon Sep 17 00:00:00 2001 From: karol Date: Mon, 2 Jun 2025 23:38:37 +0200 Subject: [PATCH 2/2] - fix incoherent spelling of ProFormA --- config/locales/de/exercise.yml | 6 +++--- config/locales/en/exercise.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config/locales/de/exercise.yml b/config/locales/de/exercise.yml index cccc7916a..fbf06af42 100644 --- a/config/locales/de/exercise.yml +++ b/config/locales/de/exercise.yml @@ -38,7 +38,7 @@ de: file_root: Erstellte Dateien gone: Die angeforderte Datei konnte nicht abgerufen werden. Erstellte Dateien werden nur kurzzeitig vorgehalten und dann gelöscht. Bitte führen Sie den Code erneut aus und versuchen Sie dann wieder den Download der Datei. download_proforma: - label: ProformaXML ZIP herunterladen + label: ProFormA ZIP herunterladen editor: collapse_action_sidebar: Aktions-Leiste Einklappen collapse_output_sidebar: Ausgabe-Leiste Einklappen @@ -207,13 +207,13 @@ de: overwrite: Überschreiben show_exercise: Zeige Aufgabe dialog: - start: Klicke auf Datei hochladen und wähle eine ProFormAXML ZIP Datei aus, um das Importieren zu starten. + start: Klicke auf Datei hochladen und wähle eine ProFormA ZIP Datei aus, um das Importieren zu starten. import_errors: internal_error: Beim Import der Aufgabe ist ein interner Fehler aufgetreten. invalid: Fehlerhafte Aufgabe invalid_zip: Ungültige ZIP Datei no_xml_found: Keine XML Datei in ZIP Datei gefunden - label: ProFormAXML ZIP importieren + label: ProFormA ZIP importieren import_start: choose_file_error: Sie müssen eine Datei auswählen. error: 'Der folgende Fehler ist aufgetreten: %{message}.' diff --git a/config/locales/en/exercise.yml b/config/locales/en/exercise.yml index f8a50412a..5e309cde8 100644 --- a/config/locales/en/exercise.yml +++ b/config/locales/en/exercise.yml @@ -38,7 +38,7 @@ en: file_root: Generated Files gone: The requested file could not be retrieved. Generated files are only held for a short time and are then deleted. Please run the code again and then try downloading the file a second time. download_proforma: - label: Download ProformaXML ZIP + label: Download ProFormA ZIP editor: collapse_action_sidebar: Collapse Action Sidebar collapse_output_sidebar: Collapse Output Sidebar @@ -207,13 +207,13 @@ en: overwrite: Overwrite show_exercise: Show exercise dialog: - start: Press Upload and select and ProFormAXML ZIP file to start importing. + start: Press Upload and select and ProFormA ZIP file to start importing. import_errors: internal_error: An internal error occurred on CodeOcean while importing the exercise. invalid: Invalid exercise invalid_zip: Invalid ZIP file no_xml_found: No XML file found in ZIP - label: Import ProFormAXML ZIP + label: Import ProFormA ZIP import_start: choose_file_error: You need to choose a file. error: 'The following error occured: %{message}.'