Provide current-contributor application-wide

* This change allows us to reuse the current user in multiple places.
This commit is contained in:
kiragrammel
2023-09-11 13:54:30 +02:00
committed by Sebastian Serth
parent c29256aa81
commit 883169121c
4 changed files with 13 additions and 2 deletions

View File

@@ -36,8 +36,9 @@ $(document).on('turbolinks:load', function() {
window.location.reload();
});
// Set current user
// Set current user and current contributor
window.current_user = JSON.parse($('meta[name="current-user"]')?.attr('content') || null);
window.current_contributor = JSON.parse($('meta[name="current-contributor"]')?.attr('content') || null);
// Set locale for all JavaScript functions
const htmlTag = $('html')