openfoodfoundation / openfoodnetwork

Connect suppliers, distributors and consumers to trade local produce.
https://www.openfoodnetwork.org
GNU Affero General Public License v3.0
1.11k stars 718 forks source link

Convert all erb templates from erb to haml #4584

Open luisramos0 opened 4 years ago

luisramos0 commented 4 years ago

What we should change and why (this is tech debt)

There are a couple of templates in erb for example app/views/spree/admin/shared/_address_form.html.haml brought from spree that we can now convert to haml. This is related to openfoodfoundation/wishlist#343. Some of these template like _address_form. mentioned above contain js that needs to be converted and tested carefully.

Context

This came up in openfoodfoundation/openfoodnetwork#4513

Impact and timeline

This is not very urgent.

luisramos0 commented 4 years ago

After spree_backend is removed, this is the list of erb files we need to convert:

Most of the code in these files is not erb anyway... Should be very easy to get this done. One idiom that appears in a few files and needs to be converted is this "escape_javascript":

$("#new_variant").html('<%= escape_javascript(render template: 'spree/admin/variants/new', formats: [:html], handlers: [:erb]) %>');