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.
- checksums.yaml +4 -4
- data/app/assets/javascripts/decidim/core/bundle.js +1 -1
- data/app/assets/javascripts/decidim/core/bundle.js.map +1 -1
- data/app/assets/javascripts/decidim/map.js.es6 +10 -6
- data/app/helpers/decidim/map_helper.rb +10 -3
- data/app/services/decidim/static_map_generator.rb +8 -3
- data/config/locales/ar.yml +31 -13
- data/config/locales/ca.yml +0 -10
- data/config/locales/cs.yml +6 -11
- data/config/locales/de.yml +4 -14
- data/config/locales/el-GR.yml +153 -0
- data/config/locales/eo-UY.yml +0 -4
- data/config/locales/es-MX.yml +0 -10
- data/config/locales/es-PY.yml +0 -10
- data/config/locales/es.yml +0 -10
- data/config/locales/eu.yml +0 -10
- data/config/locales/fi-plain.yml +0 -10
- data/config/locales/fi.yml +2 -12
- data/config/locales/fr.yml +3 -13
- data/config/locales/gl.yml +0 -10
- data/config/locales/hu.yml +17 -27
- data/config/locales/id-ID.yml +0 -10
- data/config/locales/is-IS.yml +462 -0
- data/config/locales/it.yml +7 -17
- data/config/locales/nl.yml +0 -10
- data/config/locales/no.yml +711 -13
- data/config/locales/pl.yml +0 -10
- data/config/locales/pt-BR.yml +0 -10
- data/config/locales/pt.yml +0 -10
- data/config/locales/sv.yml +0 -10
- data/config/locales/tr-TR.yml +0 -10
- data/lib/decidim/core/engine.rb +10 -5
- data/lib/decidim/core/test/shared_examples/searchable_participatory_space_examples.rb +0 -1
- data/lib/decidim/core/version.rb +1 -1
- data/vendor/assets/javascripts/leaflet-tilelayer-here.js +200 -155
- metadata +17 -15
data/config/locales/pl.yml
CHANGED
@@ -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ć.
|
data/config/locales/pt-BR.yml
CHANGED
@@ -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.
|
data/config/locales/pt.yml
CHANGED
@@ -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.
|
data/config/locales/sv.yml
CHANGED
@@ -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.
|
data/config/locales/tr-TR.yml
CHANGED
@@ -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.
|
data/lib/decidim/core/engine.rb
CHANGED
@@ -100,13 +100,11 @@ module Decidim
|
|
100
100
|
|
101
101
|
initializer "decidim.geocoding" do
|
102
102
|
if Decidim.geocoder.present?
|
103
|
-
|
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
|
|
data/lib/decidim/core/version.rb
CHANGED
@@ -3,164 +3,209 @@
|
|
3
3
|
// Tile layer for HERE maps tiles.
|
4
4
|
L.TileLayer.HERE = L.TileLayer.extend({
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
//
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
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
|
-
|
210
|
+
return new L.TileLayer.HERE(opts);
|
166
211
|
}
|