def media(self): qs_dict = {'v': '3'} if self.google_maps_api_key is not None: qs_dict['key'] = self.google_maps_api_key js = ( 'floppyforms/openlayers/OpenLayers.js', 'floppyforms/js/MapWidget.js', # Needs (safe) because may contain "&": safe('https://maps.google.com/maps/api/js?' + urlencode(qs_dict))) return forms.Media(js=js)
def media(self): css = { 'all': ('bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker3.min.css', ) } js = () if not settings.MYMONEY['USE_L10N_DIST'] and settings.MYMONEY[ 'BOOTSTRAP_DATEPICKER_LANGCODE']: js += ( 'bower_components/bootstrap-datepicker/dist/locales/bootstrap-datepicker.{lang}.min.js' .format( lang=settings.MYMONEY['BOOTSTRAP_DATEPICKER_LANGCODE'], ), ) return forms.Media(css=css, js=js)
def _media(self): return forms.Media( js=('//maps.googleapis.com/maps/api/js?%s' % \ urlencode(self.get_google_maps_api_vars()),) )
def media(self): return super(MultiPolygonWidget, self).media + forms.Media(js=('gis/MapBoxExtend.js', ))