Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/assets/javascripts/exercises.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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');
Expand Down
3 changes: 1 addition & 2 deletions app/views/exercises/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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'
6 changes: 3 additions & 3 deletions config/locales/de/exercise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}.'
Expand Down
6 changes: 3 additions & 3 deletions config/locales/en/exercise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}.'
Expand Down