Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade accessibility.cloud widget to v3.2.1 (Part II) #620

Merged
merged 4 commits into from
May 30, 2017
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app/assets/javascripts/nodes.coffee
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions app/assets/stylesheets/relaunch/_nodes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
41 changes: 21 additions & 20 deletions app/views/nodes/_node_nearby.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
});
}
: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/[email protected]/build/example/accessibility.cloud-3.2.1-21a6710d.min.js"}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

2 changes: 2 additions & 0 deletions config/locales/de/relaunch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 2 additions & 0 deletions config/locales/en/relaunch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down