# -*- coding: utf-8 -*- if not 'combo_plugin_gnm' in INSTALLED_APPS: INSTALLED_APPS += ('combo_plugin_gnm',) TENANT_APPS += ('combo_plugin_gnm',) MELLON_ADD_AUTHNREQUEST_NEXT_URL_EXTENSION = True COMBO_MAP_TILE_URLTEMPLATE = "https://tiles.entrouvert.org/hdm/{z}/{x}/{y}.png" COMBO_MAP_ATTRIBUTION = "© OpenStreetMap" COMBO_GEOCODING_SERVICE = 'https://nominatim.entrouvert.org' COMBO_DASHBOARD_ENABLED = True COMBO_DASHBOARD_NEW_TILE_POSITION = 'first' COMBO_MAP_DEFAULT_POSITION = {'lat': '45.7577', 'lng': '4.8320'} COMBO_MAP_MAX_BOUNDS = { "corner1": {"lat": 45.9134, "lng": 4.6733}, "corner2": {"lat": 45.5583, "lng": 5.1574} } COMBO_PUBLIC_TEMPLATES.update({ "blank": { "name": u"Blanc", "template": "combo/page_template_blank.html", }, "dashboard": { "name": u"Tableau de bord", "template": "combo/page_template_dashboard.html", }, "iconbar": { "name": u"Barre d'icônes", "template": "combo/page_template_iconbar.html", }, "iconbar-left-sidebar": { "name": u"Barre d'icônes + barre à gauche", "template": "combo/page_template_iconbar_left_sidebar.html", }, "search": { "name": u"Recherche", "template": "combo/page_template_search.html", }, "banner-two-columns": { "name": "Deux colonnes + bandeau", "template": "combo/page_template_banner_2cols.html", }, "banner-one-column": { "name": u"Une colonne + bandeau", "template": "combo/page_template_banner.html", }, "banner-two-columns-sidebar": { "name": u"Deux colonnes et une barre latérale + bandeau", "template": "combo/page_template_banner_2cols_sidebar.html", }, "place": { "name": u"Lieu", "template": "combo/page_template_place.html", }, "goto": { "name": u"M'y rendre", "template": "combo/page_template_goto.html", }, }) JSON_CELL_TYPES = { "velov": { "url": "https://download.data.grandlyon.com/ws/rdata/jcd_jcdecaux.jcdvelov/all.json?field=gid&value=[gid]", "name": u"Velov", "cache_duration": 60, "force_async": False, "auto_refresh": 90, "form": [ { "varname": "gid", "type": "string", "label": "GID de la station" } ] }, "taxi": { "url": "https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputformat=GEOJSON&request=GetFeature&typename=pvo_patrimoine_voirie.pvostationtaxi&filter=gid[gid]", "name": u"Station de taxi", "cache_duration": 86400, "force_async": False, "form": [ { "varname": "gid", "type": "string", "label": "GID de la station" } ] }, "mdr": { "url": "https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputformat=GEOJSON&maxfeatures=30&request=GetFeature&typename=ter_territoire.maison_de_la_metropole&SRSNAME=urn:ogc:def:crs:EPSG::4326&filter=identifiant[identifiant]", "cache_duration": 86400, "force_async": False, "name": u"Maison de la Métropole de Lyon", "form": [ { "varname": "identifiant", "type": "string", "label": "Identifiant" } ] }, "piscine": { "url": "https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputformat=GEOJSON&maxfeatures=30&request=GetFeature&typename=adr_voie_lieu.adrequippiscinepct&SRSNAME=urn:ogc:def:crs:EPSG::4326&filter=identifiant[identifiant]", "cache_duration": 86400, "force_async": False, "name": u"Piscine de la Métropole de Lyon", "form": [ { "varname": "identifiant", "type": "string", "label": "Identifiant" } ] }, "mairie": { "url": "https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputformat=GEOJSON&maxfeatures=30&request=GetFeature&typename=adr_voie_lieu.adrmairiepct_2_0_0&SRSNAME=urn:ogc:def:crs:EPSG::4326&filter=identifiant[identifiant]", "cache_duration": 86400, "force_async": False, "name": u"Mairie", "form": [ { "varname": "identifiant", "type": "string", "label": "Identifiant" } ] }, "decheterie": { "url": "https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputformat=GEOJSON&request=GetFeature&typename=gip_proprete.gipdecheterie_2_0_0&filter=identifiant[identifiant]", "cache_duration": 86400, "force_async": False, "name": u"Déchèterie", "form": [ { "varname": "identifiant", "type": "string", "label": "Identifiant" } ] }, "donnerie": { "url": "https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputformat=GEOJSON&request=GetFeature&typename=gip_proprete.gipdonnerie_2_0_0&filter=identifiant[identifiant]", "cache_duration": 86400, "force_async": False, "name": u"Donnerie", "form": [ { "varname": "identifiant", "type": "string", "label": "Identifiant" } ] }, "bibliotheque": { "url": "https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputformat=GEOJSON&request=GetFeature&typename=adr_voie_lieu.adrequiculturepct&SRSNAME=urn:ogc:def:crs:EPSG::4171&filter=identifiant[identifiant]", "cache_duration": 86400, "force_async": False, "name": u"Bibliothèque", "form": [ { "varname": "identifiant", "type": "string", "label": "Identifiant" } ] }, "aire-de-covoiturage": { "url": "https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputformat=GEOJSON&request=GetFeature&typename=pvo_patrimoine_voirie.pvoparking&filter=gid[gid]", "cache_duration": 86400, "force_async": False, "name": u"Aire de covoiturage", "form": [ { "varname": "gid", "type": "string", "label": "Identifiant" } ] }, "airquality": { "url": "[passerelle_url]airquality/atmo/details/fr/lyon/", "cache_duration": 300, "force_async": False, "name": u"Qualité de l'air", "form": [ { "varname": "lat", "type": "string", "label": "Latitude", "required": False, }, { "varname": "lon", "type": "string", "label": "Longitude", "required": False, } ], "additional-data": [ { "key": "air2go", "url": "{% if q_lat or lat %}http://api.atmo-aura.fr/partenaires/indice_request?api_token=6df2b0b505cc73c5545467758827458e&longitude={% firstof q_lon lon %}&latitude={% firstof q_lat lat %}{% endif %}" }, { "key": "nominatim", "url": "{% if q_lat or lat %}{{passerelle_url}}base-adresse/nominatim/reverse?lat={% firstof q_lat lat %}&lon={% firstof q_lon lon %}&format=json{% endif %}", "cache_duration": 3600, }, { "key": "places", "url": "{% if user_nameid %}{{ passerelle_url }}jsondatastore/lieux-favoris/data/?name_id={{user_nameid}}{% endif %}", }, { "key": "place_geoloc", "url": "{% if places %}{{ passerelle_url }}base-adresse/nominatim/search?q={{ places.data.0.text }}&format=json{% endif %}", "cache_duration": 3600, }, { "key": "place2_geoloc", "url": "{% if places|length > 1 %}{{ passerelle_url }}base-adresse/nominatim/search?q={{ places.data.1.text }}&format=json{% endif %}", "cache_duration": 3600, }, ], "actions": { "geocode": { "url": "{{ passerelle_url }}base-adresse/nominatim/search?q={{ q }}&format=json", "method": "get", "response": "raw" } } }, "pollen": { "url": "https://download.data.grandlyon.com/ws/rdata/rnsa_reseau_aerobio.rnsabulletin/all.json", "cache_duration": 300, "force_async": False, "name": u"Info Pollen", "additional-data": [ {"key": "syntheses", "url": "https://download.data.grandlyon.com/ws/rdata/rnsa_reseau_aerobio.rnsabulletin/all.json?field=type&value=Synthese" } ] }, "places": { "url": "[passerelle_url]jsondatastore/lieux-favoris/data/?name_id=[user_nameid]", "name": u"Lieux favoris", "force_async": False, "cache_duration": 600, "additional-data": [ { "key": "userdata", "url": "[idp_url]api/users/[user_nameid]/" } ], "actions": { "create": { "url": "[passerelle_url]jsondatastore/lieux-favoris/data/create?name_id=[user_nameid]" }, "update": { "url": "[passerelle_url]jsondatastore/lieux-favoris/data/[id]/?name_id=[user_nameid]" }, "delete": { "url": "[passerelle_url]jsondatastore/lieux-favoris/data/[id]/delete?name_id=[user_nameid]" } } }, "silo-a-verre": { "url": "https://download.data.grandlyon.com/ws/grandlyon/gic_collecte.gicsiloverre/all.json?field=identifiant&value=[identifiant]", "cache_duration": 86400, "force_async": False, "name": u"Silo à verre", "form": [ { "varname": "identifiant", "type": "string", "label": "Identifiant" } ] }, "tcl": { "url": "[passerelle_url]tcl/tcl/stop/[id]", "auto_refresh": 25, "cache_duration": 10, "force_async": False, "name": u"Arrêt TCL", "form": [ { "varname": "id", "type": "string", "label": "Identifiant" } ] }, "goto": { "url": "{% if lat1 %}{{cityway_api_url}}api/journeyplanner/opt/PlanTrips/json?DepartureType=COORDINATES&DepartureLatitude={{lat1}}&DepartureLongitude={{lng1}}&ArrivalType=COORDINATES&ArrivalLatitude={{lat2}}&ArrivalLongitude={{lng2}}&Date={{date}}&DateType=DEPARTURE&TripModes={{tripmode}}&Algorithm=FASTEST&BikeSecurityLevel=None&BikeSpeed=12&WalkSpeed=4&MaxCarDistance=100&MaxBikeDistance=100&MaxWalkDistance=3000&AvoidDisruptions=1&StopToPlaceCar=1&SpecificOptions=GetOn;3|GetOff;4|TinyDistance;300|VLS;0|CARSHARING;0&user_key={{cityway_api_userkey}}{% endif %}", "cache_duration": 60, "force_async": False, "name": u"M'y rendre", "loading-message": u'Calcul…', "varnames": ["lat1", "lng1", "lat2", "lng2", "date", "to"], "form": [ { "varname": "tripmode", "type": "string", "label": "Mode de transport (WALK, BIKE, PT, CAR)" } ] }, "cut-profile": { "url": "[idp_url]api/users/[user_nameid]/", "name": "Profil CUT", "auto_refresh": 60, }, "profile-info": { "url": "[idp_url]api/users/[user_nameid]/", "name": "Infos de profil" }, "suggestions": { "name": "Suggestions", "url": "[idp_url]api/users/[user_nameid]/", "force_async": True, "loading-message": "Assemblage en cours, quelques secondes…", "additional-data": [ {"key": "places", "url": "[passerelle_url]jsondatastore/lieux-favoris/data/?name_id=[user_nameid]" } ] }, "alerte-qualite-de-l-air": { "url": "[passerelle_url]feeds/alertes-qualite-de-lair/json", "cache_duration": 600, "force_async": True, "name": u"Alerte qualité de l'air" }, "mairie-usager": { "name": "Mairie de l'usager", "url": "[idp_url]api/users/[user_nameid]/", "form": [ { "varname": "text", "type": "text", "label": "Texte" } ] }, "group-title": { "name": "Intertitre", "url": "{{}}", "form": [ { "varname": "text", "type": "text", "label": "Texte" } ] }, "stats": { "name": "Statistiques tuiles", "url": "{{portal_url}}gnm/stats/", }, "parkingtr": { "url": "https://%(data_username)s:%(data_password)s@download.data.grandlyon.com/wfs/rdata?SERVICE=WFS&VERSION=2.0.0&outputformat=GEOJSON&request=GetFeature&typename=pvo_patrimoine_voirie.pvoparkingtr&filter=pkgid[pkgid]" % DATA_CREDENTIALS, "cache_duration": 86400, "force_async": False, "name": u"Parking", "form": [ { "varname": "pkgid", "type": "string", "label": "Identifiant" } ] }, "parc-velo": { "url": "https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputformat=GEOJSON&request=GetFeature&typename=pvo_patrimoine_voirie.pvostationnementvelo&filter=gid[gid]", "cache_duration": 86400, "force_async": False, "name": u"Parc de stationnement vélos", "form": [ { "varname": "gid", "type": "string", "label": "Identifiant" } ] }, "autopartage": { "url": "https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputformat=GEOJSON&request=GetFeature&typename=pvo_patrimoine_voirie.pvostationautopartage&filter=gid[gid]", "cache_duration": 86400, "force_async": False, "name": u"Autopartage", "form": [ { "varname": "gid", "type": "string", "label": "Identifiant" } ] }, "stationnement-pmr": { "url": "https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputformat=GEOJSON&request=GetFeature&typename=vdl_deplacements.emplacement_pmr&filter=gid[gid]", "cache_duration": 86400, "force_async": False, "name": u"Stationnement réglementé pour les PMR", "form": [ { "varname": "gid", "type": "string", "label": "Identifiant" } ] }, "evenement-routier": { "url": "https://%(data_username)s:%(data_password)s@download.data.grandlyon.com/wfs/rdata?SERVICE=WFS&VERSION=2.0.0&outputformat=GEOJSON&request=GetFeature&typename=pvo_patrimoine_voirie.pvoevenement&filter=id[id]" % DATA_CREDENTIALS, "cache_duration": 86400, "force_async": False, "name": u"Evenement routier", "form": [ { "varname": "id", "type": "string", "label": "Identifiant" } ] }, "cartads-dossiers": { "url": "{{passerelle_url}}grandlyon-cartads-cs/{{slug}}/files?name_id={{user_nameid}}", "cache_duration": 0, "force_async": True, "name": u"Dossiers Cart@DS", "form": [ { "varname": "slug", "type": "string", "label": "Slug du connecteur" } ], "actions": { "unsubscribe": { "url": "{{passerelle_url}}grandlyon-cartads-cs/{{slug}}/unsubscribe?name_id={{user_nameid}}", }, } }, } COMBO_ASSET_SLOTS = { "banner:cut": { "label": u"Logo bandeau pour Grand Lyon Connect" }, "commune:banner": { "label": u"Bandeau communal" }, "passerelle:cartads:dossier": { "label": u"Image tuile dossier urbanisme" }, } PRODUCER_LABELS = { 'atmo': u'ATMO Auvergne Rhône-Alpes', 'rnsa': u'RNSA', 'onlymoov': u'ONLY MOOV', 'tcl': u'TCL', 'toodego': u'Toodego', 'velov': u"Velo'v", 'vivrou': u"Vivrou", 'grandlyon': u'Grand Lyon', 'bluely': u"Bluely", 'citiz-lpa': u"Citiz LPA", 'sncf': u"SNCF", 'effia': u"EFFIA", 'indigo': u"Indigo", 'lpa': u"LPA", 'sas-parc-opera': u"SAS Parc Opera", 'q-park': u"Q-Park", 'unibail': u"Unibail", 'sajr': u"sajr", 'aeroport-saint-exupe': u"Aéroport Saint Exupe", } COLLECTIVITY_LABELS = { "albigny-sur-saone": u"Albigny-sur-Saône", "bron": u"Bron", "cailloux-sur-fontaines": u"Cailloux-sur-Fontaines", "caluire-et-cuire": u"Caluire-et-Cuire", "champagne-au-mont-d-or": u"Champagne-au-Mont-d'Or", "charbonnieres-les-bains": u"Charbonnières-les-Bains", "charly": u"Charly", "chassieu": u"Chassieu", "collonges-au-mont-d-or": u"Collonges-au-Mont-d'Or", "corbas": u"Corbas", "couzon-au-mont-d-or": u"Couzon-au-Mont-d'Or", "craponne": u"Craponne", "curis-au-mont-d-or": u"Curis-au-Mont-d'Or", "dardilly": u"Dardilly", "decines-charpieu": u"Décines-Charpieu", "ecully": u"Écully", "feyzin": u"Feyzin", "fleurieu-sur-saone": u"Fleurieu-sur-Saône", "fontaines-saint-martin": u"Fontaines-Saint-Martin", "fontaines-sur-saone": u"Fontaines-sur-Saône", "francheville": u"Francheville", "genay": u"Genay", "givors": u"Givors", "grigny": u"Grigny", "irigny": u"Irigny", "jonage": u"Jonage", "la-mulatiere": u"La Mulatière", "la-tour-de-salvagny": u"La Tour de Salvagny", "limonest": u"Limonest", "lissieu": u"Lissieu", "lyon": u"Lyon", "marcy-l-etoile": u"Marcy-l'Étoile", "meyzieu": u"Meyzieu", "mions": u"Mions", "montanay": u"Montanay", "neuville-sur-saone": u"Neuville-sur-Saône", "oullins": u"Oullins", "pierre-benite": u"Pierre-Bénite", "poleymieux-au-mont-d-or": u"Poleymieux-au-Mont-d'Or", "quincieux": u"Quincieux", "rillieux-la-pape": u"Rillieux-la-Pape", "rochetaillee-sur-saone": u"Rochetaillée-sur-Saône", "saint-cyr-au-mont-d-or": u"Saint-Cyr-au-Mont-d'Or", "saint-didier-au-mont-d-or": u"Saint-Didier-au-Mont-d'Or", "saint-fons": u"Saint-Fons", "saint-genis-laval": u"Saint-Genis-Laval", "saint-genis-les-ollieres": u"Saint-Genis-les-Ollières", "saint-germain-au-mont-d-or": u"Saint-Germain-au-Mont-d'Or", "saint-priest": u"Saint-Priest", "sainte-foy-les-lyon": u"Sainte-Foy-lès-Lyon", "sathonay-camp": u"Sathonay-Camp", "sathonay-village": u"Sathonay-Village", "solaize": u"Solaize", "st-romain-au-mont-d-or": u"Saint-Romain-au-Mont-d'Or", "tassin-la-demi-lune": u"Tassin-la-Demi-Lune", "vaulx-en-velin": u"Vaulx-en-Velin", "venissieux": u"Venissieux", "vernaison": u"Vernaison", "villeurbanne": u"Villeurbanne", } PRODUCER_LABELS.update(COLLECTIVITY_LABELS) for producer, producer_label in PRODUCER_LABELS.items(): COMBO_ASSET_SLOTS['logo:%s' % producer] = { 'label': u'Logo %s' % producer_label } # add lyon as used by cart@ds for arrondissement in ['1er'] + ['%seme' % x for x in range(2, 10)]: COMBO_ASSET_SLOTS['logo:lyon-%s' % arrondissement] = { 'label': u'Logo Lyon %s' % arrondissement, } tiles = [ ('air', u"Qualité de l'air"), ('bibliotheque', u"Bibliothèque"), ('covoiturage', u"Aire de covoiturage"), ('decheterie', u"Déchèterie"), ('donnerie', u"Donnerie"), ('mairie', u"Mairie"), ('mdr', u"Maison du Rhône"), ('parc-velo', u"Parc vélo"), ('piscine', u"Piscine"), ('pollen', u"Pollen"), ('silo-a-verre', u'Silo à verre'), ('taxi', u"Taxi"), ('tcl', u"TCL"), ('velov', u"Velo'v"), ('parkingtr', u"Parking"), ('autopartage', u"Autopartage"), ('evenement-routier', u"Événement routier"), ('pmr', u"Stationnement PMR"), ] for tile, tile_label in tiles: COMBO_ASSET_SLOTS['picture:%s' % tile] = { 'label': u'Photographie %s' % tile_label } if tile not in ('taxi', 'tcl', 'velov'): COMBO_ASSET_SLOTS['picture:banner:%s' % tile] = { 'label': u'Photographie/bannière %s' % tile_label } WCS_FORM_ASSET_SLOTS = { "picture": { "prefix": u"Photographie" }, "picture:banner": { "prefix": u"Photographie/bannière" }, "logo": { "prefix": u"Picto" }, } import memcache memcache.SERVER_MAX_VALUE_LENGTH = 10 * 1024 * 1024 SESSION_EXPIRE_AT_BROWSER_CLOSE = False