decidim-core 0.20.0 → 0.20.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of decidim-core might be problematic. Click here for more details.

@@ -551,16 +551,6 @@ pl:
551
551
  gamification:
552
552
  all_badges_link: Zobacz wszystkie dostępne odznaki.
553
553
  badges:
554
- continuity:
555
- conditions:
556
- - Chodź tu często
557
- description: Ta odznaka jest przyznawana podczas regularnego odwiedzania platformy. Lubimy mieć cię tutaj!
558
- description_another: Ten użytkownik nawiązał połączenie przez %{score} kolejnych dni w pewnym momencie.
559
- description_own: W pewnym momencie łączyłeś się przez %{score} kolejnych dni.
560
- name: Ciągłość
561
- next_level_in: Łącz przez %{score} kolejnych dni, aby przejść do następnego poziomu!
562
- unearned_another: Ten użytkownik nie zalogował się przez więcej niż jeden kolejny dzień.
563
- unearned_own: Nie łączyłeś się przez więcej niż jeden kolejny dzień.
564
554
  followers:
565
555
  conditions:
566
556
  - Bycie aktywnym i podążanie za innymi ludźmi z pewnością sprawi, że inne osoby będą za Tobą podążać.
@@ -539,16 +539,6 @@ pt-BR:
539
539
  gamification:
540
540
  all_badges_link: Veja todos os emblemas disponíveis.
541
541
  badges:
542
- continuity:
543
- conditions:
544
- - Vem aqui com frequência
545
- description: Esse selo é concedido quando você visita a plataforma regularmente. Nós gostamos de ter você por aqui!
546
- description_another: Este usuário se conectou por %{score} dias consecutivos em algum momento.
547
- description_own: Você se conectou por %{score} dias consecutivos em algum momento.
548
- name: Continue
549
- next_level_in: Conecte-se para %{score} dias consecutivos para chegar ao próximo nível!
550
- unearned_another: Este usuário não fez login por mais de um dia consecutivo.
551
- unearned_own: Você não se conectou por mais de um dia consecutivo.
552
542
  followers:
553
543
  conditions:
554
544
  - Ser ativo e seguir outras pessoas certamente fará com que outras pessoas o sigam.
@@ -539,16 +539,6 @@ pt:
539
539
  gamification:
540
540
  all_badges_link: Veja todos os crachás disponíveis.
541
541
  badges:
542
- continuity:
543
- conditions:
544
- - Vem aqui com frequência
545
- description: Esse selo é concedido quando você visita a plataforma regularmente. Nós gostamos de ter você por aqui!
546
- description_another: Este usuário conectou por %{score} dias consecutivos em algum momento.
547
- description_own: Você se conectou por %{score} dias consecutivos em algum momento.
548
- name: Continuidade
549
- next_level_in: Ligue por %{score} dias consecutivos para chegar ao próximo nível!
550
- unearned_another: Este usuário não fez login por mais de um dia consecutivo.
551
- unearned_own: Você não se conectou por mais de um dia consecutivo.
552
542
  followers:
553
543
  conditions:
554
544
  - Ser ativo e seguir outras pessoas certamente fará com que outras pessoas o sigam.
@@ -561,16 +561,6 @@ sv:
561
561
  gamification:
562
562
  all_badges_link: Se alla tillgängliga märken.
563
563
  badges:
564
- continuity:
565
- conditions:
566
- - Kommer ofta hit
567
- description: Du får detta märke om du regelbundet besöker plattformen. Vi gillar att ha dig här!
568
- description_another: Deltagaren har någon gång varit ansluten %{score} på dagar i följd.
569
- description_own: Du har någon gång varit ansluten varje dag under %{score} dagar.
570
- name: Kontinuitet
571
- next_level_in: Kom till nästa nivå genom att ansluta %{score} dagar i följd!
572
- unearned_another: Deltagaren har inte loggat in mer än en dag i följd.
573
- unearned_own: Du har inte anslutit dig mer än en dag i följd.
574
564
  followers:
575
565
  conditions:
576
566
  - Bästa sättet att få andra att följa dig är att vara aktiv och följa andra människor.
@@ -554,16 +554,6 @@ tr:
554
554
  gamification:
555
555
  all_badges_link: Tüm mevcut rozetleri görün.
556
556
  badges:
