]> git.parisson.com Git - teleforma.git/commitdiff
Open student link in new tab : https://trackers.pilotsystems.net/prebarreau/0311
authorYoan Le Clanche <yoanl@pilotsystems.net>
Mon, 13 Dec 2021 15:53:51 +0000 (16:53 +0100)
committerYoan Le Clanche <yoanl@pilotsystems.net>
Mon, 13 Dec 2021 15:53:51 +0000 (16:53 +0100)
teleforma/admin.py
teleforma/static/admin/js/admin-teleforma.js [new file with mode: 0644]

index b78db2c509d7c9f94c8255433bc0791feab64f48..2fd8123c79eaa7db9b76afa3de0ef8972a36cb7d 100644 (file)
@@ -157,6 +157,11 @@ class StudentAdmin(admin.ModelAdmin):
     actions = ['export_xls', 'write_message', 'add_to_group']
     action_form = StudentGroupForm
 
+    class Media:
+        js = (
+            'admin/js/admin-teleforma.js',
+        )
+
     def get_trainings(self, instance):
         return ' - '.join([str(training) for training in instance.trainings.all()])
 
diff --git a/teleforma/static/admin/js/admin-teleforma.js b/teleforma/static/admin/js/admin-teleforma.js
new file mode 100644 (file)
index 0000000..024c840
--- /dev/null
@@ -0,0 +1,4 @@
+$(document).ready(function() {
+    // links should be opened in new tab to avoid a bug with the back button and multiselect field on FF : https://trackers.pilotsystems.net/prebarreau/0311
+    $("a:contains('Voir sur le site')").attr("target", "_blank")
+})
\ No newline at end of file