openfoodfacts / openfoodfacts-server

Open Food Facts database, API server and web interface - 🐪🦋 Perl, CSS and JS coders welcome 😊 For helping in Python, see Robotoff or taxonomy-editor
http://openfoodfacts.github.io/openfoodfacts-server/
GNU Affero General Public License v3.0
660 stars 389 forks source link

Convert JS in Perl template into real JS #9106

Open CharlesNepote opened 1 year ago

CharlesNepote commented 1 year ago

=> https://github.com/openfoodfacts/openfoodfacts-server/blob/main/templates/web/pages/product_edit/product_edit_form_display.tt.js

As discussed with @stephanegigandet there's not much sense to have this code in a template, full of escaped chars. It should be converted into raw JS, to ease development.

hangy commented 1 year ago

More potentials: https://github.com/search?q=repo%3Aopenfoodfacts%2Fopenfoodfacts-server%20path%3A*.tt.js&type=code

MonalikaPatnaik commented 10 months ago

Hi, can I take up this issue?

stephanegigandet commented 10 months ago

Hi @MonalikaPatnaik , sure, certainly! Thank you!

CharlesNepote commented 6 months ago

Thanks @MonalikaPatnaik!

Also, thanks to @hangy advice, we can list other files which don't have any Perl variable:

Some other .tt.js files do have Perl variables but they could be easily rewrote:

MonalikaPatnaik commented 6 months ago

Hi @CharlesNepote, I'm working on the issue..will try to wrap up by this weekend!