Skip to content

Commit 8f4b31d

Browse files
authored
Bugfix transfer dialog header, translation unification (#2941)
* - fix static header in generic dialog - fix export dialog not opening * - fix incoherent spelling of ProFormA
1 parent 96edb0f commit 8f4b31d

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

app/assets/javascripts/exercises.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ $(document).on('turbolinks:load', function () {
355355
}
356356

357357
var exportExerciseStart = function (exerciseID) {
358+
$('#transfer-modal .modal-title').html(I18n.t('exercises.export_codeharbor.dialogtitle'));
358359
const $exerciseDiv = $('#exercise-transfer');
359360
const $messageDiv = $exerciseDiv.children('.transfer-message');
360361
const $actionsDiv = $exerciseDiv.children('.transfer-exercise-actions');
@@ -448,6 +449,7 @@ $(document).on('turbolinks:load', function () {
448449
});
449450
}
450451
var importExerciseStart = function () {
452+
$('#transfer-modal .modal-title').html(I18n.t('exercises.import_proforma.label'));
451453
const $exerciseDiv = $('#exercise-transfer');
452454
const $messageDiv = $exerciseDiv.children('.transfer-message');
453455
const $actionsDiv = $exerciseDiv.children('.transfer-exercise-actions');

app/views/exercises/index.html.slim

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ h1 = Exercise.model_name.human(count: :other)
5353
li = link_to(ProgrammingGroup.model_name.human(count: :other), exercise_programming_groups_path(exercise), class: 'dropdown-item') if policy(exercise).programming_groups_for_exercise?
5454
li = link_to(t('shared.destroy'), exercise, data: {confirm: t('shared.confirm_destroy')}, method: :delete, class: 'dropdown-item') if policy(exercise).destroy?
5555
li = link_to(t('.clone'), clone_exercise_path(exercise), data: {confirm: t('shared.confirm_destroy')}, method: :post, class: 'dropdown-item') if policy(exercise).clone?
56-
li = link_to(t('exercises.export_codeharbor.label'), '', class: 'dropdown-item export-start', data: {'exercise-id': exercise.id}) if policy(exercise).export_external_confirm?
56+
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?
5757
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?
5858

5959
= render('shared/pagination', collection: @exercises)
@@ -65,6 +65,5 @@ p
6565
= t('exercises.import_proforma.label')
6666

6767
= render 'shared/modal',
68-
title: t('exercises.export_codeharbor.dialogtitle'),
6968
modal_root_attributes: {id: 'transfer-modal'},
7069
template: 'exercises/_transfer_dialogcontent'

config/locales/de/exercise.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ de:
3838
file_root: Erstellte Dateien
3939
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.
4040
download_proforma:
41-
label: ProformaXML ZIP herunterladen
41+
label: ProFormA ZIP herunterladen
4242
editor:
4343
collapse_action_sidebar: Aktions-Leiste Einklappen
4444
collapse_output_sidebar: Ausgabe-Leiste Einklappen
@@ -207,13 +207,13 @@ de:
207207
overwrite: Überschreiben
208208
show_exercise: Zeige Aufgabe
209209
dialog:
210-
start: Klicke auf Datei hochladen und wähle eine ProFormAXML ZIP Datei aus, um das Importieren zu starten.
210+
start: Klicke auf Datei hochladen und wähle eine ProFormA ZIP Datei aus, um das Importieren zu starten.
211211
import_errors:
212212
internal_error: Beim Import der Aufgabe ist ein interner Fehler aufgetreten.
213213
invalid: Fehlerhafte Aufgabe
214214
invalid_zip: Ungültige ZIP Datei
215215
no_xml_found: Keine XML Datei in ZIP Datei gefunden
216-
label: ProFormAXML ZIP importieren
216+
label: ProFormA ZIP importieren
217217
import_start:
218218
choose_file_error: Sie müssen eine Datei auswählen.
219219
error: 'Der folgende Fehler ist aufgetreten: %{message}.'

config/locales/en/exercise.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ en:
3838
file_root: Generated Files
3939
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.
4040
download_proforma:
41-
label: Download ProformaXML ZIP
41+
label: Download ProFormA ZIP
4242
editor:
4343
collapse_action_sidebar: Collapse Action Sidebar
4444
collapse_output_sidebar: Collapse Output Sidebar
@@ -207,13 +207,13 @@ en:
207207
overwrite: Overwrite
208208
show_exercise: Show exercise
209209
dialog:
210-
start: Press Upload and select and ProFormAXML ZIP file to start importing.
210+
start: Press Upload and select and ProFormA ZIP file to start importing.
211211
import_errors:
212212
internal_error: An internal error occurred on CodeOcean while importing the exercise.
213213
invalid: Invalid exercise
214214
invalid_zip: Invalid ZIP file
215215
no_xml_found: No XML file found in ZIP
216-
label: Import ProFormAXML ZIP
216+
label: Import ProFormA ZIP
217217
import_start:
218218
choose_file_error: You need to choose a file.
219219
error: 'The following error occured: %{message}.'

0 commit comments

Comments
 (0)