pallets-eco / flask-admin

Simple and extensible administrative interface framework for Flask
https://flask-admin.readthedocs.io
BSD 3-Clause "New" or "Revised" License
5.73k stars 1.57k forks source link

Dynamically fill a javascript config #1781

Open redking1 opened 5 years ago

redking1 commented 5 years ago

Hey,

Wondering if it is possible to dynamically change a javascript or a html file based on who is logged in? I want to fill my javascript config file with the users login name or email to use this-

https://ckeditor.com/cke4/addon/lite

So i can set the author of the changes in ckeditor to whoever is logged in.

Thanks :)

mrjoes commented 5 years ago

If you use the https://github.com/mrjoes/flask-admin/tree/master/examples/wysiwyg as a foundation, you can get a current user in the widget and emit a necessary JavaScript that'll initialize the CKEditor.