557
- continuity:
558
- conditions:
559
- - Buraya sık sık gel
560
- description: Bu rozeti, platformu düzenli bir şekilde ziyaret ettiğinizde verilir. Burada olmanızı seviyoruz!
561
- description_another: Bu kullanıcı bir noktada %{score} ardışık gün için bağlandı.
562
- description_own: Bir noktada %{score} ardışık gün için bağlandınız.
563
- name: süreklilik
564
- next_level_in: Bir sonraki seviyeye geçmek için %{score} ardışık güne bağlanın!
565
- unearned_another: Bu kullanıcı art arda birden fazla gün için giriş yapmadı.
566
- unearned_own: Birden fazla ardışık güne bağlı değilsiniz.
567
557
  followers:
568
558
  conditions:
569
559
  - Aktif olmak ve diğer insanları takip etmek kesinlikle başka insanların sizi takip etmesini sağlayacaktır.
@@ -100,13 +100,11 @@ module Decidim
100
100
 
101
101
  initializer "decidim.geocoding" do
102
102
  if Decidim.geocoder.present?
103
- Geocoder.configure(
103
+ config = {
104
104
  # geocoding service (see below for supported options):
105
- lookup: :here,
105
+ lookup: :here
106
106
  # IP address geocoding service (see below for supported options):
107
107
  # :ip_lookup => :maxmind,
108
- # to use an API key:
109
- api_key: [Decidim.geocoder&.fetch(:here_app_id), Decidim.geocoder&.fetch(:here_app_code)]
110
108
  # geocoding service request timeout, in seconds (default 3):
111
109
  # :timeout => 5,
112
110
  # set default units to kilometers:
@@ -114,7 +112,14 @@ module Decidim
114
112
  # caching (see below for details):
115
113
  # :cache => Redis.new,
116
114
  # :cache_prefix => "..."
117
- )
115
+ }
116
+ # to use an API key:
117
+ config[:api_key] = if Decidim.geocoder[:here_api_key].present?
118
+ Decidim.geocoder.fetch(:here_api_key)
119
+ else
120
+ [Decidim.geocoder.fetch(:here_app_id), Decidim.geocoder.fetch(:here_app_code)]
121
+ end
122
+ Geocoder.configure(config)
118
123
  end
119
124
  end
120
125
 
@@ -139,7 +139,6 @@ shared_examples "global search of participatory spaces" do
139
139
  "resource_id" => space.id,
140
140
  "resource_type" => space.class.name
141
141
  }.merge(searchable_resource_attrs_mapper.call(space, locale))
142
- h.merge
143
142
  h
144
143
  end
145
144
  end
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-core version.
5
5
  module Core
6
6
  def self.version
7
- "0.20.0"
7
+ "0.20.1"
8
8
  end
9
9
  end
10
10
  end
@@ -3,164 +3,209 @@
3
3
  // Tile layer for HERE maps tiles.
