From 3ecc8d392ab16c07c1c3ab7ddfd51da4462acd5c Mon Sep 17 00:00:00 2001 From: Sebastian Felix Zappe Date: Wed, 24 May 2017 17:04:27 +0200 Subject: [PATCH 1/4] Use CDN for accessibility.cloud JS --- app/assets/javascripts/nodes.coffee | 1 - app/views/nodes/_node_nearby.html.haml | 41 +++++++++++++------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/app/assets/javascripts/nodes.coffee b/app/assets/javascripts/nodes.coffee index eeb2436d1..5bd8a4487 100644 --- a/app/assets/javascripts/nodes.coffee +++ b/app/assets/javascripts/nodes.coffee @@ -1,6 +1,5 @@ #= require jquery #= require jquery_ujs -#= require accessibility.cloud-3.2.1-21a6710d.min #= require jquery/jquery.cookies.js #= require i18n.js #= require bootstrap-transition diff --git a/app/views/nodes/_node_nearby.html.haml b/app/views/nodes/_node_nearby.html.haml index 507f38166..703891d6f 100644 --- a/app/views/nodes/_node_nearby.html.haml +++ b/app/views/nodes/_node_nearby.html.haml @@ -2,23 +2,24 @@ %h2=t('.places_nearby') %section.node-nearby-locations-from-partners-list -- content_for :javascript do - :javascript - window.onAccessibilityCloudLoaded = function (AccessibilityCloud) { - var containerElement = document.querySelector('section.node-nearby-locations-from-partners'); - var element = document.querySelector('section.node-nearby-locations-from-partners-list'); - AccessibilityCloud.render(element, { - token: '27be4b5216aced82122d7cf8f69e4a07', - locale: document.getElementsByTagName('html')[0].getAttribute('lang'), - requestParameters: { - latitude: #{@node.lat}, - longitude: #{@node.lon}, - accuracy: 1000, // include places within 1 km radius - limit: 10, - excludeSourceIds: ['LiBTS67TjmBcXdEmX'], // excludes Wheelmap's own PoIs from results - }, - onSuccess: function() { - containerElement.classList.add('has-results'); - } - }); - } \ No newline at end of file +:javascript + window.onAccessibilityCloudLoaded = function (AccessibilityCloud) { + var containerElement = document.querySelector('section.node-nearby-locations-from-partners'); + var element = document.querySelector('section.node-nearby-locations-from-partners-list'); + AccessibilityCloud.render(element, { + token: '27be4b5216aced82122d7cf8f69e4a07', + locale: document.getElementsByTagName('html')[0].getAttribute('lang'), + requestParameters: { + latitude: #{@node.lat}, + longitude: #{@node.lon}, + accuracy: 1000, // include places within 1 km radius + limit: 10, + excludeSourceIds: ['LiBTS67TjmBcXdEmX'], // excludes Wheelmap's own PoIs from results + }, + onSuccess: function() { + containerElement.classList.add('has-results'); + } + }); + } + +%script{type:"text/javascript", async: true, defer: true, src: "https://cdn.jsdelivr.net/gh/sozialhelden/accessibility-cloud-js@3.2.1/build/example/accessibility.cloud-3.2.1-21a6710d.min.js"} \ No newline at end of file From 8d7481868e499f45c6bafaf3826caed10cac7891 Mon Sep 17 00:00:00 2001 From: Sebastian Felix Zappe Date: Wed, 24 May 2017 17:04:40 +0200 Subject: [PATCH 2/4] Better padding for accessibility.cloud widget --- app/assets/stylesheets/relaunch/_nodes.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/assets/stylesheets/relaunch/_nodes.scss b/app/assets/stylesheets/relaunch/_nodes.scss index 277d82592..f2a4dc955 100644 --- a/app/assets/stylesheets/relaunch/_nodes.scss +++ b/app/assets/stylesheets/relaunch/_nodes.scss @@ -308,6 +308,11 @@ $node-photos-width: (100% - $node-photos-gutter * $node-photos-columns) / $node- .ac-licenses { font-size: $fontSizeSmall; color: lighten($yellow-gray, 30%); + margin-bottom: 1em; + } + + .ac-licenses a { + font-size: $fontSizeSmall; } .ac-result dt { From 23e4b9b3d62253e4f84409271f8e6aa9e98be7ed Mon Sep 17 00:00:00 2001 From: Sebastian Felix Zappe Date: Wed, 24 May 2017 17:05:08 +0200 Subject: [PATCH 3/4] =?UTF-8?q?Add=20=E2=80=9Eplaces=20nearby=E2=80=9C=20d?= =?UTF-8?q?e=20+=20en=20translations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/locales/de/relaunch.yml | 2 ++ config/locales/en/relaunch.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/config/locales/de/relaunch.yml b/config/locales/de/relaunch.yml index 5036f16b4..5d9edde3e 100644 --- a/config/locales/de/relaunch.yml +++ b/config/locales/de/relaunch.yml @@ -105,6 +105,8 @@ de: alert: 'Bitte beachte: Auf dem Foto sollte der Eingangsbereich des Ortes gut zu erkennen sein. Soll heißen: Gibt es Stufen am Eingang? Wie hoch ist die Stufe ungefähr? Wie breit ist die Tür? Das Foto muss das Format JPG oder PNG haben. Die maximale Größe eines Fotos darf 10 MB nicht überschreiten.' node_similar: similar: 'Ähnliche Orte: %{name}' + node_nearby: + places_nearby: 'Orte in der Nähe:' node_status: accessible_toilet: 'Rollstuhlgerechtes WC:' premium: '%{name} sagt: dieser Ort ist' diff --git a/config/locales/en/relaunch.yml b/config/locales/en/relaunch.yml index 75af57ecf..5f42351b2 100644 --- a/config/locales/en/relaunch.yml +++ b/config/locales/en/relaunch.yml @@ -106,6 +106,8 @@ en: alert: 'Please note: The entrance should be clearly visible in the photo in order to show the following: Are there steps at the entrance? Approximately how high is the step? How wide is the door? The photograph must be in a JPG or PNG format. It should not be larger than 10 MB.' node_similar: similar: 'Similar places: %{name}' + node_nearby: + places_nearby: 'Places nearby:' node_status: accessible_toilet: 'Wheelchair accessible toilet:' premium: '%{name} says: this place is' From a3891031c9123677a93f4178968a09bfd6f30636 Mon Sep 17 00:00:00 2001 From: Sebastian Felix Zappe Date: Wed, 24 May 2017 21:20:47 +0200 Subject: [PATCH 4/4] Check hash integrity for accessibility.cloud JS --- app/views/nodes/_node_nearby.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/nodes/_node_nearby.html.haml b/app/views/nodes/_node_nearby.html.haml index 703891d6f..a0d7f668b 100644 --- a/app/views/nodes/_node_nearby.html.haml +++ b/app/views/nodes/_node_nearby.html.haml @@ -22,4 +22,4 @@ }); } -%script{type:"text/javascript", async: true, defer: true, src: "https://cdn.jsdelivr.net/gh/sozialhelden/accessibility-cloud-js@3.2.1/build/example/accessibility.cloud-3.2.1-21a6710d.min.js"} \ No newline at end of file +%script{type:"text/javascript", integrity: "sha384-JB8vgUWMMtbXpvZ9XOVIM+9XGqGhC0KExgoge8mCxuKSD9KzN6idJ6je0vEy4ezM", crossorigin: "anonymous", async: true, defer: true, src: "https://cdn.jsdelivr.net/gh/sozialhelden/accessibility-cloud-js@3.2.1/build/example/accessibility.cloud-3.2.1-21a6710d.min.js"} \ No newline at end of file