configcommunity.json.j2 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. {% set map_domains = [] %}
  2. {% for domain in domaenen|dictsort %}
  3. {% if item == domain[1]['community'] %}
  4. {% if map_domains.append(domain) %}{% endif %}
  5. {% endif %}
  6. {% endfor %}
  7. {
  8. "dataPath": "/data/map_{% for domain in map_domains %}{{freifunk.kurzname}}d{{domain[0]}}{% if not loop.last %},{% endif %}{% endfor %}/",
  9. "siteName": "Freifunk {{item}}",
  10. "mapSigmaScale": {{ mapconfig.communityMap.map_scale }},
  11. "showContact": {{ mapconfig.communityMap.map_show_contact | lower}},
  12. "maxAge": {{ mapconfig.communityMap.map_max_age }},
  13. {% if "max_goto_zoom" in mapconfig.communityMap %}
  14. "maxGotoZoom": {{ mapconfig.communityMap.max_goto_zoom }},
  15. {% endif %}
  16. "mapLayers": [
  17. {% for layer in mapconfig.layers %}
  18. {
  19. "name": "{{layer.name}}",
  20. "url": "{{layer.url}}",
  21. "config": {
  22. {% for k,v in layer.config|dictsort %}
  23. "{{k}}": {% if v is number %}{{v}}{% else %}"{{v}}"{% endif %}{% if not loop.last %},{% endif %}
  24. {% endfor %}
  25. }
  26. }{% if not loop.last %},{% endif %}
  27. {% endfor %}
  28. ],
  29. "siteNames": [
  30. {% for domain in map_domains %}
  31. { "site": "{{freifunk.kurzname}}d{{domain[0]}}", "name": "Domäne {{domain[0]}} - {{domain[1].name}}" }{% if not loop.last %},{% endif %}
  32. {% endfor %}
  33. ],
  34. {% if mapconfig.globalInfos is defined %}
  35. "globalInfos": [
  36. {% for globalInfo in mapconfig.globalInfos %}
  37. { "name": "{{ globalInfo.name }}",
  38. "iframe": "{{ globalInfo.iframe }}"{% if globalInfo.caption is defined %},
  39. "caption": "{{ globalInfo.caption }}"{% endif %}
  40. }{% if not loop.last %},{% endif %}
  41. {% endfor %}
  42. ],
  43. {% endif %}
  44. {% if mapconfig.nodeInfos is defined %}
  45. "nodeInfos": [
  46. {% for nodeInfo in mapconfig.nodeInfos %}
  47. { "name": "{{ nodeInfo.name }}",
  48. "iframe": "{{ nodeInfo.iframe }}"{% if nodeInfo.caption is defined %},
  49. "caption": "{{ nodeInfo.caption }}"{% endif %}
  50. }{% if not loop.last %},{% endif %}
  51. {% endfor %}
  52. ],
  53. {% endif %}
  54. "hwImg": [
  55. {
  56. "thumbnail": "/hwpics/{MODELHASH}.svg",
  57. "caption": "Knoten {MODELHASH}"
  58. }
  59. ]
  60. }