Projet

Général

Profil

0001-misc-make-it-possible-to-set-default-position-in-sit.patch

Frédéric Péters, 13 décembre 2015 19:29

Télécharger (1,45 ko)

Voir les différences:

Subject: [PATCH] misc: make it possible to set default position in
 site-options (#9323)

 wcs/qommon/form.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
wcs/qommon/form.py
2049 2049
        for attribute in ('initial_zoom', 'min_zoom', 'max_zoom'):
2050 2050
            if attribute in self.kwargs and self.kwargs.get(attribute) is not None:
2051 2051
                attrs['data-%s' % attribute] = self.kwargs.get(attribute)
2052
        if self.kwargs.get('default_position'):
2053
            attrs['data-def-lat'], attrs['data-def-lng'] = self.kwargs.get('default_position').split(';')
2052
        default_position = self.kwargs.get('default_position')
2053
        if not default_position:
2054
            default_position = get_publisher().get_site_option('default_position')
2055
        if not default_position:
2056
            default_position = '50.84;4.36'
2057
        attrs['data-def-lat'], attrs['data-def-lng'] = default_position.split(';')
2054 2058
        if self.kwargs.get('init_with_geoloc'):
2055 2059
            attrs['data-init-with-geoloc'] = 1
2056 2060
        r += htmltext('<div %s></div>' % ' '.join(['%s="%s"' % x for x in attrs.items()]))
2057
-