materialscloud-org / voila-materialscloud-template

The Voila template for Materials Cloud.
Other
2 stars 3 forks source link

Properly locate MaterialsCloud spinner SVG #22

Closed CasperWA closed 3 years ago

CasperWA commented 3 years ago

Fixes #20

Check solution on binder.

The solution to make sure the correct base URL is always located, is to utilize the resources variable. However, this is not available in the spinner macro. To overcome this, I am now passing in the resources.base_url in the spinner.html() macro, which I can only do by "commandeering" the code where spinner.html() is called. Since this is done in the lab Voilà template, I have copied over the relevant body_header block and changed the line that needed changing. Furthermore, the spinner macro, specifically the spinner.html() macro now takes the added base_url parameter as input.

This has been tested both locally and on binder and seems to work as intended.

dou-du commented 3 years ago

Fixes #20

Check solution on binder.

The solution to make sure the correct base URL is always located, is to utilize the resources variable. However, this is not available in the spinner macro. To overcome this, I am now passing in the resources.base_url in the spinner.html() macro, which I can only do by "commandeering" the code where spinner.html() is called. Since this is done in the lab Voilà template, I have copied over the relevant body_header block and changed the line that needed changing. Furthermore, the spinner macro, specifically the spinner.html() macro now takes the added base_url parameter as input.

This has been tested both locally and on binder and seems to work as intended.

Great! This is very nice. Thanks.