4
4
  L.TileLayer.HERE = L.TileLayer.extend({
5
5
 
6
- options: {
7
- subdomains: '1234',
8
- minZoom: 2,
9
- maxZoom: 18,
10
-
11
- // 🍂option scheme: String = 'normal.day'
12
- // The "map scheme", as documented in the HERE API.
13
- scheme: 'normal.day',
14
-
15
- // 🍂option resource: String = 'maptile'
16
- // The "map resource", as documented in the HERE API.
17
- resource: 'maptile',
18
-
19
- // 🍂option mapId: String = 'newest'
20
- // Version of the map tiles to be used, or a hash of an unique map
21
- mapId: 'newest',
22
-
23
- // 🍂option format: String = 'png8'
24
- // Image format to be used (`png8`, `png`, or `jpg`)
25
- format: 'png8',
26
-
27
- // 🍂option appId: String = ''
28
- // Required option. The `app_id` provided as part of the HERE credentials
29
- appId: '',
30
-
31
- // 🍂option appCode: String = ''
32
- // Required option. The `app_code` provided as part of the HERE credentials
33
- appCode: '',
34
- },
35
-
36
-
37
- initialize: function initialize(options) {
38
- options = L.setOptions(this, options);
39
-
40
- // Decide if this scheme uses the aerial servers or the basemap servers
41
- var schemeStart = options.scheme.split('.')[0];
42
- options.tileResolution = 256;
43
-
44
- if (L.Browser.retina) {
45
- options.tileResolution = 512;
46
- }
47
-
48
- // {Base URL}{Path}/{resource (tile type)}/{map id}/{scheme}/{zoom}/{column}/{row}/{size}/{format}
49
- // ?app_id={YOUR_APP_ID}
50
- // &app_code={YOUR_APP_CODE}
51
- // &{param}={value}
52
-
53
- var path = '/{resource}/2.1/{resource}/{mapId}/{scheme}/{z}/{x}/{y}/{tileResolution}/{format}?app_id={appId}&app_code={appCode}';
54
- var attributionPath = '/maptile/2.1/copyright/{mapId}?app_id={appId}&app_code={appCode}';
55
-
56
- var tileServer = 'base.maps.api.here.com';
57
- if (schemeStart == 'satellite' ||
58
- schemeStart == 'terrain' ||
59
- schemeStart == 'hybrid') {
60
- tileServer = 'aerial.maps.api.here.com';
61
- }
62
- if (options.scheme.indexOf('.traffic.') !== -1) {
63
- tileServer = 'traffic.maps.api.here.com';
64
- }
65
-
66
- var tileUrl = 'https://{s}.' + tileServer + path;
67
-
68
- this._attributionUrl = L.Util.template('https://1.' + tileServer + attributionPath, this.options);
69
-
70
- L.TileLayer.prototype.initialize.call(this, tileUrl, options);
71
-
72
- this._attributionText = '';
73
-
74
- },
75
-
76
- onAdd: function onAdd(map) {
77
- L.TileLayer.prototype.onAdd.call(this, map);
78
-
79
- if (!this._attributionBBoxes) {
80
- this._fetchAttributionBBoxes();
81
- }
82
- },
83
-
84
- onRemove: function onRemove(map) {
85
- L.TileLayer.prototype.onRemove.call(this, map);
86
-
87
- this._map.attributionControl.removeAttribution(this._attributionText);
88
-
89
- this._map.off('moveend zoomend resetview', this._findCopyrightBBox, this);
90
- },
91
-
92
- _fetchAttributionBBoxes: function _onMapMove() {
93
- var xmlhttp = new XMLHttpRequest();
94
- xmlhttp.onreadystatechange = L.bind(function(){
95
- if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
96
- this._parseAttributionBBoxes(JSON.parse(xmlhttp.responseText));
97
- }
98
- }, this);
99
- xmlhttp.open("GET", this._attributionUrl, true);
100
- xmlhttp.send();
101
- },
102
-
103
- _parseAttributionBBoxes: function _parseAttributionBBoxes(json) {
104
- if (!this._map) { return; }
105
- var providers = json[this.options.scheme.split('.')[0]] || json.normal;
106
- for (var i=0; i<providers.length; i++) {
107
- if (providers[i].boxes) {
108
- for (var j=0; j<providers[i].boxes.length; j++) {
109
- var box = providers[i].boxes[j];
110
- providers[i].boxes[j] = L.latLngBounds( [ [box[0], box[1]], [box[2], box[3]] ]);
111
- }
112
- }
113
- }
114
-
115
- this._map.on('moveend zoomend resetview', this._findCopyrightBBox, this);
116
-
117
- this._attributionProviders = providers;
118
-
119
- this._findCopyrightBBox();
120
- },
121
-
122
- _findCopyrightBBox: function _findCopyrightBBox() {
123
- if (!this._map) { return; }
124
- var providers = this._attributionProviders;
125
- var visibleProviders = [];
126
- var zoom = this._map.getZoom();
127
- var visibleBounds = this._map.getBounds();
128
-
129
- for (var i=0; i<providers.length; i++) {
130
- if (providers[i].minLevel < zoom && providers[i].maxLevel > zoom)
131
-
132
- if (!providers[i].boxes) {
133
- // No boxes = attribution always visible
134
- visibleProviders.push(providers[i]);
135
- break;
136
- }
137
-
138
- for (var j=0; j<providers[i].boxes.length; j++) {
139
- var box = providers[i].boxes[j];
140
- if (visibleBounds.overlaps(box)) {
141
- visibleProviders.push(providers[i]);
142
- break;
143
- }
144
- }
145
- }
146
-
147
- var attributions = ['<a href="https://legal.here.com/terms/serviceterms/gb/">HERE maps</a>'];
148
- for (var i=0; i<visibleProviders.length; i++) {
149
- var provider = visibleProviders[i];
150
- attributions.push('<abbr title="' + provider.alt + '">' + provider.label + '</abbr>');
151
- }
152
-
153
- var attributionText = '© ' + attributions.join(', ') + '. ';
154
-
155
- if (attributionText !== this._attributionText) {
156
- this._map.attributionControl.removeAttribution(this._attributionText);
157
- this._map.attributionControl.addAttribution(this._attributionText = attributionText);
158
- }
159
- },
6
+ options: {
7
+ subdomains: '1234',
8
+ minZoom: 2,
9
+ maxZoom: 18,
10
+
11
+ // 🍂option scheme: String = 'normal.day'
12
+ // The "map scheme", as documented in the HERE API.
13
+ scheme: 'normal.day',
14
+
15
+ // 🍂option resource: String = 'maptile'
16
+ // The "map resource", as documented in the HERE API.
17
+ resource: 'maptile',
18
+
19
+ // 🍂option mapId: String = 'newest'
20
+ // Version of the map tiles to be used, or a hash of an unique map
21
+ mapId: 'newest',
22
+
23
+ // 🍂option format: String = 'png8'
24
+ // Image format to be used (`png8`, `png`, or `jpg`)
25
+ format: 'png8',
26
+
27
+ // 🍂option appId: String = ''
28
+ // Required option. The `app_id` provided as part of the HERE credentials
29
+ appId: '',
30
+
31
+ // 🍂option appCode: String = ''
32
+ // Required option. The `app_code` provided as part of the HERE credentials
33
+ appCode: '',
34
+
35
+ // 🍂option useCIT: boolean = false
36
+ // Whether to use the CIT when loading the here-maptiles
37
+ useCIT: false,
38
+
39
+ // 🍂option useHTTPS: boolean = true
40
+ // Whether to use HTTPS when loading the here-maptiles
41
+ useHTTPS: true,
42
+
43
+ // 🍂option language: String = ''
44
+ // The language of the descriptions on the maps that are loaded
45
+ language: '',
46
+
47
+ // 🍂option language: String = ''
48
+ // The second language of the descriptions on the maps that are loaded
49
+ language2: '',
50
+ },
51
+
52
+
53
+ initialize: function initialize(options) {
54
+ options = L.setOptions(this, options);
55
+
56
+ // Decide if this scheme uses the aerial servers or the basemap servers
57
+ var schemeStart = options.scheme.split('.')[0];
58
+ options.tileResolution = 256;
59
+
60
+ // {Base URL}{Path}/{resource (tile type)}/{map id}/{scheme}/{zoom}/{column}/{row}/{size}/{format}
61
+ // ?apiKey={YOUR_API_KEY}
62
+ // &{param}={value}
63
+
64
+ var params = [
65
+ 'apiKey=' + encodeURIComponent(options.apiKey)
66
+ ];
67
+ // Fallback to old app_id,app_code if no apiKey passed
68
+ if(!options.apiKey) {
69
+ params = [
70
+ 'app_id=' + encodeURIComponent(options.appId),
71
+ 'app_code=' + encodeURIComponent(options.appCode),
72
+ ];
73
+ }
74
+ if(options.language) {
75
+ params.push('lg=' + encodeURIComponent(options.language));
76
+ }
77
+ if(options.language2) {
78
+ params.push('lg2=' + encodeURIComponent(options.language2));
79
+ }
80
+ var urlQuery = '?' + params.join('&');
81
+
82
+ var path = '/maptile/2.1/{resource}/{mapId}/{scheme}/{z}/{x}/{y}/{tileResolution}/{format}' + urlQuery;
83
+ var attributionPath = '/maptile/2.1/copyright/{mapId}?apiKey={apiKey}';
84
+
85
+ var baseUrl = 'maps.ls.hereapi.com';
86
+
87
+ // Old style with apiId/apiCode for compatibility
88
+ if(!options.apiKey) {
89
+ // make sure the CIT-url can be used
90
+ baseUrl = 'maps' + (options.useCIT ? '.cit' : '') + '.api.here.com';
91
+ attributionPath = '/maptile/2.1/copyright/{mapId}?app_id={appId}&app_code={appCode}';
92
+ }
93
+
94
+ var tileServer = 'base.' + baseUrl;
95
+ if (schemeStart == 'satellite' || schemeStart == 'terrain' || schemeStart == 'hybrid') {
96
+ tileServer = 'aerial.' + baseUrl;
97
+ }
98
+ if (options.scheme.indexOf('.traffic.') !== -1) {
99
+ tileServer = 'traffic' + baseUrl;
100
+ }
101
+
102
+ var protocol = 'http' + (options.useHTTPS ? 's' : '');
103
+ var tileUrl = protocol + '://{s}.' + tileServer + path;
104
+
105
+ this._attributionUrl = L.Util.template(protocol + '://1.' + tileServer + attributionPath, this.options);
106
+
107
+ L.TileLayer.prototype.initialize.call(this, tileUrl, options);
108
+
109
+ this._attributionText = '';
110
+
111
+ },
112
+
113
+ onAdd: function onAdd(map) {
114
+ L.TileLayer.prototype.onAdd.call(this, map);
115
+
116
+ if (!this._attributionBBoxes) {
117
+ this._fetchAttributionBBoxes();
118
+ }
119
+ },
120
+
121
+ onRemove: function onRemove(map) {
122
+ //
123
+ // Remove the attribution text, and clear the cached text so it will be recalculated
124
+ // if/when we are shown again.
125
+ //
126
+ this._map.attributionControl.removeAttribution(this._attributionText);
127
+ this._attributionText = '';
128
+
129
+ this._map.off('moveend zoomend resetview', this._findCopyrightBBox, this);
130
+
131
+ //
132
+ // Call the prototype last, once we've tidied up our own changes
133
+ //
134
+ L.TileLayer.prototype.onRemove.call(this, map);
135
+ },
136
+
137
+ _fetchAttributionBBoxes: function _onMapMove() {
138
+ var xmlhttp = new XMLHttpRequest();
139
+ xmlhttp.onreadystatechange = L.bind(function(){
140
+ if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
141
+ this._parseAttributionBBoxes(JSON.parse(xmlhttp.responseText));
142
+ }
143
+ }, this);
144
+ xmlhttp.open("GET", this._attributionUrl, true);
145
+ xmlhttp.send();
146
+ },
147
+
148
+ _parseAttributionBBoxes: function _parseAttributionBBoxes(json) {
149
+ if (!this._map) { return; }
150
+ var providers = json[this.options.scheme.split('.')[0]] || json.normal;
151
+ for (var i=0; i<providers.length; i++) {
152
+ if (providers[i].boxes) {
153
+ for (var j=0; j<providers[i].boxes.length; j++) {
154
+ var box = providers[i].boxes[j];
155
+ providers[i].boxes[j] = L.latLngBounds( [ [box[0], box[1]], [box[2], box[3]] ]);
156
+ }
157
+ }
158
+ }
159
+
160
+ this._map.on('moveend zoomend resetview', this._findCopyrightBBox, this);
161
+
162
+ this._attributionProviders = providers;
163
+
164
+ this._findCopyrightBBox();
165
+ },
166
+
167
+ _findCopyrightBBox: function _findCopyrightBBox() {
168
+ if (!this._map) { return; }
169
+ var providers = this._attributionProviders;
170
+ var visibleProviders = [];
171
+ var zoom = this._map.getZoom();
172
+ var visibleBounds = this._map.getBounds();
173
+
174
+ for (var i=0; i<providers.length; i++) {
175
+ if (providers[i].minLevel <= zoom && providers[i].maxLevel >= zoom) {
176
+
177
+ if (!providers[i].boxes) {
178
+ // No boxes = attribution always visible
179
+ visibleProviders.push(providers[i]);
180
+ } else {
181
+ for (var j=0; j<providers[i].boxes.length; j++) {
182
+ var box = providers[i].boxes[j];
183
+ if (visibleBounds.intersects(box)) {
184
+ visibleProviders.push(providers[i]);
185
+ break;
186
+ }
187
+ }
188
+ }
189
+ }
190
+ }
191
+
192
+ var attributions = ['<a href="https://legal.here.com/en-gb/terms" target="_blank" rel="noopener noreferrer">HERE maps</a>'];
193
+ for (var i=0; i<visibleProviders.length; i++) {
194
+ var provider = visibleProviders[i];
195
+ attributions.push('<abbr title="' + provider.alt + '">' + provider.label + '</abbr>');
196
+ }
197
+
198
+ var attributionText = '© ' + attributions.join(', ') + '. ';
199
+
200
+ if (attributionText !== this._attributionText) {
201
+ this._map.attributionControl.removeAttribution(this._attributionText);
202
+ this._map.attributionControl.addAttribution(this._attributionText = attributionText);
203
+ }
204
+ },
160
205
 
161
206
  });
162
207
 
163
208
 
164
209
  L.tileLayer.here = function(opts){
165
- return new L.TileLayer.HERE(opts);
210
+ return new L.TileLayer.HERE(opts);
166
211
  }