talpor / django-dashing

django-dashing is a customisable, modular dashboard application framework for Django to visualize interesting data about your project. Inspired in the dashboard framework Dashing
BSD 3-Clause "New" or "Revised" License
731 stars 108 forks source link

map: add support for specifying a Google Maps API key #66

Closed noirbee closed 7 years ago

noirbee commented 8 years ago

I did not get the map widget to work without adding a Google Maps API key to the JS script loading function, hence this PR.

It's implemented using an additional settings key, WIDGET_CONFIGS, to hold the API key, because as I understand it it's not possible to have it in dashing-config.js since the Google Maps javascript has already been loaded earlier in dashing.js. I added a new template tag, widget_configs, similar to the existing styles and scripts tags, since once again I saw no over simpler way to do it.

If you agree with the way this is implemented I'll go about updating the docs as well to explain how the new settings key must be used (it's basically a widget name -> {key, value} dict that ends pushed down as <script> snippets in base.html).

mtdb commented 7 years ago

Hi, sorry for the lateness but I was offline for a couple of weeks, I like this approach to add config variables to the widgets, and the code looks good, please add the documentation to proceed with the merge of this pull request.

noirbee commented 7 years ago

And here are the updated docs !

mtdb commented 7 years ago

looks good, thanks :)